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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn 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 Details
-
SESSION_NAME
The session name.
-
-
Constructor Details
-
Latches
public Latches()
-
-
Method Details
-
remoteCountDownLatch
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
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
Remove the named countdown latch.- Parameters:
sName- the name of the latch
-
session
Return CoherenceSessionfor the Latches module.- Returns:
- Coherence
Sessionfor the Latches module
-
latchesMap
protected static NamedMap<String,com.oracle.coherence.concurrent.internal.LatchCounter> latchesMap()Return CoherenceNamedMapcontaining the countdown latches state.- Returns:
- Coherence
NamedMapcontaining the countdown latches state
-