org.springframework.messaging.support

## Class ChannelInterceptorAdapter

- java.lang.Object
- - org.springframework.messaging.support.ChannelInterceptorAdapter

- All Implemented Interfaces:
    ChannelInterceptor

      public abstract class ChannelInterceptorAdapter
      extends Object
      implements ChannelInterceptor

  A `ChannelInterceptor` base class with empty method implementations as a convenience.
  Since:
    4.0
  Author:
    Mark Fisher

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChannelInterceptorAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Message<?>` | `postReceive(Message<?> message, MessageChannel channel)` Invoked immediately after a Message has been retrieved but before it is returned to the caller.
    `void` | `postSend(Message<?> message, MessageChannel channel, boolean sent)` Invoked immediately after the send invocation.
    `boolean` | `preReceive(MessageChannel channel)` Invoked as soon as receive is called and before a Message is actually retrieved.
    `Message<?>` | `preSend(Message<?> message, MessageChannel channel)` Invoked before the Message is actually sent to the channel.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ChannelInterceptorAdapter

          public ChannelInterceptorAdapter()

  - ### Method Detail

    - #### preSend

          public Message<?> preSend(Message<?> message,
                                    MessageChannel channel)

      Description copied from interface: `ChannelInterceptor`
      Invoked before the Message is actually sent to the channel. This allows for modification of the Message if necessary. If this method returns `null`, then the actual send invocation will not occur.
      Specified by:
        `preSend` in interface `ChannelInterceptor`

    - #### postSend

          public void postSend(Message<?> message,
                               MessageChannel channel,
                               boolean sent)

      Description copied from interface: `ChannelInterceptor`
      Invoked immediately after the send invocation. The boolean value argument represents the return value of that invocation.
      Specified by:
        `postSend` in interface `ChannelInterceptor`

    - #### preReceive

          public boolean preReceive(MessageChannel channel)

      Description copied from interface: `ChannelInterceptor`
      Invoked as soon as receive is called and before a Message is actually retrieved. If the return value is 'false', then no Message will be retrieved. This only applies to PollableChannels.
      Specified by:
        `preReceive` in interface `ChannelInterceptor`

    - #### postReceive

          public Message<?> postReceive(Message<?> message,
                                        MessageChannel channel)

      Description copied from interface: `ChannelInterceptor`
      Invoked immediately after a Message has been retrieved but before it is returned to the caller. The Message may be modified if necessary. This only applies to PollableChannels.
      Specified by:
        `postReceive` in interface `ChannelInterceptor`