Package org.apache.ignite
Interface IgniteAtomicReference<T>
- 
- All Superinterfaces:
- AutoCloseable,- Closeable
 
 public interface IgniteAtomicReference<T> extends Closeable This interface provides a rich API for working with distributed atomic reference.FunctionalityDistributed atomic reference includes the following main functionality:- 
 Method get()gets current value of an atomic reference.
- 
 Method set(Object)unconditionally sets the value in the an atomic reference.
- 
 Methods compareAndSet(...)conditionally set the value in the an atomic reference.
- 
 Method name()gets name of atomic reference.
 Creating Distributed Atomic ReferenceInstance of distributed atomic reference can be created by calling the following method:
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Removes this atomic reference.booleancompareAndSet(T expVal, T newVal)Conditionally sets the new value.Tget()Gets current value of an atomic reference.Stringname()Name of atomic reference.booleanremoved()Gets status of atomic.voidset(T val)Unconditionally sets the value.
 
- 
- 
- 
Method Detail- 
nameString name() Name of atomic reference.- Returns:
- Name of an atomic reference.
 
 - 
getT get() throws IgniteException Gets current value of an atomic reference.- Returns:
- current value of an atomic reference.
- Throws:
- IgniteException- If operation failed.
 
 - 
setvoid set(T val) throws IgniteException Unconditionally sets the value.- Parameters:
- val- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
compareAndSetboolean compareAndSet(T expVal, T newVal) throws IgniteException Conditionally sets the new value. That will be set ifexpValis equal to current value respectively.- Parameters:
- expVal- Expected value.
- newVal- New value.
- Returns:
- Result of operation execution. If truethan value have been updated.
- Throws:
- IgniteException- If operation failed.
 
 - 
removedboolean removed() Gets status of atomic.- Returns:
- trueif an atomic reference was removed from cache,- falseotherwise.
 
 - 
closevoid close() Removes this atomic reference.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IgniteException- If operation failed.
 
 
- 
 
-