Package io.atomix.client
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault timeout for primitive operations. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddStateChangeListener(Consumer<PrimitiveState> listener) Registers a listener to be called when the primitive's state changes.name()Returns the name of this primitive.default voidremoveStateChangeListener(Consumer<PrimitiveState> listener) Unregisters a previously registered listener to be called when the primitive's state changes.
-
Field Details
-
DEFAULT_OPERATION_TIMEOUT_MILLIS
static final long DEFAULT_OPERATION_TIMEOUT_MILLISDefault timeout for primitive operations.- See Also:
-
-
Method Details
-
name
String name()Returns the name of this primitive.- Returns:
- name
-
addStateChangeListener
Registers a listener to be called when the primitive's state changes.- Parameters:
listener- The listener to be called when the state changes.
-
removeStateChangeListener
Unregisters a previously registered listener to be called when the primitive's state changes.- Parameters:
listener- The listener to unregister
-