camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/7] git commit: Polished
Date Tue, 25 Jun 2013 09:08:54 GMT
Updated Branches:
  refs/heads/camel-2.10.x 5d2ef93da -> 04be110cc
  refs/heads/camel-2.11.x ddeae97f7 -> 274d018da
  refs/heads/master e1cb42118 -> 55c66af89


Polished


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

Branch: refs/heads/master
Commit: afcecf7d94fb1bb29604da5784ce1d96bf4c836e
Parents: e1cb421
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Jun 25 10:55:59 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Jun 25 10:55:59 2013 +0200

----------------------------------------------------------------------
 .../apache/camel/impl/DefaultCamelContext.java  | 37 +++++++++-----------
 1 file changed, 17 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/afcecf7d/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index a276eac..f536bc7 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -18,13 +18,11 @@ package org.apache.camel.impl;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -169,7 +167,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
     private List<LifecycleStrategy> lifecycleStrategies = new ArrayList<LifecycleStrategy>();
     private ManagementStrategy managementStrategy;
     private ManagementMBeanAssembler managementMBeanAssembler;
-    private AtomicBoolean managementStrategyInitialized = new AtomicBoolean(false);
+    private final AtomicBoolean managementStrategyInitialized = new AtomicBoolean(false);
     private final List<RouteDefinition> routeDefinitions = new ArrayList<RouteDefinition>();
     private List<InterceptStrategy> interceptStrategies = new ArrayList<InterceptStrategy>();
 
@@ -2447,7 +2445,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
     public void setManagementStrategy(ManagementStrategy managementStrategy) {
         synchronized (managementStrategyInitialized) {
             if (managementStrategyInitialized.get()) {
-                log.warn("Resetting ManagementStrategy for context " + getName());
+                log.warn("Resetting ManagementStrategy for CamelContext: " + getName());
             }
 
             this.managementStrategy = managementStrategy;
@@ -2662,6 +2660,19 @@ public class DefaultCamelContext extends ServiceSupport implements
ModelCamelCon
         this.uuidGenerator = uuidGenerator;
     }
 
+    @Override
+    public String getProperty(String name) {
+        String value = getProperties().get(name);
+        if (ObjectHelper.isNotEmpty(value)) {
+            try {
+                value = resolvePropertyPlaceholders(value);
+            } catch (Exception e) {
+                throw new RuntimeCamelException("Error getting property: " + name, e);
+            }
+        }
+        return value;
+    }
+
     protected Map<String, RouteService> getRouteServices() {
         return routeServices;
     }
@@ -2670,11 +2681,6 @@ public class DefaultCamelContext extends ServiceSupport implements
ModelCamelCon
         return new ManagementStrategyFactory().create(this, disableJMX || Boolean.getBoolean(JmxSystemPropertyKeys.DISABLED));
     }
 
-    @Override
-    public String toString() {
-        return "CamelContext(" + getName() + ")";
-    }
-
     /**
      * Reset context counter to a preset value. Mostly used for tests to ensure a predictable
getName()
      *
@@ -2695,16 +2701,7 @@ public class DefaultCamelContext extends ServiceSupport implements
ModelCamelCon
     }
 
     @Override
-    public String getProperty(String name) {
-        String value = getProperties().get(name);
-        if (ObjectHelper.isNotEmpty(value)) {
-            try {
-                value = resolvePropertyPlaceholders(value);
-            } catch (Exception ex) {
-                // throw CamelRutimeException
-                throw new RuntimeCamelException(ex);
-            }
-        }
-        return value;
+    public String toString() {
+        return "CamelContext(" + getName() + ")";
     }
 }


Mime
View raw message