Module org.elasticsearch.server
Package org.elasticsearch.action.support
Class CountDownActionListener
java.lang.Object
org.elasticsearch.action.DelegatingActionListener<Void,Void>
org.elasticsearch.action.support.CountDownActionListener
- All Implemented Interfaces:
ActionListener<Void>
Wraps another listener and adds a counter -- each invocation of this listener will decrement the counter, and when the counter has been
exhausted the final invocation of this listener will delegate to the wrapped listener. Similar to
GroupedActionListener, but for
the cases where tracking individual results is not useful.-
Field Summary
Fields inherited from class org.elasticsearch.action.DelegatingActionListener
delegate -
Constructor Summary
ConstructorsConstructorDescriptionCountDownActionListener(int groupSize, ActionListener<Void> delegate) Creates a new listener -
Method Summary
Modifier and TypeMethodDescriptionvoidComplete this listener with an exceptional response.voidonResponse(Void element) Complete this listener with a successful (or at least, non-exceptional) response.Methods inherited from class org.elasticsearch.action.DelegatingActionListener
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, safeMap
-
Constructor Details
-
CountDownActionListener
Creates a new listener- Parameters:
groupSize- the group sizedelegate- the delegate listener
-
-
Method Details
-
onResponse
Description copied from interface:ActionListenerComplete this listener with a successful (or at least, non-exceptional) response. -
onFailure
Description copied from interface:ActionListenerComplete this listener with an exceptional response.- Specified by:
onFailurein interfaceActionListener<Void>- Overrides:
onFailurein classDelegatingActionListener<Void,Void>
-