|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.bus.DefaultMessageBus
public class DefaultMessageBus
The messaging bus. Serves as a registry for channels and endpoints, manages their lifecycle, and activates subscriptions.
Nested Class Summary | |
---|---|
private class |
DefaultMessageBus.MessageBusInterceptorsList
|
Field Summary | |
---|---|
private boolean |
autoCreateChannels
|
private boolean |
autoStartup
|
private ChannelFactory |
channelFactory
|
private ChannelRegistry |
channelRegistry
|
private boolean |
configureAsyncEventMulticaster
|
private static int |
DEFAULT_DISPATCHER_POOL_SIZE
|
private Schedule |
defaultPollerSchedule
|
private EndpointRegistry |
endpointRegistry
|
private java.util.Set<EndpointTrigger> |
endpointTriggers
|
private boolean |
initialized
|
private boolean |
initializing
|
private DefaultMessageBus.MessageBusInterceptorsList |
interceptors
|
private java.util.List<org.springframework.context.Lifecycle> |
lifecycleEndpoints
|
private java.lang.Object |
lifecycleMonitor
|
private org.apache.commons.logging.Log |
logger
|
private boolean |
running
|
private boolean |
starting
|
private TaskScheduler |
taskScheduler
|
Fields inherited from interface org.springframework.integration.channel.ChannelRegistry |
---|
ERROR_CHANNEL_NAME |
Constructor Summary | |
---|---|
DefaultMessageBus()
|
Method Summary | |
---|---|
private void |
activateEndpoint(MessageEndpoint endpoint)
|
private void |
activateEndpoints()
|
void |
addInterceptor(MessageBusInterceptor interceptor)
|
private void |
configureEndpoint(AbstractEndpoint endpoint,
java.lang.String name,
java.lang.Object input,
Schedule schedule)
|
void |
deactivateEndpoint(MessageEndpoint endpoint)
|
void |
destroy()
|
private void |
doConfigureAsyncEventMulticaster(org.springframework.context.ApplicationContext context)
|
ChannelFactory |
getChannelFactory()
|
java.util.Set<java.lang.String> |
getEndpointNames()
|
MessageChannel |
getErrorChannel()
|
void |
initialize()
|
boolean |
isRunning()
|
MessageChannel |
lookupChannel(java.lang.String channelName)
|
MessageEndpoint |
lookupEndpoint(java.lang.String endpointName)
|
private MessageChannel |
lookupOrCreateChannel(java.lang.String channelName)
|
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
|
void |
registerChannel(java.lang.String name,
MessageChannel channel)
|
private void |
registerChannels(org.springframework.context.ApplicationContext context)
|
void |
registerEndpoint(MessageEndpoint endpoint)
|
private void |
registerEndpoints(org.springframework.context.ApplicationContext context)
|
private void |
registerGateway(java.lang.String name,
MessagingGateway gateway)
|
private void |
registerGateways(org.springframework.context.ApplicationContext context)
|
void |
registerHandler(java.lang.String name,
MessageHandler handler,
java.lang.Object input,
Schedule schedule)
|
void |
registerTarget(java.lang.String name,
MessageTarget target,
java.lang.Object input,
Schedule schedule)
|
void |
removeInterceptor(MessageBusInterceptor interceptor)
|
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 |
setAutoStartup(boolean autoStartup)
Set whether to automatically start the bus after initialization. |
void |
setChannelFactory(ChannelFactory channelFactory)
Set the ChannelFactory to use for auto-creating channels. |
void |
setConfigureAsyncEventMulticaster(boolean configureAsyncEventMulticaster)
Set whether the bus should configure its asynchronous task executor to also be used by the ApplicationContext's 'applicationEventMulticaster'. |
void |
setErrorChannel(MessageChannel errorChannel)
|
void |
setInterceptors(java.util.List<MessageBusInterceptor> interceptor)
|
void |
setTaskScheduler(TaskScheduler taskScheduler)
Set the TaskScheduler to use for scheduling message dispatchers. |
void |
start()
|
void |
stop()
|
MessageChannel |
unregisterChannel(java.lang.String name)
|
MessageEndpoint |
unregisterEndpoint(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int DEFAULT_DISPATCHER_POOL_SIZE
private final org.apache.commons.logging.Log logger
private volatile ChannelFactory channelFactory
private final ChannelRegistry channelRegistry
private final EndpointRegistry endpointRegistry
private final java.util.Set<EndpointTrigger> endpointTriggers
private final java.util.List<org.springframework.context.Lifecycle> lifecycleEndpoints
private final DefaultMessageBus.MessageBusInterceptorsList interceptors
private volatile Schedule defaultPollerSchedule
private volatile TaskScheduler taskScheduler
private volatile boolean configureAsyncEventMulticaster
private volatile boolean autoCreateChannels
private volatile boolean autoStartup
private volatile boolean initialized
private volatile boolean initializing
private volatile boolean starting
private volatile boolean running
private final java.lang.Object lifecycleMonitor
Constructor Detail |
---|
public DefaultMessageBus()
Method Detail |
---|
public void setChannelFactory(ChannelFactory channelFactory)
ChannelFactory
to use for auto-creating channels.
public ChannelFactory getChannelFactory()
getChannelFactory
in interface MessageBus
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setTaskScheduler(TaskScheduler taskScheduler)
TaskScheduler
to use for scheduling message dispatchers.
public void setAutoStartup(boolean autoStartup)
Default is 'true'; set this to 'false' to allow for manual startup
through the start()
method.
public void setAutoCreateChannels(boolean autoCreateChannels)
public void setConfigureAsyncEventMulticaster(boolean configureAsyncEventMulticaster)
private void registerChannels(org.springframework.context.ApplicationContext context)
private void registerEndpoints(org.springframework.context.ApplicationContext context)
private void registerGateways(org.springframework.context.ApplicationContext context)
public void initialize()
public MessageChannel getErrorChannel()
getErrorChannel
in interface MessageBus
public void setErrorChannel(MessageChannel errorChannel)
public MessageChannel lookupChannel(java.lang.String channelName)
lookupChannel
in interface ChannelRegistry
public void registerChannel(java.lang.String name, MessageChannel channel)
registerChannel
in interface ChannelRegistry
public MessageChannel unregisterChannel(java.lang.String name)
unregisterChannel
in interface ChannelRegistry
public void registerHandler(java.lang.String name, MessageHandler handler, java.lang.Object input, Schedule schedule)
registerHandler
in interface MessageBus
public void registerTarget(java.lang.String name, MessageTarget target, java.lang.Object input, Schedule schedule)
registerTarget
in interface MessageBus
private void configureEndpoint(AbstractEndpoint endpoint, java.lang.String name, java.lang.Object input, Schedule schedule)
public void registerEndpoint(MessageEndpoint endpoint)
registerEndpoint
in interface EndpointRegistry
public MessageEndpoint unregisterEndpoint(java.lang.String name)
unregisterEndpoint
in interface EndpointRegistry
public MessageEndpoint lookupEndpoint(java.lang.String endpointName)
lookupEndpoint
in interface EndpointRegistry
public java.util.Set<java.lang.String> getEndpointNames()
getEndpointNames
in interface EndpointRegistry
private void activateEndpoints()
private void activateEndpoint(MessageEndpoint endpoint)
private MessageChannel lookupOrCreateChannel(java.lang.String channelName)
private void registerGateway(java.lang.String name, MessagingGateway gateway)
public void deactivateEndpoint(MessageEndpoint endpoint)
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener
private void doConfigureAsyncEventMulticaster(org.springframework.context.ApplicationContext context)
public void addInterceptor(MessageBusInterceptor interceptor)
public void removeInterceptor(MessageBusInterceptor interceptor)
public void setInterceptors(java.util.List<MessageBusInterceptor> interceptor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |