camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [06/11] camel git commit: CAMEL-10546: Deprecated getProperties() from the camel context management bean
Date Sun, 22 Jan 2017 18:51:52 GMT
CAMEL-10546: Deprecated getProperties() from the camel context management bean


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

Branch: refs/heads/master
Commit: 116a09a9d9276d10baf190d43f2ac14a9131b1b9
Parents: 3c012b0
Author: aldettinger <aldettinger@gmail.com>
Authored: Sat Jan 21 14:06:20 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Jan 22 18:06:43 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/CamelContext.java     |  4 +--
 .../mbean/ManagedCamelContextMBean.java         | 38 +++++++++++++-------
 .../apache/camel/impl/DefaultCamelContext.java  | 10 +++---
 .../management/mbean/ManagedCamelContext.java   | 26 +++++++++++---
 4 files changed, 54 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/116a09a9/camel-core/src/main/java/org/apache/camel/CamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/CamelContext.java b/camel-core/src/main/java/org/apache/camel/CamelContext.java
index a2beea1..597b685 100644
--- a/camel-core/src/main/java/org/apache/camel/CamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/CamelContext.java
@@ -1303,7 +1303,7 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration
{
     /**
      * @deprecated use {@link #getGlobalOption(String)} instead.
      */
-    String getProperty(String name);
+    String getProperty(String key);
 
     /**
      * Gets the global option value that can be referenced in the camel context
@@ -1315,7 +1315,7 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration
{
      *
      * @return the string value of the global option
      */
-    String getGlobalOption(String name);
+    String getGlobalOption(String key);
 
     /**
      * Gets the default FactoryFinder which will be used for the loading the factory class
from META-INF

http://git-wip-us.apache.org/repos/asf/camel/blob/116a09a9/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
index af1de0b..b30e73e 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
@@ -49,9 +49,13 @@ public interface ManagedCamelContextMBean extends ManagedPerformanceCounterMBean
     @ManagedAttribute(description = "Camel Management StatisticsLevel")
     String getManagementStatisticsLevel();
 
+    @Deprecated
     @ManagedAttribute(description = "Camel Properties")
     Map<String, String> getProperties();
 
+    @ManagedAttribute(description = "Camel Global Options")
+    Map<String, String> getGlobalOptions();
+
     @ManagedAttribute(description = "ClassResolver class name")
     String getClassResolver();
 
@@ -61,26 +65,34 @@ public interface ManagedCamelContextMBean extends ManagedPerformanceCounterMBean
     @ManagedAttribute(description = "ApplicationContext class name")
     String getApplicationContextClassName();
 
+    @Deprecated
+    @ManagedOperation(description = "Gets the value of a Camel global option")
+    String getProperty(String key) throws Exception;
+
     /**
-     * Gets the value of a CamelContext property name
+     * Gets the value of a CamelContext global option
      *
-     * @param name the name of the property
-     * @return String the value of the property
-     * @throws Exception is thrown if error occurred
+     * @param key the global option key
+     * @return the global option value
+     * @throws Exception when an error occurred
      */
-    @ManagedOperation(description = "Get the value of a Camel property")
-    String getProperty(String name) throws Exception;
-    
+    @ManagedOperation(description = "Gets the value of a Camel global option")
+    String getGlobalOption(String key) throws Exception;
+
+    @Deprecated
+    @ManagedOperation(description = "Sets the value of a Camel global option")
+    void setProperty(String key, String value) throws Exception;
+
     /**
      * Sets the value of a CamelContext property name
      *
-     * @param name the name of the property
-     * @param value the new value of the property
-     * @throws Exception is thrown if error occurred
+     * @param key the global option key
+     * @param value the global option value
+     * @throws Exception when an error occurred
      */
-    @ManagedOperation(description = "Set the value of a Camel property")
-    void setProperty(String name, String value) throws Exception;
-    
+    @ManagedOperation(description = "Sets the value of a Camel global option")
+    void setGlobalOption(String key, String value) throws Exception;
+
     @ManagedAttribute(description = "Tracing")
     Boolean getTracing();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/116a09a9/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 2e94289..94f598a 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
@@ -4282,18 +4282,18 @@ public class DefaultCamelContext extends ServiceSupport implements
ModelCamelCon
 
     @Deprecated
     @Override
-    public String getProperty(String name) {
-        return getGlobalOption(name);
+    public String getProperty(String key) {
+        return getGlobalOption(key);
     }
 
     @Override
-    public String getGlobalOption(String name) {
-        String value = getGlobalOptions().get(name);
+    public String getGlobalOption(String key) {
+        String value = getGlobalOptions().get(key);
         if (ObjectHelper.isNotEmpty(value)) {
             try {
                 value = resolvePropertyPlaceholders(value);
             } catch (Exception e) {
-                throw new RuntimeCamelException("Error getting global option: " + name, e);
+                throw new RuntimeCamelException("Error getting global option: " + key, e);
             }
         }
         return value;

http://git-wip-us.apache.org/repos/asf/camel/blob/116a09a9/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
index f983cea..b419ea3 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
@@ -143,19 +143,37 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements
Ti
         }
     }
 
+    @Deprecated
     public Map<String, String> getProperties() {
+        return getGlobalOptions();
+    }
+
+    @Override
+    public Map<String, String> getGlobalOptions() {
         if (context.getGlobalOptions().isEmpty()) {
             return null;
         }
         return context.getGlobalOptions();
     }
 
-    public String getProperty(String name) throws Exception {
-        return context.getGlobalOption(name);
+    @Deprecated
+    public String getProperty(String key) throws Exception {
+        return getGlobalOption(key);
     }
 
-    public void setProperty(String name, String value) throws Exception {
-        context.getGlobalOptions().put(name, value);
+    @Override
+    public String getGlobalOption(String key) throws Exception {
+        return context.getGlobalOption(key);
+    }
+
+    @Deprecated
+    public void setProperty(String key, String value) throws Exception {
+        setGlobalOption(key, value);
+    }
+
+    @Override
+    public void setGlobalOption(String key, String value) throws Exception {
+        context.getGlobalOptions().put(key, value);
     }
 
     public Boolean getTracing() {


Mime
View raw message