Package org.elasticsearch.action
Class ActionRunnable<Response>
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.AbstractRunnable
-
- org.elasticsearch.action.ActionRunnable<Response>
-
- All Implemented Interfaces:
java.lang.Runnable
public abstract class ActionRunnable<Response> extends AbstractRunnable
Base class forRunnable
s that need to callActionListener.onFailure(Exception)
in case an uncaught exception or error is thrown while the actual action is run.
-
-
Field Summary
Fields Modifier and Type Field Description protected ActionListener<Response>
listener
-
Constructor Summary
Constructors Constructor Description ActionRunnable(ActionListener<Response> listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onFailure(java.lang.Exception e)
Calls the action listenersActionListener.onFailure(Exception)
method with the given exception.-
Methods inherited from class org.elasticsearch.common.util.concurrent.AbstractRunnable
doRun, isForceExecution, onAfter, onRejection, run
-
-
-
-
Field Detail
-
listener
protected final ActionListener<Response> listener
-
-
Constructor Detail
-
ActionRunnable
public ActionRunnable(ActionListener<Response> listener)
-
-
Method Detail
-
onFailure
public void onFailure(java.lang.Exception e)
Calls the action listenersActionListener.onFailure(Exception)
method with the given exception. This method is invoked for all exception thrown byAbstractRunnable.doRun()
- Specified by:
onFailure
in classAbstractRunnable
-
-