Interface HandlerInput<M>

Type Parameters:
M - the message type used by the handling pipeline
All Known Subinterfaces:
LocalHandlerInput
All Known Implementing Classes:
LocalExecution

public interface HandlerInput<M>
Provides the input for a prepared handler invocation.

The payload is always available directly. The enclosing message may be created only when a parameter resolver, interceptor, or handler asks for it. This lets local handlers that only need their payload avoid message creation altogether.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the message that contains the payload, creating it first when necessary.
    default M
    Returns the message if it is already available.
    Returns the payload that is being handled.
  • Method Details

    • getPayload

      Object getPayload()
      Returns the payload that is being handled.
      Returns:
      the payload; never null
    • getMessage

      M getMessage()
      Returns the message that contains the payload, creating it first when necessary.
      Returns:
      the message being handled
    • getMessageIfAvailable

      default M getMessageIfAvailable()
      Returns the message if it is already available.

      The default implementation calls getMessage(). Implementations that create messages lazily should override this method and return null while no message has been created.

      Returns:
      the existing message, or null if a lazy implementation has not created it yet