Class BlockingReference.ReferenceWriter<T,V>
java.lang.Object
org.wildfly.clustering.server.util.BlockingReference.ReferenceWriter<T,V>
- Type Parameters:
T- the referenced object typeV- the mapped type
- All Implemented Interfaces:
Supplier<V>, org.wildfly.clustering.function.Supplier<V>, BlockingReference.Writer<V>
- Enclosing interface:
BlockingReference<T>
public static class BlockingReference.ReferenceWriter<T,V>
extends Object
implements BlockingReference.Writer<V>
A writer implementation for a reference.
- Author:
- Paul Ferraro
-
Field Summary
Fields inherited from interface org.wildfly.clustering.function.Supplier
NULL -
Method Summary
Modifier and TypeMethodDescriptionget()<R> BlockingReference.Writer<R> Returns a mapped writer, whose mapping function is invoked while holding a lock.org.wildfly.clustering.function.Supplier<V> Returns a supplier whoseSupplier.get()will update the reference only when the specified condition (invoked while holding a lock) is met.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.clustering.function.Supplier
handle, thenAccept, thenApply, thenApplyAsDouble, thenApplyAsInt, thenApplyAsLong, thenTest
-
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
public org.wildfly.clustering.function.Supplier<V> when(org.wildfly.clustering.function.Predicate<V> condition) 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.
-