Package fr.dyade.aaa.agent
Class CountDownCallback
- java.lang.Object
-
- fr.dyade.aaa.agent.CountDownCallback
-
public class CountDownCallback extends Object
Callback to be invoked once a countdown has reached the value zero. The countdown is incremented when theCountDownCallbackis assigned to aCallbackNotificationand decremented after theCallbackNotificationhas been successfully processed, or after an error has been raised.
-
-
Field Summary
Fields Modifier and Type Field Description private CallbackcallbackCallback to invoke once the countdown reaches zero.private AtomicIntegercountDownCountdown initially 0, incremented each time theCountDownCallbackis assigned to aCallbackNotificationand decremented after theCallbackNotificationhas been successfully processed, or after an error has been raised.private List<Throwable>errorsList of errors thrown when executing notifications reactions related to thisCountDownCallback.
-
Constructor Summary
Constructors Constructor Description CountDownCallback(Callback callback)Creates a callback by specifying theCallbackto invoke.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voiddone()(package private) voidfailed(Throwable error)(package private) voidincrementAndGet()
-
-
-
Field Detail
-
countDown
private AtomicInteger countDown
Countdown initially 0, incremented each time theCountDownCallbackis assigned to aCallbackNotificationand decremented after theCallbackNotificationhas been successfully processed, or after an error has been raised.
-
errors
private List<Throwable> errors
List of errors thrown when executing notifications reactions related to thisCountDownCallback.
-
callback
private Callback callback
Callback to invoke once the countdown reaches zero.
-
-
Constructor Detail
-
CountDownCallback
public CountDownCallback(Callback callback)
Creates a callback by specifying theCallbackto invoke. Not permitted in anAgent.- Parameters:
callback- the callback to invoke- Throws:
RuntimeException- if called by anAgent
-
-
Method Detail
-
incrementAndGet
void incrementAndGet()
-
done
void done()
-
failed
void failed(Throwable error)
-
-