public final class GridCacheAtomicReferenceImpl<T> extends Object implements GridCacheAtomicReferenceEx<T>, Externalizable
| Constructor and Description |
|---|
GridCacheAtomicReferenceImpl()
Empty constructor required by
Externalizable. |
GridCacheAtomicReferenceImpl(String name,
GridCacheInternalKey key,
IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicReferenceValue<T>> atomicView,
GridCacheContext ctx)
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.
|
GridCacheInternalKey |
key()
Get current atomic reference key.
|
String |
name()
Name of atomic reference.
|
void |
needCheckNotRemoved() |
boolean |
onRemoved()
Set status of data structure as removed.
|
void |
readExternal(ObjectInput in) |
boolean |
removed()
Gets status of atomic.
|
void |
set(T val)
Unconditionally sets the value.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public GridCacheAtomicReferenceImpl()
Externalizable.public GridCacheAtomicReferenceImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicReferenceValue<T>> atomicView, GridCacheContext ctx)
name - Atomic reference name.key - Atomic reference key.atomicView - Atomic projection.ctx - Cache context.public String name()
name in interface IgniteAtomicReference<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.public boolean onRemoved()
onRemoved in interface GridCacheRemovablepublic void needCheckNotRemoved()
needCheckNotRemoved in interface GridCacheRemovablepublic GridCacheInternalKey key()
key in interface GridCacheAtomicReferenceEx<T>public boolean removed()
removed in interface IgniteAtomicReference<T>true if an atomic reference was removed from cache, false otherwise.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. 1.7.0 Release Date : August 1 2016