You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/07/20 10:00:41 UTC

[3/3] git commit: CAMEL-7586: Removed duplicate getter on camelcontext mbean for message history.

CAMEL-7586: Removed duplicate getter on camelcontext mbean for message history.


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

Branch: refs/heads/camel-2.12.x
Commit: aca2e9ee1bfeb1b7798a1a8e496eb372c8dc9676
Parents: 8345ed1
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jul 20 10:00:05 2014 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jul 20 10:00:26 2014 +0200

----------------------------------------------------------------------
 .../mbean/ManagedCamelContextMBean.java         |  3 --
 .../management/mbean/ManagedCamelContext.java   |  6 +--
 .../ManagedCamelContextNewProxyTest.java        | 40 ++++++++++++++++++++
 3 files changed, 41 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/aca2e9ee/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 fb9cdc2..590b431 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
@@ -80,9 +80,6 @@ public interface ManagedCamelContextMBean extends ManagedPerformanceCounterMBean
     @ManagedAttribute(description = "Tracing")
     void setTracing(Boolean tracing);
 
-    @ManagedAttribute(description = "Message History")
-    Boolean getMessageHistory();
-
     @ManagedAttribute(description = "Current number of inflight Exchanges")
     Integer getInflightExchanges();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/aca2e9ee/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 58f0a4a..2aeffe8 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
@@ -125,10 +125,6 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements Ti
         context.setTracing(tracing);
     }
 
-    public Boolean getMessageHistory() {
-        return context.isMessageHistory();
-    }
-
     public Integer getInflightExchanges() {
         return context.getInflightRepository().size();
     }
@@ -192,7 +188,7 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements Ti
     }
 
     public boolean isMessageHistory() {
-        return context.isMessageHistory();
+        return context.isMessageHistory() != null ? context.isMessageHistory() : false;
     }
 
     public boolean isUseMDCLogging() {

http://git-wip-us.apache.org/repos/asf/camel/blob/aca2e9ee/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextNewProxyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextNewProxyTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextNewProxyTest.java
new file mode 100644
index 0000000..8413f05
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextNewProxyTest.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.management;
+
+import javax.management.JMX;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.api.management.mbean.ManagedCamelContextMBean;
+
+public class ManagedCamelContextNewProxyTest extends ManagementTestSupport {
+
+    public void testNewProxy() throws Exception {
+        // JMX tests dont work well on AIX CI servers (hangs them)
+        if (isPlatform("aix")) {
+            return;
+        }
+
+        MBeanServer mbeanServer = getMBeanServer();
+
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
+
+        ManagedCamelContextMBean proxy = JMX.newMBeanProxy(mbeanServer, on, ManagedCamelContextMBean.class);
+        assertNotNull(proxy);
+    }
+}