james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1308278 - /james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/jmx/JMXStateMailetProcessorListener.java
Date Mon, 02 Apr 2012 09:59:03 GMT
Author: eric
Date: Mon Apr  2 09:59:02 2012
New Revision: 1308278

URL: http://svn.apache.org/viewvc?rev=1308278&view=rev
Log:
Nest level counting for matcher mbean name - Patch provided by TzeKai Lee (JAMES-1397)

Modified:
    james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/jmx/JMXStateMailetProcessorListener.java

Modified: james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/jmx/JMXStateMailetProcessorListener.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/jmx/JMXStateMailetProcessorListener.java?rev=1308278&r1=1308277&r2=1308278&view=diff
==============================================================================
--- james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/jmx/JMXStateMailetProcessorListener.java
(original)
+++ james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/jmx/JMXStateMailetProcessorListener.java
Mon Apr  2 09:59:02 2012
@@ -138,22 +138,20 @@ public class JMXStateMailetProcessorList
      */
     @SuppressWarnings("unchecked")
     private void registerMatchers(String parentMBeanName, Iterator<Matcher> matchers,
int nestingLevel) throws MalformedObjectNameException, JMException {
-        // current level
-        int currentLevel = nestingLevel;
         int i = 0;
 
         while (matchers.hasNext()) {
             Matcher matcher = matchers.next();
             MatcherManagement matcherManagement = new MatcherManagement(matcher.getMatcherConfig());
 
-            String matcherMBeanName = parentMBeanName + ",subtype" + currentLevel + "=matcher,index"
+ currentLevel + "=" + (i++) + ",matchername" + currentLevel + "=" + matcherManagement.getMatcherName();
+            String matcherMBeanName = parentMBeanName + ",subtype" + nestingLevel + "=matcher,index"
+ nestingLevel + "=" + (i++) + ",matchername" + nestingLevel + "=" + matcherManagement.getMatcherName();
             registerMBean(matcherMBeanName, matcherManagement);
             matcherMap.put(matcher, matcherManagement);
             // Handle CompositeMatcher which were added by JAMES-948
             if (matcher instanceof CompositeMatcher) {
                 // we increment the nesting as we have one more child level and
                 // register the child matchers
-                registerMatchers(matcherMBeanName, ((CompositeMatcher) matcher).iterator(),
++nestingLevel);
+                registerMatchers(matcherMBeanName, ((CompositeMatcher) matcher).iterator(),
nestingLevel + 1);
             }
 
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message