org.springframework.integration.channel
Class DirectChannel
java.lang.Object
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.channel.DirectChannel
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanNameAware, MessageChannel, BlockingTarget, MessageSource, MessageTarget, SubscribableSource
public class DirectChannel
- extends AbstractMessageChannel
- implements SubscribableSource
A channel that invokes the subscribed target(s)
in
the sender's thread (returning after at most one handles the message).
- Author:
- Dave Syer, Mark Fisher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
dispatcher
private final SimpleDispatcher dispatcher
DirectChannel
public DirectChannel()
subscribe
public boolean subscribe(MessageTarget target)
- Description copied from interface:
SubscribableSource
- Register a
MessageTarget
as a subscriber to this source.
- Specified by:
subscribe
in interface SubscribableSource
unsubscribe
public boolean unsubscribe(MessageTarget target)
- Description copied from interface:
SubscribableSource
- Remove a
MessageTarget
from the subscribers of this source.
- Specified by:
unsubscribe
in interface SubscribableSource
doSend
protected boolean doSend(Message<?> message,
long timeout)
- Description copied from class:
AbstractMessageChannel
- Subclasses must implement this method. A non-negative timeout indicates
how long to wait if the channel is at capacity (if the value is 0, it
must return immediately with or without success). A negative timeout
value indicates that the method should block until either the message is
accepted or the blocking thread is interrupted.
- Specified by:
doSend
in class AbstractMessageChannel