-
Dec 11th, 2008, 08:35 PM
#1
Question on MessageBus autoStartup
Hi,
I am using Spring Integration M4 and I want to start the MessageBus manually, but I found that even I set the following:
<bean id="internal.MessageBus" class="org.springframework.integration.bus.Message Bus" ">
<property name="autoStartup" value="false"/>
</bean>
The MessageBus is still started by the ApplicationContext, I trace the spring framework source, seems the problem is due to Spring will trigger the start() for all beans implement LifeCycle interface:
In AbstractApplicationContext:
//---------------------------------------------------------------------
// Implementation of Lifecycle interface
//---------------------------------------------------------------------
public void start() {
Map lifecycleBeans = getLifecycleBeans();
for (Iterator it = new LinkedHashSet(lifecycleBeans.keySet()).iterator(); it.hasNext()
{
String beanName = (String) it.next();
doStart(lifecycleBeans, beanName);
}
publishEvent(new ContextStartedEvent(this));
}
Any suggestion on this problem?
Thanks
Ryan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules