Class BlockingReference.ReferenceWriter<T,V>
java.lang.Object
org.wildfly.clustering.server.util.BlockingReference.ReferenceWriter<T,V>
- All Implemented Interfaces:
Supplier<V>,BlockingReference.Writer<V>
- Enclosing interface:
- BlockingReference<T>
public static class BlockingReference.ReferenceWriter<T,V>
extends Object
implements BlockingReference.Writer<V>
-
Method Summary
Modifier and TypeMethodDescriptionget()<R> BlockingReference.Writer<R>Returns a mapped writer, whose mapping function is invoked while holding a lock.Returns a supplier whoseSupplier.get()will update the reference only when the specified condition (invoked while holding a lock) is met.
-
Method Details
-
get
-
map
Description copied from interface:BlockingReference.WriterReturns a mapped writer, whose mapping function is invoked while holding a lock.- Specified by:
mapin interfaceBlockingReference.Writer<T>- Type Parameters:
R- the type of the mapped writer- Parameters:
mapper- a mapping function- Returns:
- a mapped writer
-
when
Description copied from interface:BlockingReference.WriterReturns a supplier whoseSupplier.get()will update the reference only when the specified condition (invoked while holding a lock) is met.- Specified by:
whenin interfaceBlockingReference.Writer<T>- Parameters:
condition- a condition for which this reference should be updated- Returns:
- a supplier for updating this reference.
-