public class AtomicReferenceProxy<E> extends AbstractDistributedObject<AtomicReferenceService> implements AsyncAtomicReference<E>
PARTITIONING_STRATEGY| Constructor and Description |
|---|
AtomicReferenceProxy(String name,
NodeEngine nodeEngine,
AtomicReferenceService service) |
| Modifier and Type | Method and Description |
|---|---|
void |
alter(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it.
|
E |
alterAndGet(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it and
gets the result.
|
InternalCompletableFuture<E> |
alterAndGetAsync(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it and
gets the result.
|
InternalCompletableFuture<Void> |
alterAsync(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it.
|
<R> R |
apply(IFunction<E,R> function)
Applies a function on the value, the actual stored value will not
change.
|
<R> InternalCompletableFuture<R> |
applyAsync(IFunction<E,R> function)
Applies a function on the value, the actual stored value will not
change.
|
InternalCompletableFuture<Void> |
asyncAlter(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it.
|
InternalCompletableFuture<E> |
asyncAlterAndGet(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it and gets the result.
|
<R> InternalCompletableFuture<R> |
asyncApply(IFunction<E,R> function)
Applies a function on the value, the actual stored value will not change.
|
InternalCompletableFuture<Void> |
asyncClear()
Clears the current stored reference.
|
InternalCompletableFuture<Boolean> |
asyncCompareAndSet(E expect,
E update)
Atomically sets the value to the given updated value
only if the current value
== the expected value. |
InternalCompletableFuture<Boolean> |
asyncContains(E value)
Checks if the reference contains the value.
|
InternalCompletableFuture<E> |
asyncGet()
Gets the current value.
|
InternalCompletableFuture<E> |
asyncGetAndAlter(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it on and gets the old value.
|
InternalCompletableFuture<E> |
asyncGetAndSet(E newValue)
Gets the value and sets the new value.
|
InternalCompletableFuture<Boolean> |
asyncIsNull()
Checks if the stored reference is null.
|
InternalCompletableFuture<Void> |
asyncSet(E newValue)
Atomically sets the given value.
|
InternalCompletableFuture<E> |
asyncSetAndGet(E update)
Sets and gets the value.
|
void |
clear()
Clears the current stored reference.
|
InternalCompletableFuture<Void> |
clearAsync()
Clears the current stored reference.
|
boolean |
compareAndSet(E expect,
E update)
Atomically sets the value to the given updated value
only if the current value
== the expected value. |
InternalCompletableFuture<Boolean> |
compareAndSetAsync(E expect,
E update)
Atomically sets the value to the given updated value only if the
current value
== the expected value. |
boolean |
contains(E expected)
Checks if the reference contains the value.
|
InternalCompletableFuture<Boolean> |
containsAsync(E expected)
Checks if the reference contains the value.
|
E |
get()
Gets the current value.
|
E |
getAndAlter(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it on
and gets the old value.
|
InternalCompletableFuture<E> |
getAndAlterAsync(IFunction<E,E> function)
Alters the currently stored reference by applying a function on it on
and gets the old value.
|
E |
getAndSet(E newValue)
Gets the old value and sets the new value.
|
InternalCompletableFuture<E> |
getAndSetAsync(E newValue)
Gets the value and sets the new value.
|
InternalCompletableFuture<E> |
getAsync()
Gets the current value.
|
String |
getName()
Returns the unique name for this DistributedObject.
|
int |
getPartitionId() |
String |
getServiceName()
Returns the service name for this object.
|
boolean |
isNull()
Checks if the stored reference is
null. |
InternalCompletableFuture<Boolean> |
isNullAsync()
Checks if the stored reference is
null. |
void |
set(E newValue)
Atomically sets the given value.
|
E |
setAndGet(E update)
Sets and gets the value.
|
InternalCompletableFuture<Void> |
setAsync(E newValue)
Atomically sets the given value.
|
String |
toString() |
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, postDestroy, preDestroy, throwNotActiveException, toDataclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getPartitionKeypublic AtomicReferenceProxy(String name, NodeEngine nodeEngine, AtomicReferenceService service)
public void alter(IFunction<E,E> function)
IAtomicReferencealter in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic InternalCompletableFuture<Void> alterAsync(IFunction<E,E> function)
IAtomicReferencealterAsync in interface IAtomicReference<E>function - the functionpublic InternalCompletableFuture<Void> asyncAlter(IFunction<E,E> function)
AsyncAtomicReferenceasyncAlter in interface AsyncAtomicReference<E>function - the functionpublic E alterAndGet(IFunction<E,E> function)
IAtomicReferencealterAndGet in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic InternalCompletableFuture<E> alterAndGetAsync(IFunction<E,E> function)
IAtomicReferencealterAndGetAsync in interface IAtomicReference<E>function - the functionpublic InternalCompletableFuture<E> asyncAlterAndGet(IFunction<E,E> function)
AsyncAtomicReferenceasyncAlterAndGet in interface AsyncAtomicReference<E>function - the functionpublic E getAndAlter(IFunction<E,E> function)
IAtomicReferencegetAndAlter in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic InternalCompletableFuture<E> getAndAlterAsync(IFunction<E,E> function)
IAtomicReferencegetAndAlterAsync in interface IAtomicReference<E>function - the functionpublic InternalCompletableFuture<E> asyncGetAndAlter(IFunction<E,E> function)
AsyncAtomicReferenceasyncGetAndAlter in interface AsyncAtomicReference<E>function - the functionpublic <R> R apply(IFunction<E,R> function)
IAtomicReferenceapply in interface IAtomicReference<E>function - the function applied on the value, the stored value does not changepublic <R> InternalCompletableFuture<R> applyAsync(IFunction<E,R> function)
IAtomicReferenceapplyAsync in interface IAtomicReference<E>function - the functionpublic <R> InternalCompletableFuture<R> asyncApply(IFunction<E,R> function)
AsyncAtomicReferenceasyncApply in interface AsyncAtomicReference<E>function - the functionpublic void clear()
IAtomicReferenceclear in interface IAtomicReference<E>public InternalCompletableFuture<Void> clearAsync()
IAtomicReferenceclearAsync in interface IAtomicReference<E>public InternalCompletableFuture<Void> asyncClear()
AsyncAtomicReferenceasyncClear in interface AsyncAtomicReference<E>public boolean compareAndSet(E expect, E update)
IAtomicReference== the expected value.compareAndSet in interface IAtomicReference<E>expect - the expected valueupdate - the new valuetrue if successful; or false if the actual value
was not equal to the expected valuepublic InternalCompletableFuture<Boolean> compareAndSetAsync(E expect, E update)
IAtomicReference== the expected value.compareAndSetAsync in interface IAtomicReference<E>expect - the expected valueupdate - the new valuetrue if successful; or false if the actual value
was not equal to the expected valuepublic InternalCompletableFuture<Boolean> asyncCompareAndSet(E expect, E update)
AsyncAtomicReference== the expected value.asyncCompareAndSet in interface AsyncAtomicReference<E>expect - the expected valueupdate - the new valuepublic E get()
IAtomicReferenceget in interface IAtomicReference<E>public InternalCompletableFuture<E> getAsync()
IAtomicReferencegetAsync in interface IAtomicReference<E>public InternalCompletableFuture<E> asyncGet()
AsyncAtomicReferenceasyncGet in interface AsyncAtomicReference<E>public boolean contains(E expected)
IAtomicReferencecontains in interface IAtomicReference<E>expected - the value to check (is allowed to be null)true if the value is found, false otherwisepublic InternalCompletableFuture<Boolean> containsAsync(E expected)
IAtomicReferencecontainsAsync in interface IAtomicReference<E>expected - the value to check (is allowed to be null)true if the value is found, false otherwisepublic InternalCompletableFuture<Boolean> asyncContains(E value)
AsyncAtomicReferenceasyncContains in interface AsyncAtomicReference<E>value - the value to check (is allowed to be null).public void set(E newValue)
IAtomicReferenceset in interface IAtomicReference<E>newValue - the new valuepublic InternalCompletableFuture<Void> setAsync(E newValue)
IAtomicReferencesetAsync in interface IAtomicReference<E>newValue - the new valuepublic InternalCompletableFuture<Void> asyncSet(E newValue)
AsyncAtomicReferenceasyncSet in interface AsyncAtomicReference<E>newValue - the new valuepublic E getAndSet(E newValue)
IAtomicReferencegetAndSet in interface IAtomicReference<E>newValue - the new valuepublic InternalCompletableFuture<E> getAndSetAsync(E newValue)
IAtomicReferencegetAndSetAsync in interface IAtomicReference<E>newValue - the new valuepublic InternalCompletableFuture<E> asyncGetAndSet(E newValue)
AsyncAtomicReferenceasyncGetAndSet in interface AsyncAtomicReference<E>newValue - the new value.public E setAndGet(E update)
IAtomicReferencesetAndGet in interface IAtomicReference<E>update - the new valuepublic InternalCompletableFuture<E> asyncSetAndGet(E update)
AsyncAtomicReferenceasyncSetAndGet in interface AsyncAtomicReference<E>update - the new valuepublic boolean isNull()
IAtomicReferencenull.isNull in interface IAtomicReference<E>true if null, false otherwisepublic InternalCompletableFuture<Boolean> isNullAsync()
IAtomicReferencenull.isNullAsync in interface IAtomicReference<E>true if null, false otherwisepublic InternalCompletableFuture<Boolean> asyncIsNull()
AsyncAtomicReferenceasyncIsNull in interface AsyncAtomicReference<E>public String getName()
DistributedObjectDistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject.getName in interface DistributedObjectpublic int getPartitionId()
public String getServiceName()
DistributedObjectgetServiceName in interface DistributedObjectgetServiceName in class AbstractDistributedObject<AtomicReferenceService>public String toString()
toString in class AbstractDistributedObject<AtomicReferenceService>Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.