james strachan created CAMEL-7327:
-------------------------------------
Summary: Improve Container.Instance API to deal with setting a
Container after CamelContexts have been created. There is a big risk
CamelContext's won't get managed right now
Key: CAMEL-7327
URL: https://issues.apache.org/jira/browse/CAMEL-7327
Project: Camel
Issue Type: Improvement
Reporter: james strachan
In environments like OSGi startup ordering is kinda random. Right now
CamelContexts's can startup and call
{code}
Container.Instance.manage(CamelContext)
{code}
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/spi/Container.java#L64
before any Container has called Container.Instance.set(). These CamelContexts's
will then not be managed.
A neater solution would be, if there is no container currently set:
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/spi/Container.java#L66
then keep a track of the CamelContext objects in a Set<CamelContext> - until
Container.Instance.unmanage() is called when they are stopped; then when
Container.Instance.set(Container) is called; all the previously registered
CamelContext's can be passed into the Container (and removed from the Set).
--
This message was sent by Atlassian JIRA
(v6.2#6252)