camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/4] git commit: CAMEL-6938: Do not include hostname in JMX MBean names by default. Added option to turn it back on in case some people really need the old behavior.
Date Wed, 06 Nov 2013 09:40:28 GMT
CAMEL-6938: Do not include hostname in JMX MBean names by default. Added option to turn it back on in case some people really need the old behavior.


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

Branch: refs/heads/master
Commit: 0e8aa70aba86b8951b608b777cefc32d563eaa8d
Parents: 0fea7da
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Nov 5 18:58:06 2013 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Nov 6 08:57:04 2013 +0100

----------------------------------------------------------------------
 .../management/DefaultManagementAgent.java      | 12 ++++
 .../DefaultManagementNamingStrategy.java        |  7 ++-
 .../camel/management/JmxSystemPropertyKeys.java |  3 +
 .../management/mbean/ManagedCamelContext.java   |  8 ++-
 .../camel/management/mbean/ManagedRoute.java    |  6 +-
 .../org/apache/camel/spi/ManagementAgent.java   | 19 ++++++
 .../camel/management/BacklogDebuggerTest.java   | 12 ++--
 .../management/BacklogTracerFilterTest.java     |  2 +-
 .../BacklogTracerIdOnAllNodesTest.java          |  2 +-
 .../BacklogTracerPatternRouteTest.java          |  2 +-
 .../management/BacklogTracerPatternTest.java    |  2 +-
 .../camel/management/BacklogTracerTest.java     | 14 ++---
 .../DualManagedThreadPoolProfileTest.java       |  4 +-
 .../DualManagedThreadPoolWithIdTest.java        |  4 +-
 .../management/EndpointCompletionTest.java      |  4 +-
 .../JmxNotificationEventNotifierTest.java       |  4 +-
 .../camel/management/JmxRecipientListTest.java  | 20 +++----
 .../ManagedBrowsableEndpointAsXmlTest.java      | 14 ++---
 .../ManagedBrowsableEndpointEmptyTest.java      |  2 +-
 .../ManagedBrowsableEndpointTest.java           |  2 +-
 .../apache/camel/management/ManagedCBRTest.java | 16 ++---
 .../ManagedCamelContextAutoStartupTest.java     |  4 +-
 .../ManagedCamelContextDumpRoutesAsXmlTest.java |  2 +-
 .../ManagedCamelContextDumpStatsAsXmlTest.java  |  2 +-
 .../ManagedCamelContextPropertiesTest.java      |  2 +-
 .../ManagedCamelContextRestartTest.java         |  2 +-
 .../ManagedCamelContextSuspendResumeTest.java   |  2 +-
 .../ManagedCamelContextSuspendStartTest.java    |  2 +-
 .../management/ManagedCamelContextTest.java     | 12 ++--
 .../ManagedCamelContextTracerTest.java          |  4 +-
 ...agedCamelContextUpdateRoutesFromXmlTest.java |  2 +-
 ...nagedCanekContextExchangeStatisticsTest.java |  6 +-
 .../camel/management/ManagedCustomBeanTest.java |  2 +-
 .../management/ManagedCustomPolicyTest.java     |  6 +-
 .../management/ManagedCustomProcessorTest.java  |  2 +-
 .../camel/management/ManagedDelayerTest.java    |  4 +-
 .../management/ManagedDualCamelContextTest.java |  4 +-
 .../camel/management/ManagedEndpointTest.java   |  4 +-
 .../camel/management/ManagedInterceptTest.java  |  6 +-
 .../management/ManagedLoadBalancerTest.java     |  6 +-
 .../management/ManagedLogEndpointTest.java      |  2 +-
 .../camel/management/ManagedMulticastTest.java  |  6 +-
 .../management/ManagedNamePatternFixedTest.java |  2 +-
 .../ManagedNamePatternIncludeHostNameTest.java  | 61 ++++++++++++++++++++
 .../management/ManagedNamePatternTest.java      |  2 +-
 .../ManagedRedeliverRouteOnlyTest.java          |  2 +-
 .../camel/management/ManagedRedeliverTest.java  |  4 +-
 .../ManagedRegisterCamelContextTest.java        |  2 +-
 .../management/ManagedRegisterEndpointTest.java |  6 +-
 .../ManagedRegisterExchangeStatisticsTest.java  |  2 +-
 ...nagedRemoveRouteAggregateThreadPoolTest.java |  2 +-
 .../ManagedResetIncludeRoutesTest.java          |  2 +-
 .../camel/management/ManagedResourceTest.java   |  4 +-
 .../ManagedRouteAddFromRouteTest.java           |  4 +-
 .../management/ManagedRouteAddRemoveTest.java   | 14 ++---
 ...eAddSecondRouteNotRegisterNewRoutesTest.java |  4 +-
 .../ManagedRouteAddSecondRouteTest.java         |  4 +-
 .../management/ManagedRouteAutoStartupTest.java |  6 +-
 .../ManagedRouteContextTracerTest.java          |  4 +-
 .../ManagedRouteDumpStatsAsXmlTest.java         |  2 +-
 .../ManagedRoutePerformanceCounterTest.java     |  2 +-
 ...outeRemoveWireTapExplicitThreadPoolTest.java |  2 +-
 .../ManagedRouteRemoveWireTapTest.java          |  2 +-
 .../camel/management/ManagedSanitizeTest.java   |  2 +-
 .../management/ManagedSedaEndpointTest.java     |  2 +-
 .../management/ManagedSendProcessorTest.java    |  2 +-
 .../management/ManagedServiceUrlPathTest.java   |  6 +-
 .../management/ManagedShutdownStrategyTest.java |  2 +-
 .../camel/management/ManagedStatisticsTest.java |  4 +-
 .../ManagedStatisticsWithSplitterTest.java      | 10 ++--
 .../ManagedStreamCachingStrategyTest.java       |  2 +-
 .../ManagedThreadPoolProfileTest.java           |  2 +-
 .../camel/management/ManagedThreadPoolTest.java |  2 +-
 .../management/ManagedThreadPoolWithIdTest.java |  2 +-
 .../camel/management/ManagedThrottlerTest.java  | 24 ++++----
 .../camel/management/ManagedTimerTest.java      |  2 +-
 .../management/ManagedTracerOptionsTest.java    |  2 +-
 .../ManagedTypeConverterRegistryTest.java       |  2 +-
 .../ManagedUnregisterCamelContextTest.java      |  2 +-
 .../ManagedUnregisterEndpointTest.java          |  2 +-
 .../management/ManagedUnregisterRouteTest.java  |  2 +-
 ...edCamelContextAutoAssignedNameClashTest.java |  4 +-
 .../TwoManagedCamelContextClashTest.java        | 10 ++--
 .../management/TwoManagedCamelContextTest.java  |  4 +-
 .../management/TwoManagedNamePatternTest.java   |  4 +-
 .../xml/AbstractCamelContextFactoryBean.java    |  1 +
 .../camel/core/xml/CamelJMXAgentDefinition.java | 17 ++++++
 .../component/jms/ManagedJmsEndpointTest.java   |  2 +-
 .../jms/ManagedJmsEndpointTopicTest.java        |  2 +-
 ...STransactionIsTransactedRedeliveredTest.java |  2 +-
 .../netty/http/ManagedNettyEndpointTest.java    |  4 +-
 .../ExposedServletEndpointURIToJMXTest.java     |  2 +-
 ...ngJmxDumpRoutesAsXmlIncludeHostNameTest.java | 57 ++++++++++++++++++
 .../SpringJmxDumpRoutesAsXmlTest.java           |  2 +-
 .../SpringJmxEndpointInjectBeanRefTest.java     |  4 +-
 .../SpringJmxEndpointInjectBeanRefTwoTest.java  |  4 +-
 .../SpringJmxEndpointInjectBeanTest.java        |  4 +-
 ...pringJmxRecipientListRegisterAlwaysTest.java | 10 ++--
 .../management/SpringJmxRecipientListTest.java  | 10 ++--
 .../SpringManagedCustomProcessorTest.java       |  2 +-
 .../SpringManagedSedaEndpointTest.java          |  2 +-
 .../DualSpringManagedThreadsThreadPoolTest.java |  4 +-
 .../SpringManagedThreadsThreadPoolTest.java     |  2 +-
 ...ringJmxDumpRouteAsXmlIncludeHostNameTest.xml | 50 ++++++++++++++++
 ...agedNamePatternFixedIncludeHostNameTest.java | 57 ++++++++++++++++++
 .../management/ManagedNamePatternFixedTest.java |  2 +-
 ...nagedNamePatternFixedIncludeHostNameTest.xml | 38 ++++++++++++
 ...melBlueprintManagedNamePatternFixedTest.java |  2 +-
 .../OSGiIntegrationManagedCamelContextTest.java |  2 +-
 109 files changed, 537 insertions(+), 213 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java
index f134ae4..4c9f768 100644
--- a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java
@@ -77,6 +77,7 @@ public class DefaultManagementAgent extends ServiceSupport implements Management
     private Boolean registerAlways;
     private Boolean registerNewRoutes = true;
     private Boolean mask;
+    private Boolean includeHostName;
 
     public DefaultManagementAgent() {
     }
@@ -120,6 +121,9 @@ public class DefaultManagementAgent extends ServiceSupport implements Management
         if (System.getProperty(JmxSystemPropertyKeys.MASK) != null) {
             mask = Boolean.getBoolean(JmxSystemPropertyKeys.MASK);
         }
+        if (System.getProperty(JmxSystemPropertyKeys.INCLUDE_HOST_NAME) != null) {
+            includeHostName = Boolean.getBoolean(JmxSystemPropertyKeys.INCLUDE_HOST_NAME);
+        }
         if (System.getProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR) != null) {
             createConnector = Boolean.getBoolean(JmxSystemPropertyKeys.CREATE_CONNECTOR);
         }
@@ -221,6 +225,14 @@ public class DefaultManagementAgent extends ServiceSupport implements Management
         this.mask = mask;
     }
 
+    public Boolean getIncludeHostName() {
+        return includeHostName != null && includeHostName;
+    }
+
+    public void setIncludeHostName(Boolean includeHostName) {
+        this.includeHostName = includeHostName;
+    }
+
     public CamelContext getCamelContext() {
         return camelContext;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
index c2a45ad..fdd538a 100644
--- a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
@@ -306,7 +306,12 @@ public class DefaultManagementNamingStrategy implements ManagementNamingStrategy
     }
 
     protected String getContextId(String name) {
-        return hostName + "/" + (name != null ? name : VALUE_UNKNOWN);
+        Boolean includeHostName = camelContext != null && camelContext.getManagementStrategy().getManagementAgent().getIncludeHostName();
+        if (includeHostName != null && includeHostName) {
+            return hostName + "/" + (name != null ? name : VALUE_UNKNOWN);
+        } else {
+            return name != null ? name : VALUE_UNKNOWN;
+        }
     }
 
     protected String getEndpointId(Endpoint ep) {

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/main/java/org/apache/camel/management/JmxSystemPropertyKeys.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/JmxSystemPropertyKeys.java b/camel-core/src/main/java/org/apache/camel/management/JmxSystemPropertyKeys.java
index ac0a052..3db8bfc 100644
--- a/camel-core/src/main/java/org/apache/camel/management/JmxSystemPropertyKeys.java
+++ b/camel-core/src/main/java/org/apache/camel/management/JmxSystemPropertyKeys.java
@@ -59,6 +59,9 @@ public final class JmxSystemPropertyKeys {
     // Whether to remove detected sensitive information (such as passwords) from MBean names and attributes.
     public static final String MASK = "org.apache.camel.jmx.mask";
 
+    // Whether to include host name in MBean naes
+    public static final String INCLUDE_HOST_NAME = "org.apache.camel.jmx.includeHostName";
+
     private JmxSystemPropertyKeys() {
         // not instantiated
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/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 b41ff35..d540428 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
@@ -282,13 +282,14 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements Ti
         MBeanServer server = getContext().getManagementStrategy().getManagementAgent().getMBeanServer();
         if (server != null) {
             // gather all the routes for this CamelContext, which requires JMX
-            ObjectName query = ObjectName.getInstance("org.apache.camel:context=*/" + getContext().getManagementName() + ",type=routes,*");
+            String prefix = getContext().getManagementStrategy().getManagementAgent().getIncludeHostName() ? "*/" : "";
+            ObjectName query = ObjectName.getInstance("org.apache.camel:context=" + prefix + getContext().getManagementName() + ",type=routes,*");
             Set<ObjectName> routes = server.queryNames(query, null);
 
             Set<ManagedProcessorMBean> processors = new LinkedHashSet<ManagedProcessorMBean>();
             if (includeProcessors) {
                 // gather all the processors for this CamelContext, which requires JMX
-                query = ObjectName.getInstance("org.apache.camel:context=*/" + getContext().getManagementName() + ",type=processors,*");
+                query = ObjectName.getInstance("org.apache.camel:context=" + prefix + getContext().getManagementName() + ",type=processors,*");
                 Set<ObjectName> names = server.queryNames(query, null);
                 for (ObjectName on : names) {
                     ManagedProcessorMBean processor = MBeanServerInvocationHandler.newProxyInstance(server, on, ManagedProcessorMBean.class, true);
@@ -397,7 +398,8 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements Ti
             MBeanServer server = getContext().getManagementStrategy().getManagementAgent().getMBeanServer();
             if (server != null) {
                 // get all the routes mbeans and sort them accordingly to their index
-                ObjectName query = ObjectName.getInstance("org.apache.camel:context=*/" + getContext().getManagementName() + ",type=routes,*");
+                String prefix = getContext().getManagementStrategy().getManagementAgent().getIncludeHostName() ? "*/" : "";
+                ObjectName query = ObjectName.getInstance("org.apache.camel:context=" + prefix + getContext().getManagementName() + ",type=routes,*");
                 Set<ObjectName> names = server.queryNames(query, null);
                 for (ObjectName name : names) {
                     server.invoke(name, "reset", new Object[]{true}, new String[]{"boolean"});

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
index a4951f8..1c6495a 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
@@ -245,7 +245,8 @@ public class ManagedRoute extends ManagedPerformanceCounter implements TimerList
             MBeanServer server = getContext().getManagementStrategy().getManagementAgent().getMBeanServer();
             if (server != null) {
                 // get all the processor mbeans and sort them accordingly to their index
-                ObjectName query = ObjectName.getInstance("org.apache.camel:context=*/" + getContext().getManagementName() + ",type=processors,*");
+                String prefix = getContext().getManagementStrategy().getManagementAgent().getIncludeHostName() ? "*/" : "";
+                ObjectName query = ObjectName.getInstance("org.apache.camel:context=" + prefix + getContext().getManagementName() + ",type=processors,*");
                 Set<ObjectName> names = server.queryNames(query, null);
                 List<ManagedProcessorMBean> mps = new ArrayList<ManagedProcessorMBean>();
                 for (ObjectName on : names) {
@@ -313,7 +314,8 @@ public class ManagedRoute extends ManagedPerformanceCounter implements TimerList
             MBeanServer server = getContext().getManagementStrategy().getManagementAgent().getMBeanServer();
             if (server != null) {
                 // get all the processor mbeans and sort them accordingly to their index
-                ObjectName query = ObjectName.getInstance("org.apache.camel:context=*/" + getContext().getManagementName() + ",type=processors,*");
+                String prefix = getContext().getManagementStrategy().getManagementAgent().getIncludeHostName() ? "*/" : "";
+                ObjectName query = ObjectName.getInstance("org.apache.camel:context=" + prefix + getContext().getManagementName() + ",type=processors,*");
                 QueryExp queryExp = Query.match(new AttributeValueExp("RouteId"), new StringValueExp(getRouteId()));
                 Set<ObjectName> names = server.queryNames(query, queryExp);
                 for (ObjectName name : names) {

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java b/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
index b0354c8..bec9b8b 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
@@ -259,4 +259,23 @@ public interface ManagementAgent extends Service {
      * This option is default <tt>false</tt>.
      */
     void setMask(Boolean sanitize);
+
+    /**
+     * Gets whether host name is included in MBean names.
+     *
+     * @return <tt>true</tt> if included
+     */
+    Boolean getIncludeHostName();
+
+    /**
+     * Sets whether to include host name in the {@link ManagementNamingStrategy}.
+     * <p/>
+     * By default this is turned off from Camel 2.13 onwards, but this option
+     * can be set to <tt>true</tt> to include the hostname as Camel 2.12 or
+     * older releases does.
+     *
+     * @param includeHostName <tt>true</tt> to include host name in the MBean names.
+     */
+    void setIncludeHostName(Boolean includeHostName);
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/BacklogDebuggerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/BacklogDebuggerTest.java b/camel-core/src/test/java/org/apache/camel/management/BacklogDebuggerTest.java
index 694865f..6d9140c 100644
--- a/camel-core/src/test/java/org/apache/camel/management/BacklogDebuggerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/BacklogDebuggerTest.java
@@ -33,7 +33,7 @@ public class BacklogDebuggerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogDebugger");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogDebugger");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -93,7 +93,7 @@ public class BacklogDebuggerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogDebugger");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogDebugger");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -170,7 +170,7 @@ public class BacklogDebuggerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogDebugger");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogDebugger");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -231,7 +231,7 @@ public class BacklogDebuggerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogDebugger");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogDebugger");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -303,7 +303,7 @@ public class BacklogDebuggerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogDebugger");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogDebugger");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -404,7 +404,7 @@ public class BacklogDebuggerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogDebugger");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogDebugger");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
index 59d6d8b..7bd60bf 100644
--- a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
@@ -35,7 +35,7 @@ public class BacklogTracerFilterTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
index a0cdbb8..86c4fef 100644
--- a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
@@ -41,7 +41,7 @@ public class BacklogTracerIdOnAllNodesTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
index 560b249..aa71382 100644
--- a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
@@ -34,7 +34,7 @@ public class BacklogTracerPatternRouteTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
index 42feee4..a03079c 100644
--- a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
@@ -35,7 +35,7 @@ public class BacklogTracerPatternTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerTest.java b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerTest.java
index 289bf82..56d039c 100644
--- a/camel-core/src/test/java/org/apache/camel/management/BacklogTracerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/BacklogTracerTest.java
@@ -38,7 +38,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -85,7 +85,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
 
     public void testBacklogTracerEventMessageAsXml() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -123,7 +123,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
     @SuppressWarnings("unchecked")
     public void testBacklogTracerEventMessageDumpAll() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -194,7 +194,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
 
     public void testBacklogTracerEventMessageDumpAllAsXml() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -228,7 +228,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
     @SuppressWarnings("unchecked")
     public void testBacklogTracerNotRemoveOnDump() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -280,7 +280,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
     @SuppressWarnings("unchecked")
     public void testBacklogTracerNotRemoveOnDumpPattern() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -340,7 +340,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
     @SuppressWarnings("unchecked")
     public void testBacklogTracerNotRemoveOverflow() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=BacklogTracer");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=BacklogTracer");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolProfileTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolProfileTest.java b/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolProfileTest.java
index 4db9a45..7c2a619 100644
--- a/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolProfileTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolProfileTest.java
@@ -36,7 +36,7 @@ public class DualManagedThreadPoolProfileTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=threadpools,name=\"threads1(threads)\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=threadpools,name=\"threads1(threads)\"");
 
         Integer corePoolSize = (Integer) mbeanServer.getAttribute(on, "CorePoolSize");
         assertEquals(5, corePoolSize.intValue());
@@ -56,7 +56,7 @@ public class DualManagedThreadPoolProfileTest extends ManagementTestSupport {
         String profile = (String) mbeanServer.getAttribute(on, "ThreadPoolProfileId");
         assertEquals("custom", profile);
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=threadpools,name=\"threads2(threads)\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=threadpools,name=\"threads2(threads)\"");
 
         corePoolSize = (Integer) mbeanServer.getAttribute(on, "CorePoolSize");
         assertEquals(5, corePoolSize.intValue());

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolWithIdTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolWithIdTest.java b/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolWithIdTest.java
index eff7c0a..81b63c1 100644
--- a/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolWithIdTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/DualManagedThreadPoolWithIdTest.java
@@ -34,7 +34,7 @@ public class DualManagedThreadPoolWithIdTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=threadpools,name=\"myThreads(threads)\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=threadpools,name=\"myThreads(threads)\"");
 
         Integer corePoolSize = (Integer) mbeanServer.getAttribute(on, "CorePoolSize");
         assertEquals(15, corePoolSize.intValue());
@@ -51,7 +51,7 @@ public class DualManagedThreadPoolWithIdTest extends ManagementTestSupport {
         String route = (String) mbeanServer.getAttribute(on, "RouteId");
         assertEquals("route1", route);
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=threadpools,name=\"myOtherThreads(threads)\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=threadpools,name=\"myOtherThreads(threads)\"");
 
         corePoolSize = (Integer) mbeanServer.getAttribute(on, "CorePoolSize");
         assertEquals(1, corePoolSize.intValue());

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java b/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java
index c9a0c7d..bec8dfa 100644
--- a/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/EndpointCompletionTest.java
@@ -40,7 +40,7 @@ public class EndpointCompletionTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
         ObjectName on = ObjectName.getInstance(
-                "org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+                "org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 
@@ -62,7 +62,7 @@ public class EndpointCompletionTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
         ObjectName on = ObjectName.getInstance(
-                "org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+                "org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
         assertNotNull(on);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java b/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
index b047d30..96dfc50 100644
--- a/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java
@@ -62,7 +62,7 @@ public class JmxNotificationEventNotifierTest extends ContextTestSupport {
     public void testExchangeDone() throws Exception {
         // START SNIPPET: e2
         // register the NotificationListener
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=eventnotifiers,name=JmxEventNotifier");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=eventnotifiers,name=JmxEventNotifier");
         MyNotificationListener listener = new MyNotificationListener();   
         context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,
             listener,                                                                                         
@@ -87,7 +87,7 @@ public class JmxNotificationEventNotifierTest extends ContextTestSupport {
     }
 
     public void testExchangeFailed() throws Exception {
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=eventnotifiers,name=JmxEventNotifier");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=eventnotifiers,name=JmxEventNotifier");
         
         MyNotificationListener listener = new MyNotificationListener();   
         context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/JmxRecipientListTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/JmxRecipientListTest.java b/camel-core/src/test/java/org/apache/camel/management/JmxRecipientListTest.java
index f6f81cb..d0b025b 100644
--- a/camel-core/src/test/java/org/apache/camel/management/JmxRecipientListTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/JmxRecipientListTest.java
@@ -48,21 +48,21 @@ public class JmxRecipientListTest extends ManagementTestSupport {
         MBeanServer mbeanServer = getMBeanServer();
 
         // this endpoint is part of the route and should be registered
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"direct://a\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"direct://a\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
 
         // endpoints added after routes has been started is by default not registered
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://x\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://x\"");
         assertFalse("Should not be registered", mbeanServer.isRegistered(name));
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://y\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://y\"");
         assertFalse("Should not be registered", mbeanServer.isRegistered(name));
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://z\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://z\"");
         assertFalse("Should not be registered", mbeanServer.isRegistered(name));
 
         // however components is always registered
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=components,name=\"mock\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=components,name=\"mock\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
     }
 
@@ -90,21 +90,21 @@ public class JmxRecipientListTest extends ManagementTestSupport {
         MBeanServer mbeanServer = getMBeanServer();
 
         // this endpoint is part of the route and should be registered
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"direct://a\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"direct://a\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
 
         // endpoints added after routes has been started is now also registered
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://x\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://x\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://y\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://y\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://z\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://z\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
 
         // however components is always registered
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=components,name=\"mock\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=components,name=\"mock\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(name));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointAsXmlTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointAsXmlTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointAsXmlTest.java
index 9f6baab..b3772bb 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointAsXmlTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointAsXmlTest.java
@@ -56,7 +56,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseMessageAsXml", new Object[]{0, true}, new String[]{"java.lang.Integer", "java.lang.Boolean"});
         assertNotNull(out);
@@ -120,7 +120,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseMessageAsXml", new Object[]{0, false}, new String[]{"java.lang.Integer", "java.lang.Boolean"});
         assertNotNull(out);
@@ -151,7 +151,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseAllMessagesAsXml", new Object[]{true}, new String[]{"java.lang.Boolean"});
         assertNotNull(out);
@@ -179,7 +179,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         List<Exchange> exchanges = getMockEndpoint("mock:result").getReceivedExchanges();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseAllMessagesAsXml", new Object[]{false}, new String[]{"java.lang.Boolean"});
         assertNotNull(out);
@@ -209,7 +209,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseRangeMessagesAsXml", new Object[]{0, 1, true}, new String[]{"java.lang.Integer", "java.lang.Integer", "java.lang.Boolean"});
         assertNotNull(out);
@@ -238,7 +238,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseRangeMessagesAsXml", new Object[]{0, 1, false}, new String[]{"java.lang.Integer", "java.lang.Integer", "java.lang.Boolean"});
         assertNotNull(out);
@@ -258,7 +258,7 @@ public class ManagedBrowsableEndpointAsXmlTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         try {
             mbeanServer.invoke(name, "browseRangeMessagesAsXml", new Object[]{3, 1, false}, new String[]{"java.lang.Integer", "java.lang.Integer", "java.lang.Boolean"});

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointEmptyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointEmptyTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointEmptyTest.java
index d22b591..50840c8 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointEmptyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointEmptyTest.java
@@ -33,7 +33,7 @@ public class ManagedBrowsableEndpointEmptyTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
 
         String out = (String) mbeanServer.invoke(name, "browseExchange", new Object[]{0}, new String[]{"java.lang.Integer"});
         assertNull(out);

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointTest.java
index 2ce562e..e14367a 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedBrowsableEndpointTest.java
@@ -41,7 +41,7 @@ public class ManagedBrowsableEndpointTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
         String uri = (String) mbeanServer.getAttribute(name, "EndpointUri");
         assertEquals("mock://result", uri);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCBRTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCBRTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCBRTest.java
index 3e3bcff..4003894 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCBRTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCBRTest.java
@@ -35,28 +35,28 @@ public class ManagedCBRTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=routes,name=\"route\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"task-a\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"task-a\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"choice\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"choice\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"task-b\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"task-b\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
         
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"task-c\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"task-c\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"task-d\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"task-d\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"task-e\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"task-e\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"task-done\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"task-done\"");
         assertTrue("MBean '" + on + "' not registered", mbeanServer.isRegistered(on));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextAutoStartupTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextAutoStartupTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextAutoStartupTest.java
index 4d216dc..232c165 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextAutoStartupTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextAutoStartupTest.java
@@ -34,8 +34,8 @@ public class ManagedCamelContextAutoStartupTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
-        ObjectName onRoute = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=routes,name=\"foo\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
+        ObjectName onRoute = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"foo\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpRoutesAsXmlTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpRoutesAsXmlTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpRoutesAsXmlTest.java
index 0a00fea..a50f954 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpRoutesAsXmlTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpRoutesAsXmlTest.java
@@ -34,7 +34,7 @@ public class ManagedCamelContextDumpRoutesAsXmlTest extends ManagementTestSuppor
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
 
         String xml = (String) mbeanServer.invoke(on, "dumpRoutesAsXml", null, null);
         assertNotNull(xml);

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpStatsAsXmlTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpStatsAsXmlTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpStatsAsXmlTest.java
index fbda944..1ebcdf9 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpStatsAsXmlTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextDumpStatsAsXmlTest.java
@@ -35,7 +35,7 @@ public class ManagedCamelContextDumpStatsAsXmlTest extends ManagementTestSupport
 
         // get the stats for the route
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
 
         getMockEndpoint("mock:foo").expectedMessageCount(1);
         getMockEndpoint("mock:bar").expectedMessageCount(2);

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextPropertiesTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextPropertiesTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextPropertiesTest.java
index f8de8d9..ff8a9d3 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextPropertiesTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextPropertiesTest.java
@@ -45,7 +45,7 @@ public class ManagedCamelContextPropertiesTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextRestartTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextRestartTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextRestartTest.java
index 7fd6930..2852cf7 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextRestartTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextRestartTest.java
@@ -66,7 +66,7 @@ public class ManagedCamelContextRestartTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendResumeTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendResumeTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendResumeTest.java
index ec0c0c1..56ca72a 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendResumeTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendResumeTest.java
@@ -35,7 +35,7 @@ public class ManagedCamelContextSuspendResumeTest extends ManagementTestSupport
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendStartTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendStartTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendStartTest.java
index 554494a..f64ab68 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendStartTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextSuspendStartTest.java
@@ -35,7 +35,7 @@ public class ManagedCamelContextSuspendStartTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java
index 309a378..ba41132 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java
@@ -47,7 +47,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");
@@ -111,7 +111,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\"");
 
         assertNull(context.hasEndpoint("seda:bar"));
 
@@ -121,7 +121,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport {
 
         assertNotNull(context.hasEndpoint("seda:bar"));
 
-        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=endpoints,name=\"seda://bar\"");
+        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=endpoints,name=\"seda://bar\"");
         boolean registered = mbeanServer.isRegistered(seda);
         assertTrue("Should be registered " + seda, registered);
 
@@ -141,7 +141,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\"");
 
         assertNull(context.hasEndpoint("seda:bar"));
 
@@ -151,7 +151,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport {
 
         assertNotNull(context.hasEndpoint("seda:bar"));
 
-        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=endpoints,name=\"seda://bar\"");
+        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=endpoints,name=\"seda://bar\"");
         boolean registered = mbeanServer.isRegistered(seda);
         assertTrue("Should be registered " + seda, registered);
 
@@ -180,7 +180,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java
index 462af11..8ea7d80 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java
@@ -38,8 +38,8 @@ public class ManagedCamelContextTracerTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName camel = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
-        ObjectName on = new ObjectName("org.apache.camel:context=localhost/camel-1,type=tracer,name=Tracer");
+        ObjectName camel = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=Tracer");
         mbeanServer.isRegistered(camel);
         mbeanServer.isRegistered(on);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextUpdateRoutesFromXmlTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextUpdateRoutesFromXmlTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextUpdateRoutesFromXmlTest.java
index c606500..18f58ff 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextUpdateRoutesFromXmlTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextUpdateRoutesFromXmlTest.java
@@ -59,7 +59,7 @@ public class ManagedCamelContextUpdateRoutesFromXmlTest extends ManagementTestSu
                 + "</route>"
                 + "</routes>";
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
         mbeanServer.invoke(on, "addOrUpdateRoutesFromXml", new Object[]{xml}, new String[]{"java.lang.String"});
 
         // there should be 2 routes now

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCanekContextExchangeStatisticsTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCanekContextExchangeStatisticsTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCanekContextExchangeStatisticsTest.java
index c280881..ae46524 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCanekContextExchangeStatisticsTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCanekContextExchangeStatisticsTest.java
@@ -34,15 +34,15 @@ public class ManagedCanekContextExchangeStatisticsTest extends ManagementTestSup
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
         Long completed = (Long) mbeanServer.getAttribute(on, "ExchangesCompleted");
         assertEquals(0, completed.longValue());
 
-        ObjectName route1 = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=routes,name=\"route1\"");
+        ObjectName route1 = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route1\"");
         Long completed1 = (Long) mbeanServer.getAttribute(route1, "ExchangesCompleted");
         assertEquals(0, completed1.longValue());
 
-        ObjectName route2 = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=routes,name=\"route2\"");
+        ObjectName route2 = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route2\"");
         Long completed2 = (Long) mbeanServer.getAttribute(route1, "ExchangesCompleted");
         assertEquals(0, completed2.longValue());
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomBeanTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomBeanTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCustomBeanTest.java
index 7185e61..c54de1a 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomBeanTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCustomBeanTest.java
@@ -38,7 +38,7 @@ public class ManagedCustomBeanTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"custom\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"custom\"");
 
         getMockEndpoint("mock:result").expectedMessageCount(1);
         getMockEndpoint("mock:result").expectedHeaderReceived("foo", "hey");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomPolicyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomPolicyTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCustomPolicyTest.java
index 6535a69..b224712 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomPolicyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCustomPolicyTest.java
@@ -52,13 +52,13 @@ public class ManagedCustomPolicyTest extends ManagementTestSupport {
         Set<ObjectName> set = mbeanServer.queryNames(new ObjectName("*:type=processors,*"), null);
         assertEquals(3, set.size());
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"foo\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"foo\"");
         assertTrue("Should be registered: foo",  mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"result\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"result\"");
         assertTrue("Should be registered: result",  mbeanServer.isRegistered(on));
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"bar\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"bar\"");
         assertTrue("Should be registered: bar",  mbeanServer.isRegistered(on));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
index ccb88af..4d6138e 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
@@ -38,7 +38,7 @@ public class ManagedCustomProcessorTest extends ManagementTestSupport {
         }
 
         MBeanServer mbeanServer = getMBeanServer();
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"custom\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"custom\"");
 
         getMockEndpoint("mock:result").expectedMessageCount(1);
         getMockEndpoint("mock:result").expectedHeaderReceived("foo", "hey");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
index d7c8172..db77717 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
@@ -42,10 +42,10 @@ public class ManagedDelayerTest extends ManagementTestSupport {
         MBeanServer mbeanServer = getMBeanServer();
 
         // get the object name for the delayer
-        ObjectName delayerName = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"mydelayer\"");
+        ObjectName delayerName = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"mydelayer\"");
 
         // use route to get the total time
-        ObjectName routeName = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=routes,name=\"route1\"");
+        ObjectName routeName = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route1\"");
         Long completed = (Long) mbeanServer.getAttribute(routeName, "ExchangesCompleted");
         assertEquals(1, completed.longValue());
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedDualCamelContextTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedDualCamelContextTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedDualCamelContextTest.java
index 43cce62..29c16a6 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedDualCamelContextTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedDualCamelContextTest.java
@@ -58,7 +58,7 @@ public class ManagedDualCamelContextTest extends TestSupport {
         assertIsInstanceOf(ManagedManagementStrategy.class, camel2.getManagementStrategy());
 
         MBeanServer mbeanServer1 = camel1.getManagementStrategy().getManagementAgent().getMBeanServer();
-        Set<ObjectName> set = mbeanServer1.queryNames(new ObjectName("*:context=localhost/camel-1,type=components,*"), null);
+        Set<ObjectName> set = mbeanServer1.queryNames(new ObjectName("*:context=camel-1,type=components,*"), null);
         assertEquals(2, set.size());
         ObjectName on = set.iterator().next();
         assertTrue("Should be registered", mbeanServer1.isRegistered(on));
@@ -68,7 +68,7 @@ public class ManagedDualCamelContextTest extends TestSupport {
         assertEquals("camel-1", id);
 
         MBeanServer mbeanServer2 = camel2.getManagementStrategy().getManagementAgent().getMBeanServer();
-        set = mbeanServer1.queryNames(new ObjectName("*:context=localhost/camel-2,type=components,*"), null);
+        set = mbeanServer1.queryNames(new ObjectName("*:context=camel-2,type=components,*"), null);
         assertEquals(2, set.size());
         on = set.iterator().next();
         assertTrue("Should be registered", mbeanServer2.isRegistered(on));

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointTest.java
index dd59fdd..b24889b 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointTest.java
@@ -35,10 +35,10 @@ public class ManagedEndpointTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"seda://test\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"seda://test\"");
         mbeanServer.isRegistered(on);
 
-        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
         mbeanServer.isRegistered(on);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedInterceptTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedInterceptTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedInterceptTest.java
index 6263e96..acbe510 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedInterceptTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedInterceptTest.java
@@ -41,15 +41,15 @@ public class ManagedInterceptTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://result\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
         Long queueSize = (Long) mbeanServer.invoke(name, "queueSize", null, null);
         assertEquals(1, queueSize.intValue());
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://intercept\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://intercept\"");
         queueSize = (Long) mbeanServer.invoke(name, "queueSize", null, null);
         assertEquals(2, queueSize.intValue());
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"log-foo\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"log-foo\"");
         mbeanServer.isRegistered(name);
         
         Long total = (Long) mbeanServer.getAttribute(name, "ExchangesTotal");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedLoadBalancerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedLoadBalancerTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedLoadBalancerTest.java
index 833058a..7df3aac 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedLoadBalancerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedLoadBalancerTest.java
@@ -43,15 +43,15 @@ public class ManagedLoadBalancerTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://a\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://a\"");
         Long queueSize = (Long) mbeanServer.invoke(name, "queueSize", null, null);
         assertEquals(2, queueSize.intValue());
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://b\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://b\"");
         queueSize = (Long) mbeanServer.invoke(name, "queueSize", null, null);
         assertEquals(1, queueSize.intValue());
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"myBalancer\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"myBalancer\"");
         mbeanServer.isRegistered(name);
         
         Long total = (Long) mbeanServer.getAttribute(name, "ExchangesTotal");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedLogEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedLogEndpointTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedLogEndpointTest.java
index 45db905..da621d8 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedLogEndpointTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedLogEndpointTest.java
@@ -43,7 +43,7 @@ public class ManagedLogEndpointTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"log-foo\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"log-foo\"");
         mbeanServer.isRegistered(name);
         
         Long total = (Long) mbeanServer.getAttribute(name, "ExchangesTotal");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedMulticastTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedMulticastTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedMulticastTest.java
index b650f52..cd6d174 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedMulticastTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedMulticastTest.java
@@ -43,15 +43,15 @@ public class ManagedMulticastTest extends ManagementTestSupport {
 
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://a\"");
+        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://a\"");
         Long queueSize = (Long) mbeanServer.invoke(name, "queueSize", null, null);
         assertEquals(3, queueSize.intValue());
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"mock://b\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://b\"");
         queueSize = (Long) mbeanServer.invoke(name, "queueSize", null, null);
         assertEquals(3, queueSize.intValue());
 
-        name = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=processors,name=\"myMulticast\"");
+        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"myMulticast\"");
         mbeanServer.isRegistered(name);
         
         Long total = (Long) mbeanServer.getAttribute(name, "ExchangesTotal");

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternFixedTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternFixedTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternFixedTest.java
index 19f14fd..f7db7c0 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternFixedTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternFixedTest.java
@@ -44,7 +44,7 @@ public class ManagedNamePatternFixedTest extends ManagementTestSupport {
 
         assertEquals("cool", context.getManagementName());
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/" + context.getManagementName() + ",type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=" + context.getManagementName() + ",type=context,name=\"camel-1\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternIncludeHostNameTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternIncludeHostNameTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternIncludeHostNameTest.java
new file mode 100644
index 0000000..70251b9
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternIncludeHostNameTest.java
@@ -0,0 +1,61 @@
+/**
+ * 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.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * @version 
+ */
+public class ManagedNamePatternIncludeHostNameTest extends ManagementTestSupport {
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+        context.getManagementStrategy().getManagementAgent().setIncludeHostName(true);
+        context.getManagementNameStrategy().setNamePattern("cool-#name#");
+        return context;
+    }
+
+    public void testManagedNamePattern() throws Exception {
+        // JMX tests dont work well on AIX CI servers (hangs them)
+        if (isPlatform("aix")) {
+            return;
+        }
+
+        MBeanServer mbeanServer = getMBeanServer();
+
+        assertTrue(context.getManagementName().startsWith("cool"));
+
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/" + context.getManagementName() + ",type=context,name=\"camel-1\"");
+        assertTrue("Should be registered", mbeanServer.isRegistered(on));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0e8aa70a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternTest.java
index 6b9ac52..4118e07 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedNamePatternTest.java
@@ -44,7 +44,7 @@ public class ManagedNamePatternTest extends ManagementTestSupport {
 
         assertTrue(context.getManagementName().startsWith("cool"));
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/" + context.getManagementName() + ",type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=" + context.getManagementName() + ",type=context,name=\"camel-1\"");
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
     }
 


Mime
View raw message