camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/7] git commit: Polished
Date Tue, 25 Jun 2013 09:08:57 GMT
Polished


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

Branch: refs/heads/camel-2.11.x
Commit: bb2afbba18653d4578def0259eba70c5a4216fb2
Parents: 5a7c775
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 11:05:59 2013 +0200

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


http://git-wip-us.apache.org/repos/asf/camel/blob/bb2afbba/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 e386aff..bb652d1 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
@@ -161,7 +161,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>();
 
@@ -2385,7 +2385,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;
@@ -2589,6 +2589,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;
     }
@@ -2597,11 +2610,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()
      *
@@ -2622,16 +2630,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