Interface BlockingReference.Writer<T>

Type Parameters:
T - the referenced type
All Superinterfaces:
Supplier<T>, org.wildfly.clustering.function.Supplier<T>
All Known Implementing Classes:
BlockingReference.ReferenceWriter
Enclosing interface:
BlockingReference<T>

public static interface BlockingReference.Writer<T> extends org.wildfly.clustering.function.Supplier<T>
Describes the writer of a reference.
Author:
Paul Ferraro
  • Field Summary

    Fields inherited from interface org.wildfly.clustering.function.Supplier

    NULL
  • Method Summary

    Modifier and Type
    Method
    Description
    map(org.wildfly.clustering.function.Function<T,R> mapper)
    Returns a mapped writer, whose mapping function is invoked while holding a lock.
    org.wildfly.clustering.function.Supplier<T>
    when(org.wildfly.clustering.function.Predicate<T> condition)
    Returns a supplier whose Supplier.get() will update the reference only when the specified condition (invoked while holding a lock) is met.

    Methods inherited from interface Supplier

    get

    Methods inherited from interface org.wildfly.clustering.function.Supplier

    handle, thenAccept, thenApply, thenApplyAsDouble, thenApplyAsInt, thenApplyAsLong, thenTest
  • Method Details

    • map

      <R> BlockingReference.Writer<R> map(org.wildfly.clustering.function.Function<T,R> mapper)
      Returns a mapped writer, whose mapping function is invoked while holding a lock.
      Type Parameters:
      R - the type of the mapped writer
      Parameters:
      mapper - a mapping function
      Returns:
      a mapped writer
    • when

      org.wildfly.clustering.function.Supplier<T> when(org.wildfly.clustering.function.Predicate<T> condition)
      Returns a supplier whose Supplier.get() will update the reference only when the specified condition (invoked while holding a lock) is met.
      Parameters:
      condition - a condition for which this reference should be updated
      Returns:
      a supplier for updating this reference.