camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject git commit: CAMEL-7992 Fixed the Container lifecycle event method invoked outside of extension observer method invocation issue
Date Wed, 05 Nov 2014 12:12:31 GMT
Repository: camel
Updated Branches:
  refs/heads/master 1a6f5c394 -> d78abcffe


CAMEL-7992 Fixed the Container lifecycle event method invoked outside of extension observer
method invocation issue


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d78abcff
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d78abcff
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d78abcff

Branch: refs/heads/master
Commit: d78abcffe9d1ab0412061e072d1f461c818d898f
Parents: 1a6f5c3
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Nov 5 19:15:06 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Nov 5 20:12:06 2014 +0800

----------------------------------------------------------------------
 .../apache/camel/cdi/internal/CamelContextConfig.java    | 11 ++++++-----
 .../org/apache/camel/cdi/internal/CamelExtension.java    |  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d78abcff/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
index 84b4a81..523d41d 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
@@ -19,10 +19,11 @@ package org.apache.camel.cdi.internal;
 import java.lang.reflect.Type;
 import java.util.LinkedHashSet;
 import java.util.Set;
+
 import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
 
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.RuntimeCamelException;
@@ -36,15 +37,15 @@ import org.apache.camel.util.ObjectHelper;
 public class CamelContextConfig {
     // use a set to avoid duplicates
     private final Set<Bean<?>> routeBuilderBeans = new LinkedHashSet<Bean<?>>();
-    private final Set<ProcessAnnotatedType<?>> patRouteBuilders = new LinkedHashSet<ProcessAnnotatedType<?>>();
+    private final Set<AnnotatedType<?>> patRouteBuilders = new LinkedHashSet<AnnotatedType<?>>();
 
     public void addRouteBuilderBean(Bean<?> bean) {
         routeBuilderBeans.add(bean);
     }
 
     public void configure(CdiCamelContext camelContext, BeanManager beanManager) {
-        for (ProcessAnnotatedType<?> pat : patRouteBuilders) {
-            final Set<Bean<?>> beans = beanManager.getBeans(pat.getAnnotatedType().getJavaClass());
+        for (AnnotatedType<?> pat : patRouteBuilders) {
+            final Set<Bean<?>> beans = beanManager.getBeans(pat.getJavaClass());
             final Bean<?> bean = beanManager.resolve(beans);
             routeBuilderBeans.add(bean);
         }
@@ -83,7 +84,7 @@ public class CamelContextConfig {
         }
     }
 
-    public void addRouteBuilderBean(final ProcessAnnotatedType<?> process) {
+    public void addRouteBuilderBean(final AnnotatedType<?> process) {
         patRouteBuilders.add(process);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/d78abcff/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelExtension.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelExtension.java
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelExtension.java
index 651be9e..47a5ffa 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelExtension.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelExtension.java
@@ -112,11 +112,11 @@ public class CamelExtension implements Extension {
         ContextName annotation = annotatedType.getAnnotation(ContextName.class);
         Class javaClass = annotatedType.getJavaClass();
         if (annotation != null && isRoutesBean(javaClass)) {
-            addRouteBuilderBean(process, annotation);
+            addRouteBuilderBean(annotatedType, annotation);
         }
     }
 
-    private void addRouteBuilderBean(final ProcessAnnotatedType<?> process, ContextName
annotation) {
+    private void addRouteBuilderBean(final AnnotatedType<?> process, ContextName annotation)
{
         final CamelContextConfig config = getCamelConfig(annotation.value());
         config.addRouteBuilderBean(process);
     }


Mime
View raw message