1 package ch.elca.el4j.util.concurrency;
2 import java.lang.annotation.*;
3
4 /*
5 * Copyright (c) 2005 Brian Goetz and Tim Peierls
6 * Released under the Creative Commons Attribution License
7 * (http://creativecommons.org/licenses/by/2.5)
8 * Official home: http://www.jcip.net
9 *
10 * Any republication or derived work distributed in source code form
11 * must include this copyright and license notice.
12 */
13
14 /**
15 * The class to which this annotation is applied is immutable. This means that
16 * its state cannot be seen to change by callers, which implies that
17 * <ul>
18 * <li> all public fields are final, </li>
19 * <li> all public final reference fields refer to other immutable objects, and </li>
20 * <li> constructors and methods do not publish references to any internal state
21 * which is potentially mutable by the implementation. </li>
22 * </ul>
23 * Immutable objects may still have internal mutable state for purposes of performance
24 * optimization; some state variables may be lazily computed, so long as they are computed
25 * from immutable state and that callers cannot tell the difference.
26 * <p>
27 * Immutable objects are inherently thread-safe; they may be passed between threads or
28 * published without synchronization.
29 *
30 * @svnLink $Revision: 3875 $;$Date: 2009-08-04 14:35:53 +0200 (Di, 04. Aug 2009) $;$Author: swismer $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/core/src/main/java/ch/elca/el4j/util/concurrency/Immutable.java $
31 */
32 @Documented
33 @Target(ElementType.TYPE)
34 @Retention(RetentionPolicy.RUNTIME)
35 public @interface Immutable {
36 }