org.springframework.integration.channel
Class AbstractSubscribableChannel<T extends MessageDispatcher>
java.lang.Object
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.channel.AbstractSubscribableChannel<T>
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanNameAware, SubscribableChannel, MessageChannel
- Direct Known Subclasses:
- DirectChannel, PublishSubscribeChannel
public class AbstractSubscribableChannel<T extends MessageDispatcher>
- extends AbstractMessageChannel
- implements SubscribableChannel
Base implementation of MessageChannel
that invokes the subscribed
handler(s)
by delegating to a MessageDispatcher
.
- Author:
- Mark Fisher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AbstractSubscribableChannel
public AbstractSubscribableChannel(T dispatcher)
getDispatcher
protected T getDispatcher()
subscribe
public boolean subscribe(MessageHandler handler)
- Description copied from interface:
SubscribableChannel
- Register a
MessageHandler
as a subscriber to this channel.
- Specified by:
subscribe
in interface SubscribableChannel
unsubscribe
public boolean unsubscribe(MessageHandler handle)
- Description copied from interface:
SubscribableChannel
- Remove a
MessageHandler
from the subscribers of this channel.
- Specified by:
unsubscribe
in interface SubscribableChannel
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