Class Latch


  • class Latch
    extends java.util.concurrent.CountDownLatch
    The Latch 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 the close method and when the latch is signaled the close method will release all threads.
    • Constructor Summary

      Constructors 
      Constructor Description
      Latch()
      Constructor for the Latch 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.
      • Methods inherited from class java.util.concurrent.CountDownLatch

        await, await, countDown, getCount, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Latch

        public Latch()
        Constructor for the Latch object. This will create a count down latch that will block when it is closed. Any blocked threads will be released when the latch is signaled that it 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