Class AbstractRunnable

org.elasticsearch.common.util.concurrent.AbstractRunnable
All Implemented Interfaces:
Direct Known Subclasses:
AbstractLifecycleRunnable, ActionRunnable, Scheduler.ReschedulingRunnable

public abstract class AbstractRunnable extends implements
An extension to runnable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    This method has the same semantics as
    boolean
    Should the runnable force its execution in case it gets rejected?
    void
    This method is called in a finally block after successful execution or on a rejection.
    abstract void
     e)
    This method is invoked for all exception thrown by doRun()
    void
     e)
    This should be executed if the thread-pool executing this action rejected the execution.
    void
    run()
     

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

    • AbstractRunnable

      public AbstractRunnable()
  • Method Details

    • isForceExecution

      public boolean isForceExecution()
      Should the runnable force its execution in case it gets rejected?
    • run

      public final void run()
      Specified by:
       in interface 
    • onAfter

      public void onAfter()
      This method is called in a finally block after successful execution or on a rejection.
    • onFailure

      public abstract void onFailure( e)
      This method is invoked for all exception thrown by doRun()
    • onRejection

      public void onRejection( e)
      This should be executed if the thread-pool executing this action rejected the execution. The default implementation forwards to onFailure(Exception)
    • doRun

      protected abstract void doRun() throws
      This method has the same semantics as
      Throws:
      - if the run method throws an InterruptedException