public final class GridCacheAtomicStampedImpl<T,S> extends Object implements GridCacheAtomicStampedEx<T,S>, Externalizable
| Constructor and Description |
|---|
GridCacheAtomicStampedImpl()
Empty constructor required by
Externalizable. |
GridCacheAtomicStampedImpl(String name,
GridCacheInternalKey key,
GridCacheProjection<GridCacheInternalKey,GridCacheAtomicStampedValue<T,S>> atomicView,
GridCacheContext ctx)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
compareAndSet(T expVal,
T newVal,
S expStamp,
S newStamp)
Conditionally sets the new value and new stamp.
|
GridBiTuple<T,S> |
get()
Gets both current value and current stamp of atomic stamped.
|
GridCacheInternalKey |
key()
Get current atomic stamped key.
|
String |
name()
Name of atomic stamped.
|
void |
onInvalid(Exception err) |
boolean |
onRemoved()
Set status of data structure as removed.
|
void |
readExternal(ObjectInput in) |
boolean |
removed()
Gets status of atomic.
|
void |
set(T val,
S stamp)
Unconditionally sets the value and the stamp.
|
S |
stamp()
Gets current stamp.
|
String |
toString() |
T |
value()
Gets current value.
|
void |
writeExternal(ObjectOutput out) |
public GridCacheAtomicStampedImpl()
Externalizable.public GridCacheAtomicStampedImpl(String name, GridCacheInternalKey key, GridCacheProjection<GridCacheInternalKey,GridCacheAtomicStampedValue<T,S>> atomicView, GridCacheContext ctx)
name - Atomic stamped name.key - Atomic stamped key.atomicView - Atomic projection.ctx - Cache context.public String name()
name in interface GridCacheAtomicStamped<T,S>public GridBiTuple<T,S> get() throws GridException
get in interface GridCacheAtomicStamped<T,S>GridException - If operation failed.public void set(T val, S stamp) throws GridException
set in interface GridCacheAtomicStamped<T,S>val - Value.stamp - Stamp.GridException - If operation failed.public boolean compareAndSet(T expVal, T newVal, S expStamp, S newStamp) throws GridException
expVal
and expStamp are equal to current value and current stamp respectively.compareAndSet in interface GridCacheAtomicStamped<T,S>expVal - Expected value.newVal - New value.expStamp - Expected stamp.newStamp - New stamp.true than value and stamp will be updated.GridException - If operation failed.public S stamp() throws GridException
stamp in interface GridCacheAtomicStamped<T,S>GridException - If operation failed.public T value() throws GridException
value in interface GridCacheAtomicStamped<T,S>GridException - If operation failed.public boolean onRemoved()
onRemoved in interface GridCacheRemovablepublic void onInvalid(@Nullable Exception err)
onInvalid in interface GridCacheRemovableerr - Error which cause data structure to become invalid.public GridCacheInternalKey key()
key in interface GridCacheAtomicStampedEx<T,S>public boolean removed()
removed in interface GridCacheAtomicStamped<T,S>true if atomic stamped was removed from cache, false otherwise.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionCopyright © 2014. All rights reserved.