Class Completion


  • public class Completion
    extends java.lang.Object
    Used to signal completion of an asynchronous operation.
    • Constructor Summary

      Constructors 
      Constructor Description
      Completion()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isComplete()
      Non-blocking snapshot test for completion.
      void setComplete()
      Signal completion.
      void waitUntilComplete()
      Wait (forever) until completion is signalled.
      void waitUntilComplete​(long timeout, java.util.concurrent.TimeUnit unit)
      Wait for a time limit until completion is signalled.
      void waitUntilComplete​(TimeTracker tt)
      Wait for a time limit until completion is signalled.
      • Methods inherited from class java.lang.Object

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

      • Completion

        public Completion()
    • Method Detail

      • setComplete

        public void setComplete()
        Signal completion.
      • isComplete

        public boolean isComplete()
        Non-blocking snapshot test for completion.
        Returns:
        true if this operation has completed, false otherwise
      • waitUntilComplete

        public void waitUntilComplete()
                               throws java.lang.InterruptedException
        Wait (forever) until completion is signalled.
        Throws:
        java.lang.InterruptedException - if thread is interrupted while waiting.
      • waitUntilComplete

        public void waitUntilComplete​(long timeout,
                                      java.util.concurrent.TimeUnit unit)
                               throws java.util.concurrent.TimeoutException,
                                      java.lang.InterruptedException
        Wait for a time limit until completion is signalled. Returns normally if completion is signalled before timeout or interruption.
        Parameters:
        timeout - time to wait (in units).
        unit - units of time for timeout.
        Throws:
        java.util.concurrent.TimeoutException - if timed out before completion is signalled.
        java.lang.InterruptedException - if thread is interrupted while waiting.
      • waitUntilComplete

        public void waitUntilComplete​(TimeTracker tt)
                               throws java.util.concurrent.TimeoutException,
                                      java.lang.InterruptedException
        Wait for a time limit until completion is signalled. Returns normally if completion is signalled before timeout or interruption.
        Parameters:
        tt - time tracker.
        Throws:
        java.util.concurrent.TimeoutException - if timed out before completion is signalled.
        java.lang.InterruptedException - if thread is interrupted while waiting.