Package com.oracle.coherence.concurrent
Class Semaphores
- java.lang.Object
-
- com.oracle.coherence.concurrent.Semaphores
-
public class Semaphores extends Object
Factory methods for local and remote semaphore implementations.- Since:
- 21.12
- Author:
- Vaso Putica 2021.11.30
-
-
Field Summary
Fields Modifier and Type Field Description static StringSESSION_NAMEThe session name.
-
Constructor Summary
Constructors Constructor Description Semaphores()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalSemaphorelocalSemaphore(String sName, int cPermits)Return a singleton instance of aLocalSemaphorewith a specified name and number of permits.static RemoteSemaphoreremoteSemaphore(String sName, int permits)Return a singleton instance of aRemoteSemaphorewith a specified name and number of permits.static NamedMap<String,com.oracle.coherence.concurrent.internal.SemaphoreStatus>semaphoresMap()Return CoherenceNamedMapfor the remote semaphores.protected static Sessionsession()Return CoherenceSessionfor the Semaphore module.
-
-
-
Field Detail
-
SESSION_NAME
public static final String SESSION_NAME
The session name.
-
-
Method Detail
-
remoteSemaphore
public static RemoteSemaphore remoteSemaphore(String sName, int permits)
Return a singleton instance of aRemoteSemaphorewith a specified name and number of permits.- Parameters:
sName- the cluster-wide, unique name of the semaphorepermits- the initial number of permits- Returns:
- an instance of a
RemoteSemaphorewith a specified name and number of permits
-
localSemaphore
public static LocalSemaphore localSemaphore(String sName, int cPermits)
Return a singleton instance of aLocalSemaphorewith a specified name and number of permits.- Parameters:
sName- the process-wide, unique name of the semaphorecPermits- 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 CoherenceNamedMapfor the remote semaphores.- Returns:
- Coherence
NamedMapfor the remote semaphores
-
-