Class AbstractRunnable
java.lang.Object
org.elasticsearch.common.util.concurrent.AbstractRunnable
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AbstractLifecycleRunnable,ActionRunnable,Scheduler.ReschedulingRunnable
An extension to runnable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoRun()This method has the same semantics asRunnable.run()booleanShould the runnable force its execution in case it gets rejected?voidonAfter()This method is called in a finally block after successful execution or on a rejection.abstract voidThis method is invoked for all exception thrown bydoRun()voidThis should be executed if the thread-pool executing this action rejected the execution.voidrun()
-
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() -
onAfter
public void onAfter()This method is called in a finally block after successful execution or on a rejection. -
onFailure
This method is invoked for all exception thrown bydoRun() -
onRejection
This should be executed if the thread-pool executing this action rejected the execution. The default implementation forwards toonFailure(Exception) -
doRun
This method has the same semantics asRunnable.run()- Throws:
InterruptedException- if the run method throws an InterruptedExceptionException
-