Interface DistributedPrimitive

All Known Subinterfaces:
AsyncAtomicCounter, AsyncAtomicMap<K,V>, AsyncDistributedCollection<E>, AsyncDistributedSet<E>, AsyncPrimitive, AtomicCounter, AtomicMap<K,V>, DistributedCollection<E>, DistributedSet<E>, SyncPrimitive
All Known Implementing Classes:
DelegatingAsyncPrimitive, Synchronous

public interface DistributedPrimitive
Interface for all distributed primitives.
  • Field Details

    • DEFAULT_OPERATION_TIMEOUT_MILLIS

      static final long DEFAULT_OPERATION_TIMEOUT_MILLIS
      Default timeout for primitive operations.
      See Also:
  • Method Details

    • name

      String name()
      Returns the name of this primitive.
      Returns:
      name
    • addStateChangeListener

      default void addStateChangeListener(Consumer<PrimitiveState> listener)
      Registers a listener to be called when the primitive's state changes.
      Parameters:
      listener - The listener to be called when the state changes.
    • removeStateChangeListener

      default void removeStateChangeListener(Consumer<PrimitiveState> listener)
      Unregisters a previously registered listener to be called when the primitive's state changes.
      Parameters:
      listener - The listener to unregister