Class Locks
- java.lang.Object
-
- com.oracle.coherence.concurrent.locks.Locks
-
public class Locks extends Object
Factory methods for various local and remote lock implementations.- Since:
- 21.12
- Author:
- Aleks Seovic 2021.10.20
-
-
Field Summary
Fields Modifier and Type Field Description static StringSESSION_NAMEThe session name.
-
Constructor Summary
Constructors Constructor Description Locks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NamedMap<String,com.oracle.coherence.concurrent.locks.internal.ExclusiveLockHolder>exclusiveLocksMap()Return CoherenceNamedMapcontaining the exclusive locks state.static ReentrantLocklocalLock(String sName)Return a singleton instance of a localReentrantLockwith a specified name.static ReentrantReadWriteLocklocalReadWriteLock(String sName)Return a singleton instance of a localReentrantReadWriteLockwith a specified name.static NamedMap<String,com.oracle.coherence.concurrent.locks.internal.ReadWriteLockHolder>readWriteLocksMap()Return CoherenceNamedMapcontaining the read/write locks state.static RemoteLockremoteLock(String sName)Return a singleton instance of a remoteRemoteLockwith a specified name.static RemoteReadWriteLockremoteReadWriteLock(String sName)Return a singleton instance of a remoteRemoteReadWriteLockwith a specified name.protected static Sessionsession()Return CoherenceSessionfor the Locks module.
-
-
-
Field Detail
-
SESSION_NAME
public static final String SESSION_NAME
The session name.
-
-
Method Detail
-
localLock
public static ReentrantLock localLock(String sName)
Return a singleton instance of a localReentrantLockwith a specified name.- Parameters:
sName- the process-wide, unique name of the lock- Returns:
- an instance of a local lock with a specified name
-
remoteLock
public static RemoteLock remoteLock(String sName)
Return a singleton instance of a remoteRemoteLockwith a specified name.- Parameters:
sName- the cluster-wide, unique name of the lock- Returns:
- an instance of a remote lock with a specified name
-
localReadWriteLock
public static ReentrantReadWriteLock localReadWriteLock(String sName)
Return a singleton instance of a localReentrantReadWriteLockwith a specified name.- Parameters:
sName- the process-wide, unique name of the lock- Returns:
- an instance of a local read/write lock with a specified name
-
remoteReadWriteLock
public static RemoteReadWriteLock remoteReadWriteLock(String sName)
Return a singleton instance of a remoteRemoteReadWriteLockwith a specified name.- Parameters:
sName- the cluster-wide, unique name of the lock- Returns:
- an instance of a remote read/write lock with a specified name
-
session
protected static Session session()
Return CoherenceSessionfor the Locks module.- Returns:
- Coherence
Sessionfor the Locks module
-
exclusiveLocksMap
public static NamedMap<String,com.oracle.coherence.concurrent.locks.internal.ExclusiveLockHolder> exclusiveLocksMap()
Return CoherenceNamedMapcontaining the exclusive locks state.- Returns:
- Coherence
NamedMapcontaining the exclusive locks state
-
-