You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2010/10/14 18:22:08 UTC

svn commit: r1022598 - in /james/server/trunk: mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/camel/ mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/ spring-deployment/src/main/config/james/

Author: norman
Date: Thu Oct 14 16:22:08 2010
New Revision: 1022598

URL: http://svn.apache.org/viewvc?rev=1022598&view=rev
Log:
Make jmx optional in CamelMailProcessorList by move it to extra class (JAMES-1057)

Added:
    james/server/trunk/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/ProcessorManagement.java
Modified:
    james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/camel/CamelMailProcessorList.java
    james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml

Modified: james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/camel/CamelMailProcessorList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/camel/CamelMailProcessorList.java?rev=1022598&r1=1022597&r2=1022598&view=diff
==============================================================================
--- james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/camel/CamelMailProcessorList.java (original)
+++ james/server/trunk/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/camel/CamelMailProcessorList.java Thu Oct 14 16:22:08 2010
@@ -29,9 +29,6 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
 import javax.mail.MessagingException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
@@ -94,7 +91,6 @@ public class CamelMailProcessorList impl
 
     private ProducerTemplate producerTemplate;
 	private CamelContext camelContext;
-	private MBeanServer mbeanserver;
     
 
 
@@ -103,16 +99,8 @@ public class CamelMailProcessorList impl
         getCamelContext().addRoutes(new SpoolRouteBuilder());
         producerTemplate = getCamelContext().createProducerTemplate();
 
-        registerMBeans();
-
     }
 
-    @Resource(name = "mbeanserver")
-    public void setMbeanServer(MBeanServer mbeanServer) {
-        this.mbeanserver = mbeanServer;
-    }
-	
-	
     /**
      * Destroy all mailets and matchers
      */
@@ -325,209 +313,149 @@ public class CamelMailProcessorList impl
         this.camelContext = camelContext;
     }
 
