Package com.oracle.coherence.concurrent
Class Latches
java.lang.Object
com.oracle.coherence.concurrent.Latches
Factory methods for various distributed countdown latch implementations.
- Since:
- 21.12
- Author:
- as, lh 2021.11.17
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn 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 Details
-
Constructor Details
-
Method Details
-
remoteCountDownLatch
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
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
Remove the named countdown latch.- Parameters:
sName
- the name of the latch
-
session
Return CoherenceSession
for the Latches module.- Returns:
- Coherence
Session
for the Latches module
-
latchesMap
protected static NamedMap<String,com.oracle.coherence.concurrent.internal.LatchCounter> latchesMap()Return CoherenceNamedMap
containing the countdown latches state.- Returns:
- Coherence
NamedMap
containing the countdown latches state
-