[ 
https://issues.apache.org/jira/browse/CAMEL-12833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16627078#comment-16627078
 ] 

ASF GitHub Bot commented on CAMEL-12833:
----------------------------------------

astefanutti commented on a change in pull request #2532: CAMEL-12833: Provide a 
method of customizing Camel CDI context creation
URL: https://github.com/apache/camel/pull/2532#discussion_r220116102
 
 

 ##########
 File path: 
components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java
 ##########
 @@ -244,6 +253,22 @@ private void afterBeanDiscovery(@Observes 
AfterBeanDiscovery abd, BeanManager ma
         // The set of extra Camel CDI beans
         Set<SyntheticBean<?>> extraBeans = new HashSet<>();
 
+        // Find DefaultContextCreateStrategy
+        Bean<?> defaultContextCreateStrategy = cdiBeans.stream()
+            .filter(hasType(DefaultContextCreateStrategy.class))
+            .findFirst()
+            .orElse(null);
 
 Review comment:
   `orElseThrow` could be used. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Provide a method of customizing Camel CDI context creation
> ----------------------------------------------------------
>
>                 Key: CAMEL-12833
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12833
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cdi
>            Reporter: James Netherton
>            Assignee: James Netherton
>            Priority: Major
>
> For some platforms it'd be useful if Camel CDI had some way of customizing 
> the way in which a {{CamelContext}} was created. E.g for controlling which 
> ClassLoader is used during instantiation.
> I propose to introduce a {{ContextCreateStrategy}} which users can provide 
> custom instances of in their deployments. The default implementation will do 
> {{CamelContext}} creation as per normal.
> Some more background for the motivation here:
> https://github.com/wildfly-extras/wildfly-camel/issues/2497



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to