Module org.elasticsearch.server
Package org.elasticsearch.action
Class DelegatingActionListener<Response,DelegateResponse>
java.lang.Object
org.elasticsearch.action.DelegatingActionListener<Response,DelegateResponse>
- All Implemented Interfaces:
ActionListener<Response>
- Direct Known Subclasses:
ContextPreservingActionListener
,CountDownActionListener
,FinalizeSnapshotContext
,GroupedActionListener
,SearchExecutionStatsCollector
,SnapshotShardContext
public abstract class DelegatingActionListener<Response,DelegateResponse>
extends Object
implements ActionListener<Response>
A wrapper around an
ActionListener
L
that by default delegates failures to L
's ActionListener.onFailure(java.lang.Exception)
method. The wrapper also provides a toString()
implementation that describes this class and the delegate.
This is a useful base class for creating ActionListener wrappers that override the ActionListener.onResponse(Response)
handling, with access to
L
, while retaining all of L
's other handling. It can also be useful to override other methods to do new work with access
to L
.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateResponse, map, onResponse, safeMap
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatingActionListener
-
-
Method Details
-
onFailure
Description copied from interface:ActionListener
A failure caused by an exception at some phase of the task.- Specified by:
onFailure
in interfaceActionListener<Response>
-
toString
-