org.springframework.integration.channel
Class PublishSubscribeChannel

java.lang.Object
  extended by org.springframework.integration.channel.AbstractMessageChannel
      extended by org.springframework.integration.channel.PublishSubscribeChannel
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, MessageChannel, BlockingTarget, MessageSource, MessageTarget, SubscribableSource

public class PublishSubscribeChannel
extends AbstractMessageChannel
implements SubscribableSource

Author:
Mark Fisher

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel
AbstractMessageChannel.ChannelInterceptorList
 
Field Summary
private  BroadcastingDispatcher dispatcher
           
 
Constructor Summary
PublishSubscribeChannel()
           
PublishSubscribeChannel(org.springframework.core.task.TaskExecutor taskExecutor)
          Create a PublishSubscribeChannel that will use a TaskExecutor to publish its Messages.
 
Method Summary
protected  boolean doSend(Message<?> message, long timeout)
          Subclasses must implement this method.
 void setApplySequence(boolean applySequence)
           
 boolean subscribe(MessageTarget target)
          Register a MessageTarget as a subscriber to this source.
 boolean unsubscribe(MessageTarget target)
          Remove a MessageTarget from the subscribers of this source.
 
Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel
addInterceptor, getInterceptors, getName, send, send, setBeanName, setInterceptors, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dispatcher

private final BroadcastingDispatcher dispatcher
Constructor Detail

PublishSubscribeChannel

public PublishSubscribeChannel(org.springframework.core.task.TaskExecutor taskExecutor)
Create a PublishSubscribeChannel that will use a TaskExecutor to publish its Messages.


PublishSubscribeChannel

public PublishSubscribeChannel()
Method Detail

setApplySequence

public void setApplySequence(boolean applySequence)

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