camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1464383 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: management/DefaultManagementLifecycleStrategy.java management/mbean/ManagedRoute.java model/ProcessorDefinition.java
Date Thu, 04 Apr 2013 09:17:28 GMT
Author: davsclaus
Date: Thu Apr  4 09:17:27 2013
New Revision: 1464383

URL: http://svn.apache.org/r1464383
Log:
CAMEL-6239: Added index to processor defs so we know the order they were created / positioned
in routes etc. Exposes that for JMX so karaf camel command can leverage that.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java?rev=1464383&r1=1464382&r2=1464383&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
Thu Apr  4 09:17:27 2013
@@ -25,7 +25,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.atomic.AtomicLong;
 import javax.management.JMException;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -101,8 +100,6 @@ import org.slf4j.LoggerFactory;
 public class DefaultManagementLifecycleStrategy extends ServiceSupport implements LifecycleStrategy,
CamelContextAware {
 
     private static final Logger LOG = LoggerFactory.getLogger(DefaultManagementLifecycleStrategy.class);
-    // unique counter we use when registering a new mbean which allows to know the order
they were registered
-    private final AtomicLong counter = new AtomicLong();
     // the wrapped processors is for performance counters, which are in use for the created
routes
     // when a route is removed, we should remove the associated processors from this map
     private final Map<Processor, KeyValueHolder<ProcessorDefinition<?>, InstrumentationProcessor>>
wrappedProcessors =

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java?rev=1464383&r1=1464382&r2=1464383&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
Thu Apr  4 09:17:27 2013
@@ -271,7 +271,7 @@ public class ManagedRoute extends Manage
     /**
      * Used for sorting the processor mbeans accordingly to their index.
      */
-    private final static class OrderProcessorMBeans implements Comparator<ManagedProcessorMBean>
{
+    private static final class OrderProcessorMBeans implements Comparator<ManagedProcessorMBean>
{
 
         @Override
         public int compare(ManagedProcessorMBean o1, ManagedProcessorMBean o2) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=1464383&r1=1464382&r2=1464383&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java Thu
Apr  4 09:17:27 2013
@@ -79,15 +79,15 @@ import org.slf4j.LoggerFactory;
  */
 @XmlAccessorType(XmlAccessType.PROPERTY)
 public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type>>
extends OptionalIdentifiedDefinition<Type> implements Block {
+    private static final AtomicInteger COUNTER = new AtomicInteger();
     protected final transient Logger log = LoggerFactory.getLogger(getClass());
+
     protected Boolean inheritErrorHandler;
     private final LinkedList<Block> blocks = new LinkedList<Block>();
     private ProcessorDefinition<?> parent;
     private final List<InterceptStrategy> interceptStrategies = new ArrayList<InterceptStrategy>();
-
     // use xs:any to support optional property placeholders
     private Map<QName, Object> otherAttributes;
-    private static final AtomicInteger COUNTER = new AtomicInteger();
     private final int index;
 
     protected ProcessorDefinition() {
@@ -100,7 +100,7 @@ public abstract class ProcessorDefinitio
      * <p/>
      * This can be used to know the order in which the definition was created when assembled
as a route.
      *
-     * @return the current COUNTER value
+     * @return the index number
      */
     @XmlTransient // do not expose this in the XML DSL
     public int getIndex() {



Mime
View raw message