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 StringSESSION_NAMEThe 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 CoherenceNamedMapcontaining the countdown latches state.static LocalCountDownLatchlocalCountDownLatch(String sName, int count)Return a singleton instance of aLocalCountDownLatchwith a specified name and initial count.static RemoteCountDownLatchremoteCountDownLatch(String sName, int count)Return a singleton instance of aRemoteCountDownLatchwith a specified name and count.protected static voidremoveCountDownLatch(String sName)Remove the named countdown latch.protected static Sessionsession()Return CoherenceSessionfor 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 aRemoteCountDownLatchwith 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
RemoteCountDownLatchwith a specified name and count
-
localCountDownLatch
public static LocalCountDownLatch localCountDownLatch(String sName, int count)
Return a singleton instance of aLocalCountDownLatchwith 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 CoherenceSessionfor the Latches module.- Returns:
- Coherence
Sessionfor the Latches module
-
-