Class CarefulRunnableQueue

java.lang.Object
com.mchange.v2.async.CarefulRunnableQueue
All Implemented Interfaces:
ClosableResource, AsynchronousRunner, Queuable, RunnableQueue, StrandedTaskReporting

public class CarefulRunnableQueue extends Object implements RunnableQueue, Queuable, StrandedTaskReporting
  • Constructor Summary

    Constructors
    Constructor
    Description
    CarefulRunnableQueue(boolean daemon, boolean shutdown_on_interrupt)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    Clean-up resources held by this asynchronous runner as soon as possible.
    void
    close(boolean skip_remaining_tasks)
    Finish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.
    makes available any tasks that were unperformed when this AsynchronousRunner was closed, either explicitly using close() or close( true ), or implicitly because some failure or corruption killed the Object (most likely a Thread interruption.
    void
     

    Methods inherited from class java.lang.Object

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

    • CarefulRunnableQueue

      public CarefulRunnableQueue(boolean daemon, boolean shutdown_on_interrupt)
  • Method Details

    • asRunnableQueue

      public RunnableQueue asRunnableQueue()
      Specified by:
      asRunnableQueue in interface Queuable
    • postRunnable

      public void postRunnable(Runnable r)
      Specified by:
      postRunnable in interface AsynchronousRunner
    • close

      public void close(boolean skip_remaining_tasks)
      Description copied from interface: AsynchronousRunner
      Finish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.
      Specified by:
      close in interface AsynchronousRunner
      Parameters:
      skip_remaining_tasks - Should be regarded as a hint, not a guarantee. If true, pending, not-yet-performed tasks will be skipped, if possible. Currently executing tasks may or may not be interrupted. If false, all previously scheduled tasks will be completed prior to clean-up. The method returns immediately regardless.
    • close

      public void close()
      Description copied from interface: AsynchronousRunner
      Clean-up resources held by this asynchronous runner as soon as possible. Remaining tasks are skipped if possible, and any tasks executing when close() is called may or may not be interrupted. Equivalent to close( true ).
      Specified by:
      close in interface AsynchronousRunner
      Specified by:
      close in interface ClosableResource
    • getStrandedTasks

      public List getStrandedTasks()
      Description copied from interface: StrandedTaskReporting
      makes available any tasks that were unperformed when this AsynchronousRunner was closed, either explicitly using close() or close( true ), or implicitly because some failure or corruption killed the Object (most likely a Thread interruption.
      Specified by:
      getStrandedTasks in interface StrandedTaskReporting
      Returns:
      null if the AsynchronousRunner is still alive, a List of Runnables otherwise, which will be empty only if all tasks were performed before the AsynchronousRunner shut down.