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 String
SESSION_NAME
The session name.
-
Constructor Summary
Constructors Constructor Description Semaphores()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalSemaphore
localSemaphore(String sName, int cPermits)
Return a singleton instance of aLocalSemaphore
with a specified name and number of permits.static RemoteSemaphore
remoteSemaphore(String sName, int permits)
Return a singleton instance of aRemoteSemaphore
with a specified name and number of permits.static NamedMap<String,com.oracle.coherence.concurrent.internal.SemaphoreStatus>
semaphoresMap()
Return CoherenceNamedMap
for the remote semaphores.protected static Session
session()
Return CoherenceSession
for 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 aRemoteSemaphore
with 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
RemoteSemaphore
with a specified name and number of permits
-
localSemaphore
public static LocalSemaphore localSemaphore(String sName, int cPermits)
Return a singleton instance of aLocalSemaphore
with 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 CoherenceNamedMap
for the remote semaphores.- Returns:
- Coherence
NamedMap
for the remote semaphores
-
-