Interface BlockingReference<T>
- Type Parameters:
T- the referenced type
- All Superinterfaces:
Reference<T>
Encapsulates thread-safe reading/writing on an object reference.
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.Reference
Reference.Reader<T>, Reference.ReferenceReader<T,V> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BlockingReference<T>of(T initialValue) default BlockingReference.Writer<T>Returns a thread-safe writer of this reference.writer(UnaryOperator<T> updater) Returns a thread-safe writer of this reference.default BlockingReference.Writer<T>Returns a thread-safe writer of this reference.
-
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
-