camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r1307578 - in /camel/trunk/components: camel-cdi/src/main/java/org/apache/camel/component/cdi/CdiBeanRegistry.java camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
Date Fri, 30 Mar 2012 19:23:03 GMT
Author: hadrian
Date: Fri Mar 30 19:23:02 2012
New Revision: 1307578

URL: http://svn.apache.org/viewvc?rev=1307578&view=rev
Log:
CS fixes

Modified:
    camel/trunk/components/camel-cdi/src/main/java/org/apache/camel/component/cdi/CdiBeanRegistry.java
    camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java

Modified: camel/trunk/components/camel-cdi/src/main/java/org/apache/camel/component/cdi/CdiBeanRegistry.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cdi/src/main/java/org/apache/camel/component/cdi/CdiBeanRegistry.java?rev=1307578&r1=1307577&r2=1307578&view=diff
==============================================================================
--- camel/trunk/components/camel-cdi/src/main/java/org/apache/camel/component/cdi/CdiBeanRegistry.java
(original)
+++ camel/trunk/components/camel-cdi/src/main/java/org/apache/camel/component/cdi/CdiBeanRegistry.java
Fri Mar 30 19:23:02 2012
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
  * CdiBeanRegistry used by Camel to perform lookup into the CDI {@link javax.enterprise.inject.spi.BeanManager}.
  */
 public class CdiBeanRegistry implements Registry {
-    private final static Logger LOG = LoggerFactory.getLogger(CdiBeanRegistry.class);
+    private static final Logger LOG = LoggerFactory.getLogger(CdiBeanRegistry.class);
 
     @Override
     public Object lookup(final String name) {

Modified: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java?rev=1307578&r1=1307577&r2=1307578&view=diff
==============================================================================
--- camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
(original)
+++ camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
Fri Mar 30 19:23:02 2012
@@ -147,46 +147,7 @@ public abstract class AbstractCamelConte
         // and enable lazy loading of type converters if applicable
         initLazyLoadTypeConverteres();
 
-        ClassResolver classResolver = getBeanForType(ClassResolver.class);
-        if (classResolver != null) {
-            LOG.info("Using custom ClassResolver: " + classResolver);
-            getContext().setClassResolver(classResolver);
-        }
-        FactoryFinderResolver factoryFinderResolver = getBeanForType(FactoryFinderResolver.class);
-        if (factoryFinderResolver != null) {
-            LOG.info("Using custom FactoryFinderResolver: " + factoryFinderResolver);
-            getContext().setFactoryFinderResolver(factoryFinderResolver);
-        }
-        ExecutorServiceManager executorServiceStrategy = getBeanForType(ExecutorServiceManager.class);
-        if (executorServiceStrategy != null) {
-            LOG.info("Using custom ExecutorServiceStrategy: " + executorServiceStrategy);
-            getContext().setExecutorServiceManager(executorServiceStrategy);
-        }
-        ThreadPoolFactory threadPoolFactory = getBeanForType(ThreadPoolFactory.class);
-        if (threadPoolFactory != null) {
-            LOG.info("Using custom ThreadPoolFactory: " + threadPoolFactory);
-            getContext().getExecutorServiceManager().setThreadPoolFactory(threadPoolFactory);
-        }
-        ProcessorFactory processorFactory = getBeanForType(ProcessorFactory.class);
-        if (processorFactory != null) {
-            LOG.info("Using custom ProcessorFactory: " + processorFactory);
-            getContext().setProcessorFactory(processorFactory);
-        }
-        Debugger debugger = getBeanForType(Debugger.class);
-        if (debugger != null) {
-            LOG.info("Using custom Debugger: " + debugger);
-            getContext().setDebugger(debugger);
-        }
-        UuidGenerator uuidGenerator = getBeanForType(UuidGenerator.class);
-        if (uuidGenerator != null) {
-            LOG.info("Using custom UuidGenerator: " + uuidGenerator);
-            getContext().setUuidGenerator(uuidGenerator);
-        }
-        NodeIdFactory nodeIdFactory = getBeanForType(NodeIdFactory.class);
-        if (nodeIdFactory != null) {
-            LOG.info("Using custom NodeIdFactory: " + nodeIdFactory);
-            getContext().setNodeIdFactory(nodeIdFactory);
-        }
+        setupCustomServices();
 
         // set the custom registry if defined
         initCustomRegistry(getContext());
@@ -761,4 +722,46 @@ public abstract class AbstractCamelConte
         return packages.toArray(new String[packages.size()]);
     }
 
+    private void setupCustomServices() {
+        ClassResolver classResolver = getBeanForType(ClassResolver.class);
+        if (classResolver != null) {
+            LOG.info("Using custom ClassResolver: " + classResolver);
+            getContext().setClassResolver(classResolver);
+        }
+        FactoryFinderResolver factoryFinderResolver = getBeanForType(FactoryFinderResolver.class);
+        if (factoryFinderResolver != null) {
+            LOG.info("Using custom FactoryFinderResolver: " + factoryFinderResolver);
+            getContext().setFactoryFinderResolver(factoryFinderResolver);
+        }
+        ExecutorServiceManager executorServiceStrategy = getBeanForType(ExecutorServiceManager.class);
+        if (executorServiceStrategy != null) {
+            LOG.info("Using custom ExecutorServiceStrategy: " + executorServiceStrategy);
+            getContext().setExecutorServiceManager(executorServiceStrategy);
+        }
+        ThreadPoolFactory threadPoolFactory = getBeanForType(ThreadPoolFactory.class);
+        if (threadPoolFactory != null) {
+            LOG.info("Using custom ThreadPoolFactory: " + threadPoolFactory);
+            getContext().getExecutorServiceManager().setThreadPoolFactory(threadPoolFactory);
+        }
+        ProcessorFactory processorFactory = getBeanForType(ProcessorFactory.class);
+        if (processorFactory != null) {
+            LOG.info("Using custom ProcessorFactory: " + processorFactory);
+            getContext().setProcessorFactory(processorFactory);
+        }
+        Debugger debugger = getBeanForType(Debugger.class);
+        if (debugger != null) {
+            LOG.info("Using custom Debugger: " + debugger);
+            getContext().setDebugger(debugger);
+        }
+        UuidGenerator uuidGenerator = getBeanForType(UuidGenerator.class);
+        if (uuidGenerator != null) {
+            LOG.info("Using custom UuidGenerator: " + uuidGenerator);
+            getContext().setUuidGenerator(uuidGenerator);
+        }
+        NodeIdFactory nodeIdFactory = getBeanForType(NodeIdFactory.class);
+        if (nodeIdFactory != null) {
+            LOG.info("Using custom NodeIdFactory: " + nodeIdFactory);
+            getContext().setNodeIdFactory(nodeIdFactory);
+        }
+    }
 }



Mime
View raw message