public class ClientAtomicReferenceProxy<E> extends ClientProxy implements IAtomicReference<E>
| Constructor and Description |
|---|
ClientAtomicReferenceProxy(String serviceName,
String objectId) |
| 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.
|
<R> R |
apply(IFunction<E,R> function)
Applies a function on the value, the actual stored value will not change.
|
void |
clear()
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. |
boolean |
contains(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.
|
E |
getAndSet(E newValue)
Gets the old value and sets the new value.
|
protected <T> T |
invoke(ClientRequest req) |
boolean |
isNull()
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.
|
String |
toString() |
destroy, equals, getClient, getContext, getId, getName, getPartitionKey, getServiceName, hashCode, invoke, invoke, invokeInterruptibly, invokeOnPartition, listen, listen, onDestroy, onInitialize, onShutdown, setContext, stopListening, throwExceptionIfNull, toData, toObjectclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getId, getName, getPartitionKey, getServiceNamepublic <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 void alter(IFunction<E,E> function)
IAtomicReferencealter in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic E alterAndGet(IFunction<E,E> function)
IAtomicReferencealterAndGet in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic E getAndAlter(IFunction<E,E> function)
IAtomicReferencegetAndAlter in interface IAtomicReference<E>function - the function that alters the currently stored referencepublic boolean compareAndSet(E expect, E update)
IAtomicReference== the expected value.compareAndSet in interface IAtomicReference<E>expect - the expected valueupdate - the new valuepublic boolean contains(E expected)
IAtomicReferencecontains in interface IAtomicReference<E>expected - the value to check (is allowed to be null).public E get()
IAtomicReferenceget in interface IAtomicReference<E>public void set(E newValue)
IAtomicReferenceset in interface IAtomicReference<E>newValue - the new valuepublic void clear()
IAtomicReferenceclear in interface IAtomicReference<E>public E getAndSet(E newValue)
IAtomicReferencegetAndSet in interface IAtomicReference<E>newValue - the new value.public E setAndGet(E update)
IAtomicReferencesetAndGet in interface IAtomicReference<E>update - the new valuepublic boolean isNull()
IAtomicReferenceisNull in interface IAtomicReference<E>protected <T> T invoke(ClientRequest req)
invoke in class ClientProxyCopyright © 2015 Hazelcast, Inc.. All Rights Reserved.