E - type of referenced objectpublic class ClientAtomicReferenceProxy<E> extends ClientProxy implements IAtomicReference<E>
IAtomicReference.name| Constructor and Description |
|---|
ClientAtomicReferenceProxy(String serviceName,
String objectId,
ClientContext context) |
| 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.
|
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.
|
protected ClientMessage |
invokeOnPartition(ClientMessage req) |
protected <T> T |
invokeOnPartition(ClientMessage clientMessage,
long invocationTimeoutSeconds) |
protected <T> ClientDelegatingFuture<T> |
invokeOnPartitionAsync(ClientMessage clientMessage,
ClientMessageDecoder clientMessageDecoder) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage,
long invocationTimeoutSeconds) |
boolean |
isNull()
Checks if the stored reference is
null. |
InternalCompletableFuture<Boolean> |
isNullAsync()
Checks if the stored reference is
null. |
protected void |
onInitialize()
Called when proxy is created.
|
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() |
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObjectclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getName, getPartitionKey, getServiceNamepublic ClientAtomicReferenceProxy(String serviceName, String objectId, ClientContext context)
public <R> InternalCompletableFuture<R> applyAsync(IFunction<E,R> function)
IAtomicReferenceapplyAsync in interface IAtomicReference<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 InternalCompletableFuture<Void> alterAsync(IFunction<E,E> function)
IAtomicReferencealterAsync in interface IAtomicReference<E>function - the functionpublic void alter(IFunction<E,E> function)
IAtomicReferencealter 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 E alterAndGet(IFunction<E,E> function)
IAtomicReferencealterAndGet 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 E getAndAlter(IFunction<E,E> function)
IAtomicReferencegetAndAlter in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic 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 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> 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 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<E> getAsync()
IAtomicReferencegetAsync in interface IAtomicReference<E>public E get()
IAtomicReferenceget in interface IAtomicReference<E>public InternalCompletableFuture<Void> setAsync(E newValue)
IAtomicReferencesetAsync in interface IAtomicReference<E>newValue - the new valuepublic void set(E newValue)
IAtomicReferenceset in interface IAtomicReference<E>newValue - the new valuepublic InternalCompletableFuture<Void> clearAsync()
IAtomicReferenceclearAsync in interface IAtomicReference<E>public void clear()
IAtomicReferenceclear in interface IAtomicReference<E>public InternalCompletableFuture<E> getAndSetAsync(E newValue)
IAtomicReferencegetAndSetAsync in interface IAtomicReference<E>newValue - the new valuepublic E getAndSet(E newValue)
IAtomicReferencegetAndSet in interface IAtomicReference<E>newValue - the new valuepublic E setAndGet(E update)
IAtomicReferencesetAndGet in interface IAtomicReference<E>update - the new valuepublic InternalCompletableFuture<Boolean> isNullAsync()
IAtomicReferencenull.isNullAsync in interface IAtomicReference<E>true if null, false otherwisepublic boolean isNull()
IAtomicReferencenull.isNull in interface IAtomicReference<E>true if null, false otherwiseprotected void onInitialize()
ClientProxyonInitialize in class ClientProxyprotected ClientMessage invokeOnPartition(ClientMessage req)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage) throws InterruptedException
InterruptedExceptionprotected <T> ClientDelegatingFuture<T> invokeOnPartitionAsync(ClientMessage clientMessage, ClientMessageDecoder clientMessageDecoder)
protected <T> T invokeOnPartition(ClientMessage clientMessage, long invocationTimeoutSeconds)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage, long invocationTimeoutSeconds) throws InterruptedException
InterruptedExceptionCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.