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 class
Atomics.SerializableAtomicMarkableReference<V>
Extension toAtomicMarkableReference
to allow Java serialization.static class
Atomics.SerializableAtomicStampedReference<V>
Extension toAtomicStampedReference
to allow Java serialization.
-
Field Summary
Fields Modifier and Type Field Description static String
SESSION_NAME
The session name.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalAtomicBoolean
localAtomicBoolean(String sName)
ReturnLocalAtomicBoolean
instance for the specified name.static LocalAtomicBoolean
localAtomicBoolean(String sName, boolean fInitialValue)
ReturnLocalAtomicBoolean
instance for the specified name and initial value.static LocalAtomicInteger
localAtomicInteger(String sName)
ReturnLocalAtomicInteger
instance for the specified name.static LocalAtomicInteger
localAtomicInteger(String sName, int nInitialValue)
ReturnLocalAtomicInteger
instance for the specified name and initial value.static LocalAtomicLong
localAtomicLong(String sName)
ReturnLocalAtomicLong
instance for the specified name.static LocalAtomicLong
localAtomicLong(String sName, long lInitialValue)
ReturnLocalAtomicLong
instance for the specified name and initial value.static <V> LocalAtomicMarkableReference<V>
localAtomicMarkableReference(String sName)
ReturnLocalAtomicMarkableReference
instance for the specified name.static <V> LocalAtomicMarkableReference<V>
localAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)
ReturnLocalAtomicMarkableReference
instance for the specified name and initial value and mark.static <V> LocalAtomicReference<V>
localAtomicReference(String sName)
ReturnLocalAtomicReference
instance for the specified name.static <V> LocalAtomicReference<V>
localAtomicReference(String sName, V initialValue)
ReturnLocalAtomicReference
instance for the specified name and initial value.static <V> LocalAtomicStampedReference<V>
localAtomicStampedReference(String sName)
ReturnLocalAtomicStampedReference
instance for the specified name.static <V> LocalAtomicStampedReference<V>
localAtomicStampedReference(String sName, V initialValue, int nInitialStamp)
ReturnLocalAtomicStampedReference
instance for the specified name and initial value and stamp.static RemoteAtomicBoolean
remoteAtomicBoolean(String sName)
ReturnRemoteAtomicBoolean
instance for the specified name.static RemoteAtomicBoolean
remoteAtomicBoolean(String sName, boolean fInitialValue)
ReturnRemoteAtomicBoolean
instance for the specified name and initial value.static RemoteAtomicInteger
remoteAtomicInteger(String sName)
ReturnRemoteAtomicInteger
instance for the specified name.static RemoteAtomicInteger
remoteAtomicInteger(String sName, int nInitialValue)
ReturnRemoteAtomicInteger
instance for the specified name and initial value.static RemoteAtomicLong
remoteAtomicLong(String sName)
ReturnRemoteAtomicLong
instance for the specified name.static RemoteAtomicLong
remoteAtomicLong(String sName, long lInitialValue)
ReturnRemoteAtomicLong
instance for the specified name and initial value.static <V> RemoteAtomicMarkableReference<V>
remoteAtomicMarkableReference(String sName)
ReturnRemoteAtomicMarkableReference
instance for the specified name.static <V> RemoteAtomicMarkableReference<V>
remoteAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)
ReturnRemoteAtomicMarkableReference
instance for the specified name and initial value and mark.static <V> RemoteAtomicReference<V>
remoteAtomicReference(String sName)
ReturnRemoteAtomicReference
instance for the specified name.static <V> RemoteAtomicReference<V>
remoteAtomicReference(String sName, V initialValue)
ReturnRemoteAtomicReference
instance for the specified name and initial value.static <V> RemoteAtomicStampedReference<V>
remoteAtomicStampedReference(String sName)
ReturnRemoteAtomicStampedReference
instance for the specified name.static <V> RemoteAtomicStampedReference<V>
remoteAtomicStampedReference(String sName, V initialValue, int nInitialStamp)
ReturnRemoteAtomicStampedReference
instance 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)
ReturnLocalAtomicBoolean
instance for the specified name.- Parameters:
sName
- the name of the atomic value- Returns:
- a
LocalAtomicBoolean
instance for the specified name
-
localAtomicBoolean
public static LocalAtomicBoolean localAtomicBoolean(String sName, boolean fInitialValue)
ReturnLocalAtomicBoolean
instance 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
LocalAtomicBoolean
instance for the specified name
-
remoteAtomicBoolean
public static RemoteAtomicBoolean remoteAtomicBoolean(String sName)
ReturnRemoteAtomicBoolean
instance for the specified name.- Parameters:
sName
- the name of the atomic value- Returns:
- a
RemoteAtomicBoolean
instance for the specified name
-
remoteAtomicBoolean
public static RemoteAtomicBoolean remoteAtomicBoolean(String sName, boolean fInitialValue)
ReturnRemoteAtomicBoolean
instance 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
RemoteAtomicBoolean
instance for the specified name
-
localAtomicInteger
public static LocalAtomicInteger localAtomicInteger(String sName)
ReturnLocalAtomicInteger
instance for the specified name.- Parameters:
sName
- the name of the atomic value- Returns:
- a
LocalAtomicInteger
instance for the specified name
-
localAtomicInteger
public static LocalAtomicInteger localAtomicInteger(String sName, int nInitialValue)
ReturnLocalAtomicInteger
instance 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
LocalAtomicInteger
instance for the specified name
-
remoteAtomicInteger
public static RemoteAtomicInteger remoteAtomicInteger(String sName)
ReturnRemoteAtomicInteger
instance for the specified name.- Parameters:
sName
- the name of the atomic value- Returns:
- a
RemoteAtomicInteger
instance for the specified name
-
remoteAtomicInteger
public static RemoteAtomicInteger remoteAtomicInteger(String sName, int nInitialValue)
ReturnRemoteAtomicInteger
instance 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
RemoteAtomicInteger
instance for the specified name
-
localAtomicLong
public static LocalAtomicLong localAtomicLong(String sName)
ReturnLocalAtomicLong
instance for the specified name.- Parameters:
sName
- the name of the atomic value- Returns:
- a
LocalAtomicLong
instance for the specified name
-
localAtomicLong
public static LocalAtomicLong localAtomicLong(String sName, long lInitialValue)
ReturnLocalAtomicLong
instance 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
LocalAtomicLong
instance for the specified name
-
remoteAtomicLong
public static RemoteAtomicLong remoteAtomicLong(String sName)
ReturnRemoteAtomicLong
instance for the specified name.- Parameters:
sName
- the name of the atomic value- Returns:
- a
RemoteAtomicLong
instance for the specified name
-
remoteAtomicLong
public static RemoteAtomicLong remoteAtomicLong(String sName, long lInitialValue)
ReturnRemoteAtomicLong
instance 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
RemoteAtomicLong
instance for the specified name
-
localAtomicReference
public static <V> LocalAtomicReference<V> localAtomicReference(String sName)
ReturnLocalAtomicReference
instance 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
LocalAtomicReference
instance for the specified name
-
localAtomicReference
public static <V> LocalAtomicReference<V> localAtomicReference(String sName, V initialValue)
ReturnLocalAtomicReference
instance 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
LocalAtomicReference
instance for the specified name
-
remoteAtomicReference
public static <V> RemoteAtomicReference<V> remoteAtomicReference(String sName)
ReturnRemoteAtomicReference
instance 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
RemoteAtomicReference
instance for the specified name
-
remoteAtomicReference
public static <V> RemoteAtomicReference<V> remoteAtomicReference(String sName, V initialValue)
ReturnRemoteAtomicReference
instance 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
RemoteAtomicReference
instance for the specified name
-
localAtomicMarkableReference
public static <V> LocalAtomicMarkableReference<V> localAtomicMarkableReference(String sName)
ReturnLocalAtomicMarkableReference
instance 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
LocalAtomicMarkableReference
instance for the specified name
-
localAtomicMarkableReference
public static <V> LocalAtomicMarkableReference<V> localAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)
ReturnLocalAtomicMarkableReference
instance 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
LocalAtomicMarkableReference
instance for the specified name
-
remoteAtomicMarkableReference
public static <V> RemoteAtomicMarkableReference<V> remoteAtomicMarkableReference(String sName)
ReturnRemoteAtomicMarkableReference
instance 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
RemoteAtomicMarkableReference
instance for the specified name
-
remoteAtomicMarkableReference
public static <V> RemoteAtomicMarkableReference<V> remoteAtomicMarkableReference(String sName, V initialValue, boolean fInitialMark)
ReturnRemoteAtomicMarkableReference
instance 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
RemoteAtomicMarkableReference
instance for the specified name
-
localAtomicStampedReference
public static <V> LocalAtomicStampedReference<V> localAtomicStampedReference(String sName)
ReturnLocalAtomicStampedReference
instance 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
LocalAtomicStampedReference
instance for the specified name
-
localAtomicStampedReference
public static <V> LocalAtomicStampedReference<V> localAtomicStampedReference(String sName, V initialValue, int nInitialStamp)
ReturnLocalAtomicStampedReference
instance 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
LocalAtomicStampedReference
instance for the specified name
-
remoteAtomicStampedReference
public static <V> RemoteAtomicStampedReference<V> remoteAtomicStampedReference(String sName)
ReturnRemoteAtomicStampedReference
instance 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
RemoteAtomicStampedReference
instance for the specified name
-
remoteAtomicStampedReference
public static <V> RemoteAtomicStampedReference<V> remoteAtomicStampedReference(String sName, V initialValue, int nInitialStamp)
ReturnRemoteAtomicStampedReference
instance 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
RemoteAtomicStampedReference
instance for the specified name
-
-