src/main/java/org/jboss/util/timeout/TimeoutFactory.java
/**
    * Cancels all submitted tasks, stops the worker
    * thread and clean-ups everything except for the
    * thread pool. Scheduling new timeouts after cancel
    * is called results in a IllegalStateException.
    */
Cancels all submitted tasks, stops the worker
thread and clean-ups everything except for the
thread pool. Scheduling new timeouts after cancel
is called results in a IllegalStateException.
Cancels all submitted tasks stops the worker thread and clean - ups everything except for the thread pool . Scheduling new timeouts after cancel is called results in a IllegalStateException .
public void cancel()
   {
      if (cancelled.getAndSet(true) == false)
      {
         queue.cancel();
      }
   }
public void cancel ( ) { if ( cancelled . getAndSet ( true ) == false ) { queue . cancel ( ) ; } }
Cancels all submitted tasks, stops the worker
 thread and clean-ups everything except for the
 thread pool.
Cancels all submitted tasks stops the worker thread and clean - ups everything except for the thread pool .
// obviously the singleton TimeoutFactory cannot // be cancelled since its reference is not accessible // let the worker thread cleanup // Cancel the priority queue