org.springframework.integration.bus
Class MessageBus

java.lang.Object
  extended by org.springframework.integration.bus.MessageBus
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, ChannelRegistry

public class MessageBus
extends java.lang.Object
implements ChannelRegistry, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

The messaging bus. Serves as a registry for channels and endpoints, manages their lifecycle, and activates subscriptions.

Author:
Mark Fisher

Constructor Summary
MessageBus()
           
 
Method Summary
 MessageChannel getErrorChannel()
           
 void initialize()
           
 boolean isRunning()
           
 MessageChannel lookupChannel(java.lang.String channelName)
           
 void registerChannel(java.lang.String name, MessageChannel channel)
           
 void registerEndpoint(java.lang.String name, MessageEndpoint endpoint)
           
 void registerHandler(java.lang.String name, MessageHandler handler, Subscription subscription)
           
 void registerHandler(java.lang.String name, MessageHandler handler, Subscription subscription, ConcurrencyPolicy concurrencyPolicy)
           
 void registerSourceAdapter(java.lang.String name, SourceAdapter adapter)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setAutoCreateChannels(boolean autoCreateChannels)
          Set whether the bus should automatically create a channel when a subscription contains the name of a previously unregistered channel.
 void setDispatcherPoolSize(int dispatcherPoolSize)
          Set the size for the dispatcher thread pool.
 void setErrorChannel(MessageChannel errorChannel)
           
 void setMessagingTaskScheduler(MessagingTaskScheduler taskScheduler)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageBus

public MessageBus()
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

setMessagingTaskScheduler

public void setMessagingTaskScheduler(MessagingTaskScheduler taskScheduler)

setDispatcherPoolSize

public void setDispatcherPoolSize(int dispatcherPoolSize)
Set the size for the dispatcher thread pool.


setAutoCreateChannels

public void setAutoCreateChannels(boolean autoCreateChannels)
Set whether the bus should automatically create a channel when a subscription contains the name of a previously unregistered channel.


initialize

public void initialize()

getErrorChannel

public MessageChannel getErrorChannel()
Specified by:
getErrorChannel in interface ChannelRegistry

setErrorChannel

public void setErrorChannel(MessageChannel errorChannel)
Specified by:
setErrorChannel in interface ChannelRegistry

lookupChannel

public MessageChannel lookupChannel(java.lang.String channelName)
Specified by:
lookupChannel in interface ChannelRegistry

registerChannel

public void registerChannel(java.lang.String name,
                            MessageChannel channel)
Specified by:
registerChannel in interface ChannelRegistry

registerHandler

public void registerHandler(java.lang.String name,
                            MessageHandler handler,
                            Subscription subscription)

registerHandler

public void registerHandler(java.lang.String name,
                            MessageHandler handler,
                            Subscription subscription,
                            ConcurrencyPolicy concurrencyPolicy)

registerEndpoint

public void registerEndpoint(java.lang.String name,
                             MessageEndpoint endpoint)

registerSourceAdapter

public void registerSourceAdapter(java.lang.String name,
                                  SourceAdapter adapter)

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.springframework.context.Lifecycle

start

public void start()
Specified by:
start in interface org.springframework.context.Lifecycle

stop

public void stop()
Specified by:
stop in interface org.springframework.context.Lifecycle