Package com.oracle.coherence.concurrent
Class Semaphores
java.lang.Object
com.oracle.coherence.concurrent.Semaphores
Factory methods for local and remote semaphore implementations.
- Since:
- 21.12
- Author:
- Vaso Putica 2021.11.30
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.Return CoherenceNamedMapfor the remote semaphores.protected static Sessionsession()Return CoherenceSessionfor the Semaphore module.
-
Field Details
-
SESSION_NAME
The session name.
-
-
Constructor Details
-
Semaphores
public Semaphores()
-
-
Method Details
-
remoteSemaphore
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
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
-
session
Return CoherenceSessionfor the Semaphore module.- Returns:
- Coherence
Sessionfor the Semaphore module
-