Spring Integration

org.springframework.integration.transformer
Class MessageTransformingChannelInterceptor

java.lang.Object
  extended by org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
      extended by org.springframework.integration.transformer.MessageTransformingChannelInterceptor
All Implemented Interfaces:
ChannelInterceptor

public class MessageTransformingChannelInterceptor
extends ChannelInterceptorAdapter

A ChannelInterceptor which invokes a Transformer when either sending-to or receiving-from a channel.

Author:
Jonas Partner

Constructor Summary
MessageTransformingChannelInterceptor(Transformer transformer)
           
 
Method Summary
 boolean getTransformOnSend()
           
 Message<?> postReceive(Message<?> message, MessageChannel channel)
          Invoked immediately after a Message has been retrieved but before it is returned to the caller.
 Message<?> preSend(Message<?> message, MessageChannel channel)
          Invoked before the Message is actually sent to the channel.
 void setTransformOnSend(boolean transformOnSend)
           
 
Methods inherited from class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
postSend, preReceive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageTransformingChannelInterceptor

public MessageTransformingChannelInterceptor(Transformer transformer)
Method Detail

getTransformOnSend

public boolean getTransformOnSend()

setTransformOnSend

public void setTransformOnSend(boolean transformOnSend)

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
Overrides:
preSend in class ChannelInterceptorAdapter

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
Overrides:
postReceive in class ChannelInterceptorAdapter

Spring Integration