Package com.oracle.coherence.concurrent
Class Latches
- java.lang.Object
-
- com.oracle.coherence.concurrent.Latches
-
public class Latches extends Object
Factory methods for various distributed countdown latch implementations.- Since:
- 21.12
- Author:
- as, lh 2021.11.17
-
-
Field Summary
Fields Modifier and Type Field Description static String
SESSION_NAME
The session name.
-
Constructor Summary
Constructors Constructor Description Latches()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static NamedMap<String,com.oracle.coherence.concurrent.internal.LatchCounter>
latchesMap()
Return CoherenceNamedMap
containing the countdown latches state.static LocalCountDownLatch
localCountDownLatch(String sName, int count)
Return a singleton instance of aLocalCountDownLatch
with a specified name and initial count.static RemoteCountDownLatch
remoteCountDownLatch(String sName, int count)
Return a singleton instance of aRemoteCountDownLatch
with a specified name and count.protected static void
removeCountDownLatch(String sName)
Remove the named countdown latch.protected static Session
session()
Return CoherenceSession
for the Latches module.
-
-
-
Field Detail
-
SESSION_NAME
public static final String SESSION_NAME
The session name.
-
-
Method Detail
-
remoteCountDownLatch
public static RemoteCountDownLatch remoteCountDownLatch(String sName, int count)
Return a singleton instance of aRemoteCountDownLatch
with a specified name and count.- Parameters:
sName
- the cluster-wide, unique name of the countdown latchcount
- the initial count of the countdown latch- Returns:
- an instance of a
RemoteCountDownLatch
with a specified name and count
-
localCountDownLatch
public static LocalCountDownLatch localCountDownLatch(String sName, int count)
Return a singleton instance of aLocalCountDownLatch
with a specified name and initial count. The specified latch count is only relevant during the initial latch creation, and is ignored if the latch already exists in the current process. That means that the returned latch instance could have a different count from the one requested.- Parameters:
sName
- the process-wide, unique name of the latchcount
- the initial latch count; ignored if the latch already exists- Returns:
- an instance of a local countdown latch with a specified name
-
removeCountDownLatch
protected static void removeCountDownLatch(String sName)
Remove the named countdown latch.- Parameters:
sName
- the name of the latch
-
session
protected static Session session()
Return CoherenceSession
for the Latches module.- Returns:
- Coherence
Session
for the Latches module
-
-