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 String
SESSION_NAME
The 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 CoherenceNamedMap
containing the exclusive locks state.static ReentrantLock
localLock(String sName)
Return a singleton instance of a localReentrantLock
with a specified name.static ReentrantReadWriteLock
localReadWriteLock(String sName)
Return a singleton instance of a localReentrantReadWriteLock
with a specified name.static NamedMap<String,com.oracle.coherence.concurrent.locks.internal.ReadWriteLockHolder>
readWriteLocksMap()
Return CoherenceNamedMap
containing the read/write locks state.static RemoteLock
remoteLock(String sName)
Return a singleton instance of a remoteRemoteLock
with a specified name.static RemoteReadWriteLock
remoteReadWriteLock(String sName)
Return a singleton instance of a remoteRemoteReadWriteLock
with a specified name.protected static Session
session()
Return CoherenceSession
for 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 localReentrantLock
with 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 remoteRemoteLock
with 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 localReentrantReadWriteLock
with 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 remoteRemoteReadWriteLock
with 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 CoherenceSession
for the Locks module.- Returns:
- Coherence
Session
for the Locks module
-
exclusiveLocksMap
public static NamedMap<String,com.oracle.coherence.concurrent.locks.internal.ExclusiveLockHolder> exclusiveLocksMap()
Return CoherenceNamedMap
containing the exclusive locks state.- Returns:
- Coherence
NamedMap
containing the exclusive locks state
-
-