public final class GridCacheAtomicReferenceImpl<T> extends AtomicDataStructureProxy<GridCacheAtomicReferenceValue<T>> implements GridCacheAtomicReferenceEx<T>, IgniteChangeGlobalStateSupport, Externalizable
| Constructor and Description |
|---|
GridCacheAtomicReferenceImpl()
Empty constructor required by
Externalizable. |
GridCacheAtomicReferenceImpl(String name,
GridCacheInternalKey key,
IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicReferenceValue<T>> atomicView)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Removes this atomic reference.
|
boolean |
compareAndSet(T expVal,
T newVal)
Conditionally sets the new value.
|
T |
compareAndSetAndGet(T newVal,
T expVal)
Compares current value with specified value for equality and, if they are equal, replaces current value.
|
T |
get()
Gets current value of an atomic reference.
|
String |
name()
Name of atomic reference.
|
void |
readExternal(ObjectInput in) |
void |
set(T val)
Unconditionally sets the value.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
checkRemoved, invalidateLocalState, key, needCheckNotRemoved, onActivate, onDeActivate, onRemoved, removed, restart, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitkeyneedCheckNotRemoved, onRemoved, restart, suspendremovedonActivate, onDeActivatepublic GridCacheAtomicReferenceImpl()
Externalizable.public GridCacheAtomicReferenceImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicReferenceValue<T>> atomicView)
name - Atomic reference name.key - Atomic reference key.atomicView - Atomic projection.public String name()
name in interface IgniteAtomicReference<T>name in class AtomicDataStructureProxy<GridCacheAtomicReferenceValue<T>>public T get()
get in interface IgniteAtomicReference<T>public void set(T val)
set in interface IgniteAtomicReference<T>val - Value.public boolean compareAndSet(T expVal, T newVal)
expVal is equal
to current value respectively.compareAndSet in interface IgniteAtomicReference<T>expVal - Expected value.newVal - New value.true than value have been updated.public T compareAndSetAndGet(T newVal, T expVal)
newVal - New value to set.expVal - Expected value.public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface IgniteAtomicReference<T>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.0 Release Date : May 23 2018