public interface AdaptrisMessageListener
Applies arbitrary processing to AdaptrisMessages. Applicable
where the calling code does not want to be informed
of any Exceptions that may occur. Service
is applicable where the container requires to be informed of
Exceptions.
Service| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
friendlyName()
Get the friendly name for this component.
|
default void |
onAdaptrisMessage(AdaptrisMessage msg)
It is the responsibility of implementations of this interface to ensure that all
Exceptions, including
RuntimeExceptions, are handled. |
default void |
onAdaptrisMessage(AdaptrisMessage msg,
java.util.function.Consumer<AdaptrisMessage> success)
Handle a message with a call back action if a message is successful.
|
void |
onAdaptrisMessage(AdaptrisMessage msg,
java.util.function.Consumer<AdaptrisMessage> success,
java.util.function.Consumer<AdaptrisMessage> failure)
Handle a message with call back actions if a message is successful or failed.
|
default void onAdaptrisMessage(AdaptrisMessage msg)
It is the responsibility of implementations of this interface to ensure that all Exceptions, including
RuntimeExceptions, are handled. Failure to handle any Exception will result in undefined behaviour.
Throwing a RuntimeException to this method is considered a bug.
Although most clients of implementations of this interface are likely to be single-threaded, if implementations are not
guaranteed to be thread safe, they should be synchronized or use some other locking mechanism.
msg - the AdaptrisMessage to processonAdaptrisMessage(AdaptrisMessage, Consumer).default void onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success)
msg - the messagesuccess - called on successvoid onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success, java.util.function.Consumer<AdaptrisMessage> failure)
msg - the messagesuccess - called on successfailure - called on failurejava.lang.String friendlyName()