org.springframework.integration.channel
Class PublishSubscribeChannel

java.lang.Object
  extended by org.springframework.integration.channel.AbstractMessageChannel
      extended by org.springframework.integration.channel.AbstractSubscribableChannel
          extended by org.springframework.integration.channel.PublishSubscribeChannel
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, SubscribableChannel, MessageChannel

public class PublishSubscribeChannel
extends AbstractSubscribableChannel
implements org.springframework.beans.factory.BeanFactoryAware

A channel that sends Messages to each of its subscribers.

Author:
Mark Fisher

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel
AbstractMessageChannel.ChannelInterceptorList
 
Constructor Summary
PublishSubscribeChannel()
          Create a PublishSubscribeChannel that will invoke the handlers in the message sender's thread.
PublishSubscribeChannel(org.springframework.core.task.TaskExecutor taskExecutor)
          Create a PublishSubscribeChannel that will use a TaskExecutor to invoke the handlers.
 
Method Summary
protected  BroadcastingDispatcher getDispatcher()
           
 void setApplySequence(boolean applySequence)
          Specify whether to apply the sequence number and size headers to the messages prior to invoking the subscribed handlers.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setErrorHandler(ErrorHandler errorHandler)
           
 void setIgnoreFailures(boolean ignoreFailures)
          Specify whether failures for one or more of the handlers should be ignored.
 
Methods inherited from class org.springframework.integration.channel.AbstractSubscribableChannel
doSend, subscribe, unsubscribe
 
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
 
Methods inherited from interface org.springframework.integration.core.MessageChannel
getName, send, send
 

Constructor Detail

PublishSubscribeChannel

public PublishSubscribeChannel(org.springframework.core.task.TaskExecutor taskExecutor)
Create a PublishSubscribeChannel that will use a TaskExecutor to invoke the handlers. If this is null, each invocation will occur in the message sender's thread.


PublishSubscribeChannel

public PublishSubscribeChannel()
Create a PublishSubscribeChannel that will invoke the handlers in the message sender's thread.

Method Detail

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)

setIgnoreFailures

public void setIgnoreFailures(boolean ignoreFailures)
Specify whether failures for one or more of the handlers should be ignored. By default this is false meaning that an Exception will be thrown whenever a handler fails. To override this and suppress Exceptions, set the value to true.


setApplySequence

public void setApplySequence(boolean applySequence)
Specify whether to apply the sequence number and size headers to the messages prior to invoking the subscribed handlers. By default, this value is false meaning that sequence headers will not be applied. If planning to use an Aggregator downstream with the default correlation and completion strategies, you should set this flag to true.


setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware

getDispatcher

protected BroadcastingDispatcher getDispatcher()
Specified by:
getDispatcher in class AbstractSubscribableChannel