KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > CopyOnWrite


1 package hudson;
2
3 import java.lang.annotation.Documented JavaDoc;
4 import static java.lang.annotation.ElementType.FIELD JavaDoc;
5 import java.lang.annotation.Retention JavaDoc;
6 import static java.lang.annotation.RetentionPolicy.SOURCE JavaDoc;
7 import java.lang.annotation.Target JavaDoc;
8
9 /**
10  * Represents fields that are protected for concurrency by the copy-on-write semantics.
11  *
12  * <p>
13  * Fields marked by this annotation always holds on to an immutable collection.
14  * A change to the collection must be done by first creating a new collection
15  * object, making changes, then replacing the reference atomically.
16  *
17  * <p>
18  * This allows code to access the field without synchronization, and
19  * greatly reduces the risk of dead-lock bugs.
20  *
21  * <p>
22  * The field marked with this annotation usually needs to be marked as
23  * <tt>volatile</tt>.
24  *
25  * @author Kohsuke Kawaguchi
26  */

27 @Retention JavaDoc(SOURCE)
28 @Documented JavaDoc
29 @Target JavaDoc(FIELD)
30 public @interface CopyOnWrite {
31 }
32
Popular Tags