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 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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the friendly name for this component.default voidIt is the responsibility of implementations of this interface to ensure that allExceptions, includingRuntimeExceptions, are handled.default voidonAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success) Handle a message with a call back action if a message is successful.voidonAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success, Consumer<AdaptrisMessage> failure) Handle a message with call back actions if a message is successful or failed.
-
Method Details
-
onAdaptrisMessage
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
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, Consumer<AdaptrisMessage> success, 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
String friendlyName()Get the friendly name for this component.- Returns:
- the friendly name.
-