Class 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 Detail

      • SESSION_NAME

        public static final String SESSION_NAME
        The session name.
    • Constructor Detail

      • Locks

        public Locks()
    • Method Detail

      • localLock

        public static ReentrantLock localLock​(String sName)
        Return a singleton instance of a local ReentrantLock 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 remote RemoteLock 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 local ReentrantReadWriteLock 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 remote RemoteReadWriteLock 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 Coherence Session 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 Coherence NamedMap containing the exclusive locks state.
        Returns:
        Coherence NamedMap containing the exclusive locks state
      • readWriteLocksMap

        public static NamedMap<String,​com.oracle.coherence.concurrent.locks.internal.ReadWriteLockHolder> readWriteLocksMap()
        Return Coherence NamedMap containing the read/write locks state.
        Returns:
        Coherence NamedMap containing the read/write locks state