-    
-    private void registerMBeans() {
-       
-        String baseObjectName = "org.apache.james:type=component,name=processor,";
-
-        String[] processorNames = getProcessorNames();
-        for (int i = 0; i < processorNames.length; i++) {
-            String processorName = processorNames[i];
-            createProcessorMBean(baseObjectName, processorName, mbeanserver);
-            continue;
-        }
-    }
-
-    private void createProcessorMBean(String baseObjectName, String processorName, MBeanServer mBeanServer) {
-        String processorMBeanName = baseObjectName + "processor=" + processorName;
-        registerMBean(mBeanServer, processorMBeanName, getProcessor(processorName));
-
-
-        // add all mailets but the last, because that is a terminator (see LinearProcessor.closeProcessorLists())
-        List<Mailet> mailets =  ((MailetContainer) getProcessor(processorName)).getMailets();
-        for (int i = 0; i < mailets.size(); i++) {
-            MailetManagement mailet = (MailetManagement) mailets.get(i);
-
-            String mailetMBeanName = processorMBeanName + ",subtype=mailet,index=" + (i+1) + ",mailetname=" + mailet.getMailetName();
-            registerMBean(mBeanServer, mailetMBeanName, mailet);
-        }
-
-       
-        
-        // add all matchers but the last, because that is a terminator (see LinearProcessor.closeProcessorLists())
-        List<Matcher> matchers =  ((MailetContainer)getProcessor(processorName)).getMatchers();
-        for (int i = 0; i < matchers.size(); i++) {
-            MatcherManagement matcher = (MatcherManagement) matchers.get(i);
-
-            String matcherMBeanName = processorMBeanName + ",subtype=matcher,index=" + (i+1) + ",matchername=" + matcher.getMatcherName();
+  
+    private final class SpoolRouteBuilder extends RouteBuilder {
+        /*
+         * (non-Javadoc)
+         * @see org.apache.camel.builder.RouteBuilder#configure()
+         */
+        @SuppressWarnings("unchecked")
+        @Override
+        public void configure() throws Exception {
+            Processor terminatingMailetProcessor = new MailetProcessor(new TerminatingMailet(), logger);
+            Processor disposeProcessor = new DisposeProcessor();
+            Processor mailProcessor = new MailCamelProcessor();
+            Processor removePropsProcessor = new RemovePropertiesProcessor();
+            
+            List<HierarchicalConfiguration> processorConfs = config.configurationsAt("processor");
+            for (int i = 0; i < processorConfs.size(); i++) {
+                final HierarchicalConfiguration processorConf = processorConfs.get(i);
+                String processorName = processorConf.getString("[@name]");
 
-            registerMBean(mBeanServer, matcherMBeanName, matcher);
-        }
-       
+                
+                mailets.put(processorName, new ArrayList<MailetManagement>());
+                matchers.put(processorName, new ArrayList<MatcherManagement>());
 
-    }
+                RouteDefinition processorDef = from(getEndpoint(processorName)).inOnly()
+            // store the logger in properties
+                .setProperty(MatcherSplitter.LOGGER_PROPERTY, constant(logger));   
+
+                final List<HierarchicalConfiguration> mailetConfs = processorConf.configurationsAt("mailet");
+                // Loop through the mailet configuration, load
+                // all of the matcher and mailets, and add
+                // them to the processor.
+                for (int j = 0; j < mailetConfs.size(); j++) {
+                    HierarchicalConfiguration c = mailetConfs.get(j);
+
+                    // We need to set this because of correctly parsing comma
+                    String mailetClassName = c.getString("[@class]");
+                    String matcherName = c.getString("[@match]", null);
+                    String invertedMatcherName = c.getString("[@notmatch]", null);
+                
+                    Mailet mailet = null;
+                    Matcher matcher = null;
+                    try {
+
+                        if (matcherName != null && invertedMatcherName != null) {
+                            // if no matcher is configured throw an Exception
+                            throw new ConfigurationException("Please configure only match or nomatch per mailet");
+                        } else if (matcherName != null) {
+                            matcher = matcherLoader.getMatcher(matcherName);
+                        } else if (invertedMatcherName != null) {
+                            matcher = new MatcherInverter(matcherLoader.getMatcher(invertedMatcherName));
+
+                        } else {
+                            // default matcher is All
+                            matcher = matcherLoader.getMatcher("All");
+                        }
+
+                        // The matcher itself should log that it's been inited.
+                        if (logger.isInfoEnabled()) {
+                            StringBuffer infoBuffer = new StringBuffer(64).append("Matcher ").append(matcherName).append(" instantiated.");
+                            logger.info(infoBuffer.toString());
+                        }
+                    } catch (MessagingException ex) {
+                        // **** Do better job printing out exception
+                        if (logger.isErrorEnabled()) {
+                            StringBuffer errorBuffer = new StringBuffer(256).append("Unable to init matcher ").append(matcherName).append(": ").append(ex.toString());
+                            logger.error(errorBuffer.toString(), ex);
+                            if (ex.getNextException() != null) {
+                                logger.error("Caused by nested exception: ", ex.getNextException());
+                            }
+                        }
+                        System.err.println("Unable to init matcher " + matcherName);
+                        System.err.println("Check spool manager logs for more details.");
+                        // System.exit(1);
+                        throw new ConfigurationException("Unable to init matcher", ex);
+                    }
+                    try {
+                        mailet = mailetLoader.getMailet(mailetClassName, c);
+                        if (logger.isInfoEnabled()) {
+                            StringBuffer infoBuffer = new StringBuffer(64).append("Mailet ").append(mailetClassName).append(" instantiated.");
+                            logger.info(infoBuffer.toString());
+                        }
+                    } catch (MessagingException ex) {
+                        // **** Do better job printing out exception
+                        if (logger.isErrorEnabled()) {
+                            StringBuffer errorBuffer = new StringBuffer(256).append("Unable to init mailet ").append(mailetClassName).append(": ").append(ex.toString());
+                            logger.error(errorBuffer.toString(), ex);
+                            if (ex.getNextException() != null) {
+                                logger.error("Caused by nested exception: ", ex.getNextException());
+                            }
+                        }
+                        System.err.println("Unable to init mailet " + mailetClassName);
+                        System.err.println("Check spool manager logs for more details.");
+                        throw new ConfigurationException("Unable to init mailet", ex);
+                    }
+                    if (mailet != null && matcher != null) {
+                        MailetManagement wrappedMailet = new MailetManagement(mailet);
+                        MatcherManagement wrappedMatcher = new MatcherManagement(matcher);
+                        String onMatchException = null;
+                        MailetConfig mailetConfig = wrappedMailet.getMailetConfig();
+                    
+                        if (mailetConfig instanceof MailetConfigImpl) {
+                            onMatchException = ((MailetConfigImpl) mailetConfig).getInitAttribute("onMatchException");
+                        }
+                    
+                        MailetProcessor mailetProccessor = new MailetProcessor(wrappedMailet, logger);
+                        // Store the matcher to use for splitter in properties
+                        processorDef
+                            .setProperty(MatcherSplitter.MATCHER_PROPERTY, constant(wrappedMatcher)).setProperty(MatcherSplitter.ON_MATCH_EXCEPTION_PROPERTY, constant(onMatchException))
+                            
+                            // do splitting of the mail based on the stored matcher
+                            .split().method(MatcherSplitter.class).aggregationStrategy(aggr).parallelProcessing()
+                            .choice().when(new MatcherMatch()).process(mailetProccessor).end()
+                            
+                            .choice().when(new MailStateEquals(Mail.GHOST)).process(disposeProcessor).stop().otherwise().process(removePropsProcessor).end()
+
+                            .choice().when(new MailStateNotEquals(processorName)).process(mailProcessor).stop().end();
+
+                        // store mailet and matcher
+                        mailets.get(processorName).add(wrappedMailet);
+                        matchers.get(processorName).add(wrappedMatcher);
+                    }
+              
 
-    private void registerMBean(MBeanServer mBeanServer, String mBeanName, Object object) {
-        ObjectName objectName = null;
-        try {
-            objectName = new ObjectName(mBeanName);
-        } catch (MalformedObjectNameException e) {
-        	logger.info("Unable to register mbean", e);
-
-            return;
-        }
-        try {
-            mBeanServer.registerMBean(object, objectName);
-        } catch (javax.management.JMException e) {
-            logger.error("Unable to register mbean", e);
+                }
+                
+                processorDef
+                // start choice
+                    .choice()
+                 
+                    // when the mail state did not change till yet ( the end of the route) we need to call the TerminatingMailet to
+                    // make sure we don't fall into a endless loop
+                    .when(new MailStateEquals(processorName)).process(terminatingMailetProcessor).stop()
+                    
+                       
+                    // dispose when needed
+                    .when(new MailStateEquals(Mail.GHOST)).process(disposeProcessor).stop()
+                    
+                     // route it to the next processor
+                    .otherwise().process(mailProcessor).stop();
+                  
+                processors.put(processorName, new ProcessorDetail(processorName,new ChildProcessor(processorName)));
+            }
+                
         }
     }
-
-    
-	private final class SpoolRouteBuilder extends RouteBuilder {
-		/*
-	     * (non-Javadoc)
-	     * @see org.apache.camel.builder.RouteBuilder#configure()
-	     */
-	    @SuppressWarnings("unchecked")
-	    @Override
-	    public void configure() throws Exception {
-	        Processor terminatingMailetProcessor = new MailetProcessor(new TerminatingMailet(), logger);
-	        Processor disposeProcessor = new DisposeProcessor();
-	        Processor mailProcessor = new MailCamelProcessor();
-	        Processor removePropsProcessor = new RemovePropertiesProcessor();
-	        
-	        List<HierarchicalConfiguration> processorConfs = config.configurationsAt("processor");
-	        for (int i = 0; i < processorConfs.size(); i++) {
-	            final HierarchicalConfiguration processorConf = processorConfs.get(i);
-	            String processorName = processorConf.getString("[@name]");
-
-	          
-	            mailets.put(processorName, new ArrayList<MailetManagement>());
-	            matchers.put(processorName, new ArrayList<MatcherManagement>());
-
-	            RouteDefinition processorDef = from(getEndpoint(processorName)).inOnly()
-	            // store the logger in properties
-	            .setProperty(MatcherSplitter.LOGGER_PROPERTY, constant(logger));   
-	               
-	            
-	            final List<HierarchicalConfiguration> mailetConfs = processorConf.configurationsAt("mailet");
-	            // Loop through the mailet configuration, load
-	            // all of the matcher and mailets, and add
-	            // them to the processor.
-	            for (int j = 0; j < mailetConfs.size(); j++) {
-	                HierarchicalConfiguration c = mailetConfs.get(j);
-
-	                // We need to set this because of correctly parsing comma
-	                String mailetClassName = c.getString("[@class]");
-	                String matcherName = c.getString("[@match]", null);
-	                String invertedMatcherName = c.getString("[@notmatch]", null);
-
-	                Mailet mailet = null;
-	                Matcher matcher = null;
-	                try {
-
-	                    if (matcherName != null && invertedMatcherName != null) {
-	                        // if no matcher is configured throw an Exception
-	                        throw new ConfigurationException("Please configure only match or nomatch per mailet");
-	                    } else if (matcherName != null) {
-	                        matcher = matcherLoader.getMatcher(matcherName);
-	                    } else if (invertedMatcherName != null) {
-	                        matcher = new MatcherInverter(matcherLoader.getMatcher(invertedMatcherName));
-
-	                    } else {
-	                        // default matcher is All
-	                        matcher = matcherLoader.getMatcher("All");
-	                    }
-
-	                    // The matcher itself should log that it's been inited.
-	                    if (logger.isInfoEnabled()) {
-	                        StringBuffer infoBuffer = new StringBuffer(64).append("Matcher ").append(matcherName).append(" instantiated.");
-	                        logger.info(infoBuffer.toString());
-	                    }
-	                } catch (MessagingException ex) {
-	                    // **** Do better job printing out exception
-	                    if (logger.isErrorEnabled()) {
-	                        StringBuffer errorBuffer = new StringBuffer(256).append("Unable to init matcher ").append(matcherName).append(": ").append(ex.toString());
-	                        logger.error(errorBuffer.toString(), ex);
-	                        if (ex.getNextException() != null) {
-	                            logger.error("Caused by nested exception: ", ex.getNextException());
-	                        }
-	                    }
-	                    System.err.println("Unable to init matcher " + matcherName);
-	                    System.err.println("Check spool manager logs for more details.");
-	                    // System.exit(1);
-	                    throw new ConfigurationException("Unable to init matcher", ex);
-	                }
-	                try {
-	                    mailet = mailetLoader.getMailet(mailetClassName, c);
-	                    if (logger.isInfoEnabled()) {
-	                        StringBuffer infoBuffer = new StringBuffer(64).append("Mailet ").append(mailetClassName).append(" instantiated.");
-	                        logger.info(infoBuffer.toString());
-	                    }
-	                } catch (MessagingException ex) {
-	                    // **** Do better job printing out exception
-	                    if (logger.isErrorEnabled()) {
-	                        StringBuffer errorBuffer = new StringBuffer(256).append("Unable to init mailet ").append(mailetClassName).append(": ").append(ex.toString());
-	                        logger.error(errorBuffer.toString(), ex);
-	                        if (ex.getNextException() != null) {
-	                            logger.error("Caused by nested exception: ", ex.getNextException());
-	                        }
-	                    }
-	                    System.err.println("Unable to init mailet " + mailetClassName);
-	                    System.err.println("Check spool manager logs for more details.");
-	                    throw new ConfigurationException("Unable to init mailet", ex);
-	                }
-	                if (mailet != null && matcher != null) {
-	                    MailetManagement wrappedMailet = new MailetManagement(mailet);
-	                    MatcherManagement wrappedMatcher = new MatcherManagement(matcher);
-	                    String onMatchException = null;
-	                    MailetConfig mailetConfig = wrappedMailet.getMailetConfig();
-	                    
-	                    if (mailetConfig instanceof MailetConfigImpl) {
-	                        onMatchException = ((MailetConfigImpl) mailetConfig).getInitAttribute("onMatchException");
-	                    }
-	                    
-	                    MailetProcessor mailetProccessor = new MailetProcessor(wrappedMailet, logger);
-	                    // Store the matcher to use for splitter in properties
-	                    processorDef
-	                            .setProperty(MatcherSplitter.MATCHER_PROPERTY, constant(wrappedMatcher)).setProperty(MatcherSplitter.ON_MATCH_EXCEPTION_PROPERTY, constant(onMatchException))
-	                            
-	                            // do splitting of the mail based on the stored matcher
-	                            .split().method(MatcherSplitter.class).aggregationStrategy(aggr).parallelProcessing()
-
-	                            .choice().when(new MatcherMatch()).process(mailetProccessor).end()
-	                            
-	                            .choice().when(new MailStateEquals(Mail.GHOST)).process(disposeProcessor).stop().otherwise().process(removePropsProcessor).end()
-
-	                            .choice().when(new MailStateNotEquals(processorName)).process(mailProcessor).stop().end();
-
-	                    // store mailet and matcher
-	                    mailets.get(processorName).add(wrappedMailet);
-	                    matchers.get(processorName).add(wrappedMatcher);
-	                }
-	              
-
-	            }
-	            
-	            processorDef
-	                    // start choice
-	                    .choice()
-	                 
-	                    // when the mail state did not change till yet ( the end of the route) we need to call the TerminatingMailet to
-	                    // make sure we don't fall into a endless loop
-	                    .when(new MailStateEquals(processorName)).process(terminatingMailetProcessor).stop()
-	                    
-	                       
-	                    // dispose when needed
-	                    .when(new MailStateEquals(Mail.GHOST)).process(disposeProcessor).stop()
-	                    
-	                     // route it to the next processor
-	                    .otherwise().process(mailProcessor).stop();
-	                  
-	            processors.put(processorName, new ProcessorDetail(processorName,new ChildProcessor(processorName)));
-	        }
-	                
-	    }
-	}
 }

Added: james/server/trunk/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/ProcessorManagement.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/ProcessorManagement.java?rev=1022598&view=auto
==============================================================================
--- james/server/trunk/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/ProcessorManagement.java (added)
+++ james/server/trunk/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/ProcessorManagement.java Thu Oct 14 16:22:08 2010
@@ -0,0 +1,170 @@
+/****************************************************************
+ * 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.james.mailetcontainer;
+
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.james.lifecycle.LogEnabled;
+import org.apache.mailet.Mailet;
+import org.apache.mailet.Matcher;
+
+/**
+ * Expose JMX functions for {@link MailProcessorList} implementations
+ * 
+ *
+ */
+public class ProcessorManagement implements ProcessorManagementMBean, LogEnabled{
+
+    private MailProcessorList mailProcessor;
+    private MBeanServer mbeanserver;
+    private Log logger;
+
+    @Resource(name="mailProcessor")
+    public void setMailProcessorList(MailProcessorList mailProcessor) {
+        this.mailProcessor = mailProcessor;
+    }
+    
+
+    @Resource(name = "mbeanserver")
+    public void setMbeanServer(MBeanServer mbeanServer) {
+        this.mbeanserver = mbeanServer;
+    }
+   
+    @PostConstruct
+    public void init() throws Exception {
+        registerMBeans();
+
+    }
+    
+    
+    private void registerMBeans() {
+       
+        String baseObjectName = "org.apache.james:type=component,name=processor,";
+
+        String[] processorNames = getProcessorNames();
+        for (int i = 0; i < processorNames.length; i++) {
+            String processorName = processorNames[i];
+            createProcessorMBean(baseObjectName, processorName, mbeanserver);
+            continue;
+        }
+    }
+
+    private void createProcessorMBean(String baseObjectName, String processorName, MBeanServer mBeanServer) {
+        String processorMBeanName = baseObjectName + "processor=" + processorName;
+        
+        MailProcessor processor = mailProcessor.getProcessor(processorName);
+        ProcessorDetail processorDetail;
+        
+        // check if the processor is an instance of ProcessorDetail. If not create a wrapper around it. This will give us not all
+        // statistics but at least a few of them
+        if (processor instanceof ProcessorDetail) {
+            processorDetail = (ProcessorDetail) processor;
+        } else {
+            processorDetail = new ProcessorDetail(processorName, processor);
+        }
+        registerMBean(mBeanServer, processorMBeanName, processorDetail);
+
+
+        // check if the processor holds Mailets and Matchers
+        if (processor instanceof MailetContainer) {
+            MailetContainer container = (MailetContainer) processor;
+            List<Mailet> mailets =  container.getMailets();
+         
+            for (int i = 0; i < mailets.size(); i++) {
+                MailetManagement mailetManagement;
+
+                Mailet mailet = mailets.get(i);
+                
+                // check if the mailet is an instance of MailetManagement. If not create a wrapper around it. This will give us not all
+                // statistics but at least a few of them
+                if (mailet instanceof MailetManagement) {
+                    mailetManagement = (MailetManagement) mailet;
+                } else {
+                    mailetManagement = new MailetManagement(mailet);
+                }
+                String mailetMBeanName = processorMBeanName + ",subtype=mailet,index=" + (i+1) + ",mailetname=" + mailetManagement.getMailetName();
+                registerMBean(mBeanServer, mailetMBeanName, mailetManagement);
+            }
+
+            List<Matcher> matchers =  container.getMatchers();
+            for (int i = 0; i < matchers.size(); i++) {
+                MatcherManagement matcherManagement;
+                Matcher matcher = matchers.get(i);
+                
+                // check if the matcher is an instance of MatcherManagement. If not create a wrapper around it. This will give us not all
+                // statistics but at least a few of them
+                if (matcher instanceof MatcherManagement) {
+                   matcherManagement = (MatcherManagement) matcher;
+                } else {
+                    matcherManagement = new MatcherManagement(matcher);
+                }
+
+                String matcherMBeanName = processorMBeanName + ",subtype=matcher,index=" + (i+1) + ",matchername=" + matcherManagement.getMatcherName();
+
+                registerMBean(mBeanServer, matcherMBeanName, matcherManagement);
+            }
+           
+        }
+       
+
+    }
+
+    private void registerMBean(MBeanServer mBeanServer, String mBeanName, Object object) {
+        ObjectName objectName = null;
+        try {
+            objectName = new ObjectName(mBeanName);
+        } catch (MalformedObjectNameException e) {
+            logger.info("Unable to register mbean", e);
+
+            return;
+        }
+        try {
+            mBeanServer.registerMBean(object, objectName);
+        } catch (javax.management.JMException e) {
+            logger.error("Unable to register mbean", e);
+        }
+    }
+
+    
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.james.mailetcontainer.ProcessorManagementMBean#getProcessorNames()
+     */
+    public String[] getProcessorNames() {
+        return mailProcessor.getProcessorNames();
+    }
+
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.james.lifecycle.LogEnabled#setLog(org.apache.commons.logging.Log)
+     */
+    public void setLog(Log logger) {
+        this.logger = logger;
+    }
+
+}

Modified: james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml?rev=1022598&r1=1022597&r2=1022598&view=diff
==============================================================================
--- james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml (original)
+++ james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml Thu Oct 14 16:22:08 2010
@@ -43,7 +43,7 @@
           <entry key="org.apache.james:type=server,name=remotemanager" value-ref="remotemanager"/>
           <entry key="org.apache.james:type=component,name=domainlist" value-ref="domainlist"/>
           <entry key="org.apache.james:type=component,name=dnsservice" value-ref="dnsservice"/>
-          <entry key="org.apache.james:type=component,name=processor" value-ref="mailProcessor"/>
+          <entry key="org.apache.james:type=component,name=processor" value-ref="processormanagement"/>
 
         </map>
       </property>
@@ -66,6 +66,8 @@
         <property name="objectName" value="connector:name=rmi" /> 
         <property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jamesmailserver" />
     </bean>
+    
+    <bean id="processormanagement" class="org.apache.james.mailetcontainer.ProcessorManagement"/>
     -->
 
     <bean class="org.apache.james.container.spring.lifecycle.CommonsConfigurableBeanPostProcessor">
@@ -170,7 +172,6 @@
 
     <bean id="spoolmanager" class="org.apache.james.transport.JamesSpoolManager"/>
     
-    
     <!-- mailserver implementation which use activemq for spooling the mail -->
     <bean id="mailserver" class="org.apache.james.JamesMailServer"/>
 
@@ -268,6 +269,8 @@
     <bean id="domainlist" name="domainlistmanagement" class="org.apache.james.domain.JDBCDomainList"/>
     -->
 
+
+
     <!-- IMAP server Beans -->
     <bean id="imapserver" class="org.apache.james.imapserver.netty.NioImapServer">
         <property name="imapDecoder" ref="imapDecoder"/>



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