org.springframework.integration.channel.interceptor
Class MessageStoringInterceptor

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

public class MessageStoringInterceptor
extends ChannelInterceptorAdapter

A ChannelInterceptor that delegates to a MessageStore. Upon sending to the channel, the message will be added to the store, and upon receiving from the channel, the message will be removed from the store.

Author:
Mark Fisher

Field Summary
private  java.lang.Object initializationMonitor
           
private  boolean initialized
           
private  org.apache.commons.logging.Log logger
           
private  MessageStore messageStore
           
 
Constructor Summary
MessageStoringInterceptor(MessageStore messageStore)
           
 
Method Summary
 Message<?> postReceive(Message<?> message, MessageChannel channel)
           
 boolean preReceive(MessageChannel channel)
           
 Message<?> preSend(Message<?> message, MessageChannel channel)
           
 
Methods inherited from class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
postSend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private final org.apache.commons.logging.Log logger

messageStore

private final MessageStore messageStore

initialized

private volatile boolean initialized

initializationMonitor

private final java.lang.Object initializationMonitor
Constructor Detail

MessageStoringInterceptor

public MessageStoringInterceptor(MessageStore messageStore)
Method Detail

preSend

public Message<?> preSend(Message<?> message,
                          MessageChannel channel)
Specified by:
preSend in interface ChannelInterceptor
Overrides:
preSend in class ChannelInterceptorAdapter

preReceive

public boolean preReceive(MessageChannel channel)
Specified by:
preReceive in interface ChannelInterceptor
Overrides:
preReceive in class ChannelInterceptorAdapter

postReceive

public Message<?> postReceive(Message<?> message,
                              MessageChannel channel)
Specified by:
postReceive in interface ChannelInterceptor
Overrides:
postReceive in class ChannelInterceptorAdapter