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 Details

    • onAdaptrisMessage

      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.

      Parameters:
      msg - the AdaptrisMessage to process
      Implementation Note:
      the default implementation just calls onAdaptrisMessage(AdaptrisMessage, Consumer).
    • onAdaptrisMessage

      default void onAdaptrisMessage(AdaptrisMessage msg, Consumer<AdaptrisMessage> success)
      Handle a message with a call back action if a message is successful.
      Parameters:
      msg - the message
      success - 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 message
      success - called on success
      failure - called on failure
    • friendlyName

      String friendlyName()
      Get the friendly name for this component.
      Returns:
      the friendly name.