Class Latch
- java.lang.Object
-
- java.util.concurrent.CountDownLatch
-
- org.simpleframework.transport.reactor.Latch
-
class Latch extends java.util.concurrent.CountDownLatch
TheLatch
is used to provide a simple latch that will allow a thread to block until it is signaled that it is ready. The latch will block on theclose
method and when the latch is signaled the close method will release all threads.
-
-
Constructor Summary
Constructors Constructor Description Latch()
Constructor for theLatch
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This will block all threads attempting to close the latch.void
signal()
This is used to signal that the latch is ready.
-
-
-
Method Detail
-
signal
public void signal() throws java.io.IOException
This is used to signal that the latch is ready. Invoking this method will release all threads that are blocking on the close method. This method is used when the distributor is closed and all operations have been purged.- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
This will block all threads attempting to close the latch. All threads will be release when the latch is signaled. This is used to ensure the distributor blocks until it has fully purged all registered operations that are registered.- Throws:
java.io.IOException
-
-