Class Atomics
- java.lang.Object
-
- com.oracle.coherence.concurrent.atomic.Atomics
-
public final class Atomics extends Object
Factory methods for various atomic value implementations.- Since:
- 21.12
- Author:
- Aleks Seovic 2020.12.03
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAtomics.SerializableAtomicMarkableReference<V>Extension toAtomicMarkableReferenceto allow Java serialization.static classAtomics.SerializableAtomicStampedReference<V>Extension toAtomicStampedReferenceto allow Java serialization.
-
Field Summary
Fields Modifier and Type Field Description static StringSESSION_NAMEThe session name.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalAtomicBooleanlocalAtomicBoolean(String sName)ReturnLocalAtomicBooleaninstance for the specified name.static LocalAtomicBooleanlocalAtomicBoolean(String sName, boolean fInitialValue)ReturnLocalAtomicBooleaninstance for the specified name and initial value.static LocalAtomicIntegerlocalAtomicInteger(String sName)ReturnLocalAtomicIntegerinstance for the specified name.static LocalAtomicIntegerlocalAtomicInteger(String sName, int nInitialValue)ReturnLocalAtomicIntegerinstance for the specified name and initial value.static LocalAtomicLonglocalAtomicLong(String sName)ReturnLocalAtomicLonginstance for the specified name.static LocalAtomicLonglocalAtomicLong(String sName, long lInitialValue)ReturnLocalAtomicLonginstance for the specified name and initial value.static <V> LocalAtomicMarkableReference<V>localAtomicMarkableReference(String sName)ReturnLocalAtomicMarkableReferenceinstance for the specified name.static <V> LocalAtomicMarkableReference<V>localAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)ReturnLocalAtomicMarkableReferenceinstance for the specified name and initial value and mark.static <V> LocalAtomicReference<V>localAtomicReference(String sName)ReturnLocalAtomicReferenceinstance for the specified name.static <V> LocalAtomicReference<V>localAtomicReference(String sName, V initialValue)ReturnLocalAtomicReferenceinstance for the specified name and initial value.static <V> LocalAtomicStampedReference<V>localAtomicStampedReference(String sName)ReturnLocalAtomicStampedReferenceinstance for the specified name.static <V> LocalAtomicStampedReference<V>localAtomicStampedReference(String sName, V initialValue, int nInitialStamp)ReturnLocalAtomicStampedReferenceinstance for the specified name and initial value and stamp.static RemoteAtomicBooleanremoteAtomicBoolean(String sName)ReturnRemoteAtomicBooleaninstance for the specified name.static RemoteAtomicBooleanremoteAtomicBoolean(String sName, boolean fInitialValue)ReturnRemoteAtomicBooleaninstance for the specified name and initial value.static RemoteAtomicIntegerremoteAtomicInteger(String sName)ReturnRemoteAtomicIntegerinstance for the specified name.static RemoteAtomicIntegerremoteAtomicInteger(String sName, int nInitialValue)ReturnRemoteAtomicIntegerinstance for the specified name and initial value.static RemoteAtomicLongremoteAtomicLong(String sName)ReturnRemoteAtomicLonginstance for the specified name.static RemoteAtomicLongremoteAtomicLong(String sName, long lInitialValue)ReturnRemoteAtomicLonginstance for the specified name and initial value.static <V> RemoteAtomicMarkableReference<V>remoteAtomicMarkableReference(String sName)ReturnRemoteAtomicMarkableReferenceinstance for the specified name.static <V> RemoteAtomicMarkableReference<V>remoteAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)ReturnRemoteAtomicMarkableReferenceinstance for the specified name and initial value and mark.static <V> RemoteAtomicReference<V>remoteAtomicReference(String sName)ReturnRemoteAtomicReferenceinstance for the specified name.static <V> RemoteAtomicReference<V>remoteAtomicReference(String sName, V initialValue)ReturnRemoteAtomicReferenceinstance for the specified name and initial value.static <V> RemoteAtomicStampedReference<V>remoteAtomicStampedReference(String sName)ReturnRemoteAtomicStampedReferenceinstance for the specified name.static <V> RemoteAtomicStampedReference<V>remoteAtomicStampedReference(String sName, V initialValue, int nInitialStamp)ReturnRemoteAtomicStampedReferenceinstance for the specified name and initial value and stamp.
-
-
-
Field Detail
-
SESSION_NAME
public static final String SESSION_NAME
The session name.
-
-
Method Detail
-
localAtomicBoolean
public static LocalAtomicBoolean localAtomicBoolean(String sName)
ReturnLocalAtomicBooleaninstance for the specified name.- Parameters:
sName- the name of the atomic value- Returns:
- a
LocalAtomicBooleaninstance for the specified name
-
localAtomicBoolean
public static LocalAtomicBoolean localAtomicBoolean(String sName, boolean fInitialValue)
ReturnLocalAtomicBooleaninstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Parameters:
sName- the name of the atomic valuefInitialValue- the initial value- Returns:
- a
LocalAtomicBooleaninstance for the specified name
-
remoteAtomicBoolean
public static RemoteAtomicBoolean remoteAtomicBoolean(String sName)
ReturnRemoteAtomicBooleaninstance for the specified name.- Parameters:
sName- the name of the atomic value- Returns:
- a
RemoteAtomicBooleaninstance for the specified name
-
remoteAtomicBoolean
public static RemoteAtomicBoolean remoteAtomicBoolean(String sName, boolean fInitialValue)
ReturnRemoteAtomicBooleaninstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Parameters:
sName- the name of the atomic valuefInitialValue- the initial value- Returns:
- a
RemoteAtomicBooleaninstance for the specified name
-
localAtomicInteger
public static LocalAtomicInteger localAtomicInteger(String sName)
ReturnLocalAtomicIntegerinstance for the specified name.- Parameters:
sName- the name of the atomic value- Returns:
- a
LocalAtomicIntegerinstance for the specified name
-
localAtomicInteger
public static LocalAtomicInteger localAtomicInteger(String sName, int nInitialValue)
ReturnLocalAtomicIntegerinstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Parameters:
sName- the name of the atomic valuenInitialValue- the initial value- Returns:
- a
LocalAtomicIntegerinstance for the specified name
-
remoteAtomicInteger
public static RemoteAtomicInteger remoteAtomicInteger(String sName)
ReturnRemoteAtomicIntegerinstance for the specified name.- Parameters:
sName- the name of the atomic value- Returns:
- a
RemoteAtomicIntegerinstance for the specified name
-
remoteAtomicInteger
public static RemoteAtomicInteger remoteAtomicInteger(String sName, int nInitialValue)
ReturnRemoteAtomicIntegerinstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Parameters:
sName- the name of the atomic valuenInitialValue- the initial value- Returns:
- a
RemoteAtomicIntegerinstance for the specified name
-
localAtomicLong
public static LocalAtomicLong localAtomicLong(String sName)
ReturnLocalAtomicLonginstance for the specified name.- Parameters:
sName- the name of the atomic value- Returns:
- a
LocalAtomicLonginstance for the specified name
-
localAtomicLong
public static LocalAtomicLong localAtomicLong(String sName, long lInitialValue)
ReturnLocalAtomicLonginstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Parameters:
sName- the name of the atomic valuelInitialValue- the initial value- Returns:
- a
LocalAtomicLonginstance for the specified name
-
remoteAtomicLong
public static RemoteAtomicLong remoteAtomicLong(String sName)
ReturnRemoteAtomicLonginstance for the specified name.- Parameters:
sName- the name of the atomic value- Returns:
- a
RemoteAtomicLonginstance for the specified name
-
remoteAtomicLong
public static RemoteAtomicLong remoteAtomicLong(String sName, long lInitialValue)
ReturnRemoteAtomicLonginstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Parameters:
sName- the name of the atomic valuelInitialValue- the initial value- Returns:
- a
RemoteAtomicLonginstance for the specified name
-
localAtomicReference
public static <V> LocalAtomicReference<V> localAtomicReference(String sName)
ReturnLocalAtomicReferenceinstance for the specified name.- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic value- Returns:
- a
LocalAtomicReferenceinstance for the specified name
-
localAtomicReference
public static <V> LocalAtomicReference<V> localAtomicReference(String sName, V initialValue)
ReturnLocalAtomicReferenceinstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic valueinitialValue- the initial value- Returns:
- a
LocalAtomicReferenceinstance for the specified name
-
remoteAtomicReference
public static <V> RemoteAtomicReference<V> remoteAtomicReference(String sName)
ReturnRemoteAtomicReferenceinstance for the specified name.- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic value- Returns:
- a
RemoteAtomicReferenceinstance for the specified name
-
remoteAtomicReference
public static <V> RemoteAtomicReference<V> remoteAtomicReference(String sName, V initialValue)
ReturnRemoteAtomicReferenceinstance for the specified name and initial value.The initial value will only be set if the atomic value with the specified name does not already exist.
- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic valueinitialValue- the initial value- Returns:
- a
RemoteAtomicReferenceinstance for the specified name
-
localAtomicMarkableReference
public static <V> LocalAtomicMarkableReference<V> localAtomicMarkableReference(String sName)
ReturnLocalAtomicMarkableReferenceinstance for the specified name.- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic value- Returns:
- a
LocalAtomicMarkableReferenceinstance for the specified name
-
localAtomicMarkableReference
public static <V> LocalAtomicMarkableReference<V> localAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)
ReturnLocalAtomicMarkableReferenceinstance for the specified name and initial value and mark.The initial value and mark will only be set if the atomic value with the specified name does not already exist.
- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic valueinitialValue- the initial valuefInitialMark- the initial mark- Returns:
- a
LocalAtomicMarkableReferenceinstance for the specified name
-
remoteAtomicMarkableReference
public static <V> RemoteAtomicMarkableReference<V> remoteAtomicMarkableReference(String sName)
ReturnRemoteAtomicMarkableReferenceinstance for the specified name.- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic value- Returns:
- a
RemoteAtomicMarkableReferenceinstance for the specified name
-
remoteAtomicMarkableReference
public static <V> RemoteAtomicMarkableReference<V> remoteAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)
ReturnRemoteAtomicMarkableReferenceinstance for the specified name and initial value and mark.The initial value and mark will only be set if the atomic value with the specified name does not already exist.
- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic valueinitialValue- the initial valuefInitialMark- the initial mark- Returns:
- a
RemoteAtomicMarkableReferenceinstance for the specified name
-
localAtomicStampedReference
public static <V> LocalAtomicStampedReference<V> localAtomicStampedReference(String sName)
ReturnLocalAtomicStampedReferenceinstance for the specified name.- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic value- Returns:
- a
LocalAtomicStampedReferenceinstance for the specified name
-
localAtomicStampedReference
public static <V> LocalAtomicStampedReference<V> localAtomicStampedReference(String sName, V initialValue, int nInitialStamp)
ReturnLocalAtomicStampedReferenceinstance for the specified name and initial value and stamp.The initial value and stamp will only be set if the atomic value with the specified name does not already exist.
- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic valueinitialValue- the initial valuenInitialStamp- the initial stamp- Returns:
- a
LocalAtomicStampedReferenceinstance for the specified name
-
remoteAtomicStampedReference
public static <V> RemoteAtomicStampedReference<V> remoteAtomicStampedReference(String sName)
ReturnRemoteAtomicStampedReferenceinstance for the specified name.- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic value- Returns:
- a
RemoteAtomicStampedReferenceinstance for the specified name
-
remoteAtomicStampedReference
public static <V> RemoteAtomicStampedReference<V> remoteAtomicStampedReference(String sName, V initialValue, int nInitialStamp)
ReturnRemoteAtomicStampedReferenceinstance for the specified name and initial value and stamp.The initial value and stamp will only be set if the atomic value with the specified name does not already exist.
- Type Parameters:
V- the type of object referred to by this reference- Parameters:
sName- the name of the atomic valueinitialValue- the initial valuenInitialStamp- the initial stamp- Returns:
- a
RemoteAtomicStampedReferenceinstance for the specified name
-
-