Package com.adaptris.core
Interface AdaptrisMessageListener
-
- All Known Subinterfaces:
Workflow
- All Known Implementing Classes:
DefaultFailedMessageRetrier,JmsTransactedWorkflow,LargeMessageWorkflow,MultiProducerWorkflow,PoolingWorkflow,RequestReplyWorkflow,StandardWorkflow,StandardWorkflowImpl,ThreadContextWorkflow,WorkflowImp,WorkflowWithObjectPool
public interface AdaptrisMessageListenerApplies arbitrary processing to
AdaptrisMessages. Applicable where the calling code does not want to be informed of anyExceptions that may occur.Serviceis applicable where the container requires to be informed ofExceptions.- See Also:
Service
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.StringfriendlyName()Get the friendly name for this component.default voidonAdaptrisMessage(AdaptrisMessage msg)It is the responsibility of implementations of this interface to ensure that allExceptions, includingRuntimeExceptions, are handled.default voidonAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success)Handle a message with a call back action if a message is successful.voidonAdaptrisMessage(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.
-
-
-
Method Detail
-
onAdaptrisMessage
default void onAdaptrisMessage(AdaptrisMessage msg)
It is the responsibility of implementations of this interface to ensure that all
Exceptions, includingRuntimeExceptions, are handled. Failure to handle anyExceptionwill result in undefined behaviour. Throwing aRuntimeExceptionto 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
synchronizedor use some other locking mechanism.- Parameters:
msg- theAdaptrisMessageto process- Implementation Note:
- the default implementation just calls
onAdaptrisMessage(AdaptrisMessage, Consumer).
-
onAdaptrisMessage
default void onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success)
Handle a message with a call back action if a message is successful.- Parameters:
msg- the messagesuccess- called on success
-
onAdaptrisMessage
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.- Parameters:
msg- the messagesuccess- called on successfailure- called on failure
-
friendlyName
java.lang.String friendlyName()
Get the friendly name for this component.- Returns:
- the friendly name.
-
-