[
https://issues.apache.org/jira/browse/CAMEL-5566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13593620#comment-13593620
]
Antonin Stefanutti edited comment on CAMEL-5566 at 3/5/13 5:29 PM:
-------------------------------------------------------------------
Attaching [^CAMEL-5566.patch] so that {{@ContextName}} is a regular CDI
qualifier to enable the injection of Camel context by name.
The processing of types implementing {{CamelContextAware}} in
{{CamelExtension}} has yet to be fixed to make the injection of the Camel
context scoped when multiple contexts exist, though I haven't been able to
figure a way out for that. This is actually breaking the injection of
{{CdiPropertiesComponent}} bean when property placeholders are declared in the
Camel routes. Any suggestion are welcome.
@ [~jstrachan], would you be considering re-opening that issue as you suggested
to get that fixed?
was (Author: antonin.stefanutti):
Attaching !CAMEL-5566.patch! so that {{@ContextName}} is a regular CDI
qualifier to enable the injection of Camel context by name.
The processing of types implementing {{CamelContextAware}} in
{{CamelExtension}} has yet to be fixed to make the injection of the Camel
context scoped when multiple contexts exist, though I haven't been able to
figure a way out for that. This is actually breaking the injection of
{{CdiPropertiesComponent}} bean when property placeholders are declared in the
Camel routes. Any suggestion are welcome.
@ [~jstrachan], would you be considering re-opening that issue as you suggested
to get that fixed?
> provide an annotation to auto-register a RouteBuilder with a CamelContext
> (lazily creating a new CamelContext if a different contextName is specified)
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-5566
> URL: https://issues.apache.org/jira/browse/CAMEL-5566
> Project: Camel
> Issue Type: Improvement
> Components: camel-cdi
> Reporter: james strachan
> Assignee: james strachan
> Fix For: 2.11.0
>
> Attachments: CAMEL-5566.patch
>
>
> as per Romain's ideas on the dev list, it would be nice to have an annotation
> to make it easy to inject a RouteBuilder instance then bind it to a
> CamelContext (basically creating the CamelContext for the given context name
> and calling CamelContext.addRoutes(routes)).
> Previously Romain had gone with @CamelContextId though am thinking, @Named is
> the way of associating an id/name with a bean and its really more about camel
> lifecycles, so thinking of using @CamelStartup to make it more obvious what
> it does (with the contextName being an optional parameter too; since multiple
> contexts within the same class loader are kinda rare - there's no huge need
> for more than one CamelContext).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira