[
https://issues.apache.org/jira/browse/CAMEL-5413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13404638#comment-13404638
]
Jan Hornbøll Hansen edited comment on CAMEL-5413 at 6/30/12 9:50 PM:
---------------------------------------------------------------------
Ups that was a bit of a "typo". Sorry about the camel mule mixup. Anyway when I
instantiate a context with "new DefaultCamelContext();" (ie. not using Guice) I
have to start context explicitly after I have added routes. If context is
created while creating injector as an eager singleton it gets started
automatically deep within Guice. That is wrong. Creating context using
dependency injection should not change its behavior. Also creating and starting
should not be tied together, since you may want to create service objects in a
different order than they are started (or rather you may not care what order
objects are created as long as everyone gets their dependencies, but most
likely will care what order things are started).
I am unsure whether this is an unintended bug or a design flaw, but it appears
start is invoked somewhere inside guicyfruit.
was (Author: jhhdk):
Ups that was a bit of a "typo". Sorry about the camel mule mixup. Anyway
when I instantiate a context with new DefaultCamelContext() (ie. not using
Guice) I have to start context explicitly after I have added routes. If context
is created while creating injector as an eager singleton deep within Guice, it
gets started automatically. That is wrong. Creating context using dependency
injection should not change its behavior. Also creating and starting should not
be tied together, since you may want to create service objects in a different
order than they are started (or rather you may not care what order objects are
created as long as everyone gets their dependencies, but most likely will care
what order things are started).
I am unsure whether this is an unintended bug or a design flaw, but it appears
start is invoked somewhere inside guicyfruit.
> Context instantiated using Guice behaves differently than if instantiated
> "manually"
> ------------------------------------------------------------------------------------
>
> Key: CAMEL-5413
> URL: https://issues.apache.org/jira/browse/CAMEL-5413
> Project: Camel
> Issue Type: Bug
> Components: camel-guice
> Affects Versions: 2.9.2
> Reporter: Jan Hornbøll Hansen
> Attachments: issues.zip
>
>
> Creating injector for mule context causes mule context to be started.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira