|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
org.springframework.integration.channel.interceptor.WireTap
public class WireTap
A ChannelInterceptor
that publishes a copy of the intercepted message
to a secondary channel while still sending the original message to the main channel.
Field Summary | |
---|---|
private org.apache.commons.logging.Log |
logger
|
static java.lang.String |
ORIGINAL_MESSAGE_ID_KEY
key for the attribute containing the original Message's id |
private boolean |
running
|
private MessageChannel |
secondaryChannel
|
private java.util.List<MessageSelector> |
selectors
|
Constructor Summary | |
---|---|
WireTap(MessageChannel secondaryChannel)
Create a new wire tap with no MessageSelectors . |
|
WireTap(MessageChannel secondaryChannel,
java.util.List<MessageSelector> selectors)
Create a new wire tap with MessageSelectors . |
Method Summary | |
---|---|
boolean |
isRunning()
Check whether the wire tap is currently running. |
boolean |
preSend(Message<?> message,
MessageChannel channel)
|
private boolean |
selectorsAccept(Message<?> message)
If this wire tap has any MessageSelectors , check
whether they accept the current message. |
void |
start()
Restart the wire tap if it has been stopped. |
void |
stop()
Stop the wire tap. |
Methods inherited from class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter |
---|
postReceive, postSend, preReceive |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ORIGINAL_MESSAGE_ID_KEY
private final org.apache.commons.logging.Log logger
private final MessageChannel secondaryChannel
private final java.util.List<MessageSelector> selectors
private volatile boolean running
Constructor Detail |
---|
public WireTap(MessageChannel secondaryChannel)
MessageSelectors
.
secondaryChannel
- the channel to which duplicate messages will be sentpublic WireTap(MessageChannel secondaryChannel, java.util.List<MessageSelector> selectors)
MessageSelectors
.
secondaryChannel
- the channel to which duplicate messages will be sentselectors
- the list of selectors that must accept a message for it to
be sent to the secondary channelMethod Detail |
---|
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
start()
.
stop
in interface org.springframework.context.Lifecycle
public boolean preSend(Message<?> message, MessageChannel channel)
preSend
in interface ChannelInterceptor
preSend
in class ChannelInterceptorAdapter
private boolean selectorsAccept(Message<?> message)
MessageSelectors
, check
whether they accept the current message. If any of them do not accept it,
the message will not be sent to the secondary channel.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |