Class AutomaticLatch
- java.lang.Object
-
- org.apache.activemq.artemis.utils.AbstractLatch
-
- org.apache.activemq.artemis.utils.AutomaticLatch
-
public class AutomaticLatch extends AbstractLatch
An automatic latch has the same semantic as the ReusableLatch However this class has a replaceable callback that could be called when the number of elements reach zero. With that you can either block to wait completion, or to send a callback to be used when it reaches 0.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.artemis.utils.AbstractLatch
AbstractLatch.CountSync
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.utils.AbstractLatch
control
-
-
Constructor Summary
Constructors Constructor Description AutomaticLatch()AutomaticLatch(int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCompletion(java.lang.Runnable newRun)voidcountDown()voidcountDown(int count)
-
-
-
Method Detail
-
afterCompletion
public void afterCompletion(java.lang.Runnable newRun)
-
countDown
public final void countDown()
- Specified by:
countDownin classAbstractLatch
-
countDown
public final void countDown(int count)
- Specified by:
countDownin classAbstractLatch
-
-