Package io.atomix.client.value
Interface AtomicValue<V>
- Type Parameters:
V- value type
- All Superinterfaces:
DistributedPrimitive,SyncPrimitive<AtomicValue<V>,AsyncAtomicValue<V>>
Distributed version of java.util.concurrent.atomic.AtomicReference.
-
Field Summary
Fields inherited from interface io.atomix.client.SyncPrimitive
DEFAULT_OPERATION_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> AtomicValueBuilder<V>builder(AtomixChannel channel) Returns a new AtomicValue builder.get()Gets the current value.default Cancellablelisten(AtomicValueEventListener<V> listener) Registers the specified listener to be notified whenever the atomic value is updated.listen(AtomicValueEventListener<V> listener, Executor executor) Registers the specified listener to be notified whenever the atomic value is updated.Sets to the given value.Sets to the given value.Methods inherited from interface io.atomix.client.DistributedPrimitive
nameMethods inherited from interface io.atomix.client.SyncPrimitive
async, close
-
Method Details
-
builder
Returns a new AtomicValue builder.- Parameters:
channel- the AtomixChannel- Returns:
- the AtomicValue builder
-
get
Gets the current value.- Returns:
- current value
-
set
Sets to the given value.- Parameters:
value- new value- Returns:
- previous versioned value
-
set
Sets to the given value.- Parameters:
value- new value- Returns:
- previous versioned value
-
listen
Registers the specified listener to be notified whenever the atomic value is updated.- Parameters:
listener- listener to notify about events
-
listen
Registers the specified listener to be notified whenever the atomic value is updated.- Parameters:
listener- listener to notify about events
-