Interface Reference<T>
- Type Parameters:
T- the referenced type
- All Superinterfaces:
ReadableReference<T>
Encapsulates a thread-safe read/write reference to an object.
Semantically analogous to
AtomicReference, but uses read/write locks instead of CAS operations.- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic interfaceNested classes/interfaces inherited from interface org.wildfly.clustering.server.util.ReadableReference
ReadableReference.Reader<T>, ReadableReference.ReferenceReader<T,V> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Reference<T>of(T initialValue) default Reference.Writer<T>Returns a thread-safe writer of this reference.writer(UnaryOperator<T> updater) Returns a thread-safe writer of this reference.default Reference.Writer<T>Returns a thread-safe writer of this reference.Methods inherited from interface org.wildfly.clustering.server.util.ReadableReference
reader
-
Method Details
-
writer
Returns a thread-safe writer of this reference.- Parameters:
value- the target value of this reference- Returns:
- a thread-safe reader of this reference.
-
writer
Returns a thread-safe writer of this reference.- Parameters:
supplier- supplier of the target value of this reference- Returns:
- a thread-safe reader of this reference.
-
writer
Returns a thread-safe writer of this reference.- Parameters:
updater- operator returning the target value of this reference based on the current value- Returns:
- a thread-safe reader of this reference.
-
of
-