|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 target while still sending the original message to the main channel.
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
logger
|
private boolean |
running
|
private MessageSelector |
selector
|
private MessageTarget |
target
|
private long |
timeout
|
Constructor Summary | |
---|---|
WireTap(MessageTarget target)
Create a new wire tap with no MessageSelector . |
|
WireTap(MessageTarget target,
MessageSelector selector)
Create a new wire tap with the provided MessageSelector . |
Method Summary | |
---|---|
boolean |
isRunning()
Check whether the wire tap is currently running. |
Message<?> |
preSend(Message<?> message,
MessageChannel channel)
Intercept the Message and, if accepted by the MessageSelector ,
send it to the secondary target. |
void |
setTimeout(long timeout)
Specify the timeout value for sending to the intercepting target. |
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 |
---|
private static final org.apache.commons.logging.Log logger
private final MessageTarget target
private volatile long timeout
private final MessageSelector selector
private volatile boolean running
Constructor Detail |
---|
public WireTap(MessageTarget target)
MessageSelector
.
target
- the MessageTarget to which intercepted messages will be sentpublic WireTap(MessageTarget target, MessageSelector selector)
MessageSelector
.
target
- the target to which intercepted messages will be sentselector
- the selector that must accept a message for it to
be sent to the intercepting targetMethod Detail |
---|
public void setTimeout(long timeout)
BlockingTarget
.
The default value is 0.
timeout
- the timeout in millisecondspublic 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 Message<?> preSend(Message<?> message, MessageChannel channel)
MessageSelector
,
send it to the secondary target. If this wire tap's MessageSelector
is
null
, it will accept all messages.
preSend
in interface ChannelInterceptor
preSend
in class ChannelInterceptorAdapter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |