This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.21.x by this push:
     new 818cc2d  CAMEL-13093 (#2724)
818cc2d is described below

commit 818cc2dd1bc03e0bac4ef3658b29360b4b511541
Author: 1984shekhar <chandrashekharpan...@hotmail.com>
AuthorDate: Tue Jan 22 01:02:33 2019 +0530

    CAMEL-13093 (#2724)
    
    * karaf route-profile command improvement
    
    * CAMEL-13093: karaf route-profile command improvement
---
 .../apache/camel/commands/AbstractLocalCamelController.java  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
 
b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
index 8db31cf..6adb5a1 100644
--- 
a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
+++ 
b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
@@ -390,13 +390,11 @@ public abstract class AbstractLocalCamelController 
extends AbstractCamelControll
         ManagementAgent agent = 
context.getManagementStrategy().getManagementAgent();
         if (agent != null) {
             MBeanServer mBeanServer = agent.getMBeanServer();
-            Set<ObjectName> set = mBeanServer.queryNames(new 
ObjectName(agent.getMBeanObjectDomainName() + ":type=routes,name=\"" + routeId 
+ "\",*"), null);
-            Iterator<ObjectName> iterator = set.iterator();
-            if (iterator.hasNext()) {
-                ObjectName routeMBean = iterator.next();
-
-                // the route must be part of the camel context
-                String camelId = (String) mBeanServer.getAttribute(routeMBean, 
"CamelId");
+            Set<ObjectName> set = mBeanServer.queryNames(new 
ObjectName(agent.getMBeanObjectDomainName() + ":type=routes,name=\"" + routeId 
+ "\",*"), null);            
+            for (ObjectName routeMBean : set) {
+               
+               // the route must be part of the camel context
+               String camelId = (String) mBeanServer.getAttribute(routeMBean, 
"CamelId");
                 if (camelId != null && camelId.equals(camelContextName)) {
                     String xml = (String) mBeanServer.invoke(routeMBean, 
"dumpRouteStatsAsXml", new Object[]{fullStats, includeProcessors}, new 
String[]{"boolean", "boolean"});
                     return xml;

Reply via email to