EventCallbackService¶
-
public interface
EventCallbackService
¶ Implementing
EventCallbackService
and exposing it as OSGi service allows to receive callbacks, after the events have been handled by their respective listener. In order to invoke a callback, the name of the callback service must be set in theMotechEvent
and must match the name returned by thegetName()
method.
Methods¶
failureCallback¶
-
boolean
failureCallback
(MotechEvent event, Throwable throwable)¶ Callback method, invoked when the event handler method has thrown an exception.
Parameters: - event – the event that was being handled
- throwable – the throwable that has caused the failure
Returns: true, if the event system should proceed with retries; false otherwise
getName¶
successCallback¶
-
void
successCallback
(MotechEvent event)¶ Callback method, invoked when the event handler method has executed successfully.
Parameters: - event – the event that has been handled