Class TestCancellable

    • Constructor Summary

      Constructors 
      Constructor Description
      TestCancellable()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void awaitCancelled()
      Wait until cancel() is called.
      void awaitCancelledUninterruptibly()
      Wait until cancel() is called without being interrupted.
      void cancel()
      Sends a hint to the producer of the associated asynchronous execution that the consumer related to this Cancellable is not interested in the outcome of the execution.
      boolean isCancelled()
      Returns true if cancel() has been called, false otherwise.
      • Methods inherited from class java.lang.Object

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

      • TestCancellable

        public TestCancellable()
    • Method Detail

      • cancel

        public final void cancel()
        Description copied from interface: Cancellable
        Sends a hint to the producer of the associated asynchronous execution that the consumer related to this Cancellable is not interested in the outcome of the execution.
        Specified by:
        cancel in interface Cancellable
      • isCancelled

        public final boolean isCancelled()
        Returns true if cancel() has been called, false otherwise.
        Returns:
        true if cancel() has been called, false otherwise.
      • awaitCancelled

        public final void awaitCancelled()
                                  throws java.lang.InterruptedException
        Wait until cancel() is called.
        Throws:
        java.lang.InterruptedException - If this thread is interrupted while waiting.
      • awaitCancelledUninterruptibly

        public final void awaitCancelledUninterruptibly()
        Wait until cancel() is called without being interrupted. This method catches an InterruptedException and discards it silently.