Class Semaphores


  • public class Semaphores
    extends Object
    Factory methods for local and remote semaphore implementations.
    Since:
    21.12
    Author:
    Vaso Putica 2021.11.30
    • Field Detail

      • SESSION_NAME

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

      • Semaphores

        public Semaphores()
    • Method Detail

      • remoteSemaphore

        public static RemoteSemaphore remoteSemaphore​(String sName,
                                                      int permits)
        Return a singleton instance of a RemoteSemaphore with a specified name and number of permits.
        Parameters:
        sName - the cluster-wide, unique name of the semaphore
        permits - the initial number of permits
        Returns:
        an instance of a RemoteSemaphore with a specified name and number of permits
      • localSemaphore

        public static LocalSemaphore localSemaphore​(String sName,
                                                    int cPermits)
        Return a singleton instance of a LocalSemaphore with a specified name and number of permits.
        Parameters:
        sName - the process-wide, unique name of the semaphore
        cPermits - the initial number of permits
        Returns:
        an instance of a local semaphore with specified name and number of permits
      • semaphoresMap

        public static NamedMap<String,​com.oracle.coherence.concurrent.internal.SemaphoreStatus> semaphoresMap()
        Return Coherence NamedMap for the remote semaphores.
        Returns:
        Coherence NamedMap for the remote semaphores
      • session

        protected static Session session()
        Return Coherence Session for the Semaphore module.
        Returns:
        Coherence Session for the Semaphore module