james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1051579 - in /james/server/trunk: mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/ mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/jmx/ mailetcontainer-library/src/main/java/org/apache/james/ma...
Date Tue, 21 Dec 2010 17:43:20 GMT
Author: norman
Date: Tue Dec 21 17:43:19 2010
New Revision: 1051579

URL: http://svn.apache.org/viewvc?rev=1051579&view=rev
Log:
Remove MailSpooler interface is it has no real meaning and add some license headers

Removed:
    james/server/trunk/mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/MailSpooler.java
Modified:
    james/server/trunk/mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/jmx/MailSpoolerMBean.java
    james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/AbstractMailProcessorList.java
    james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/JamesMailSpooler.java

Modified: james/server/trunk/mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/jmx/MailSpoolerMBean.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/jmx/MailSpoolerMBean.java?rev=1051579&r1=1051578&r2=1051579&view=diff
==============================================================================
--- james/server/trunk/mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/jmx/MailSpoolerMBean.java
(original)
+++ james/server/trunk/mailetcontainer-api/src/main/java/org/apache/james/mailetcontainer/api/jmx/MailSpoolerMBean.java
Tue Dec 21 17:43:19 2010
@@ -39,11 +39,4 @@ public interface MailSpoolerMBean {
     public int getCurrentSpoolCount();
     
 
-    /**
-     * Return all processor names
-     * 
-     * @return pNames
-     */
-    public String[] getProcessorNames();
-
 }

Modified: james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/AbstractMailProcessorList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/AbstractMailProcessorList.java?rev=1051579&r1=1051578&r2=1051579&view=diff
==============================================================================
--- james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/AbstractMailProcessorList.java
(original)
+++ james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/AbstractMailProcessorList.java
Tue Dec 21 17:43:19 2010
@@ -1,3 +1,21 @@
+/****************************************************************
+ * 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.lib;
 
 import java.util.ArrayList;
@@ -81,10 +99,9 @@ public abstract class AbstractMailProces
     }
 
     
-    
-    /*
-     * (non-Javadoc)
-     * @see org.apache.james.mailetcontainer.api.MailProcessor#service(org.apache.mailet.Mail)
+
+    /**
+     * Service the given {@link Mail} by hand the {@link Mail} over the {@link MailProcessor}
which is responsible for the {@link Mail#getState()}
      */
     public void service(Mail mail) throws MessagingException {
         long start = System.currentTimeMillis();

Modified: james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/JamesMailSpooler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/JamesMailSpooler.java?rev=1051579&r1=1051578&r2=1051579&view=diff
==============================================================================
--- james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/JamesMailSpooler.java
(original)
+++ james/server/trunk/mailetcontainer-library/src/main/java/org/apache/james/mailetcontainer/lib/JamesMailSpooler.java
Tue Dec 21 17:43:19 2010
@@ -21,9 +21,7 @@
 
 package org.apache.james.mailetcontainer.lib;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -38,16 +36,11 @@ import org.apache.james.lifecycle.api.Co
 import org.apache.james.lifecycle.api.LifecycleUtil;
 import org.apache.james.lifecycle.api.LogEnabled;
 import org.apache.james.mailetcontainer.api.MailProcessor;
-import org.apache.james.mailetcontainer.api.MailProcessorList;
-import org.apache.james.mailetcontainer.api.MailSpooler;
-import org.apache.james.mailetcontainer.api.MailetContainer;
 import org.apache.james.mailetcontainer.api.jmx.MailSpoolerMBean;
 import org.apache.james.queue.api.MailQueue;
-import org.apache.james.queue.api.MailQueueFactory;
 import org.apache.james.queue.api.MailQueue.MailQueueItem;
+import org.apache.james.queue.api.MailQueueFactory;
 import org.apache.mailet.Mail;
-import org.apache.mailet.Mailet;
-import org.apache.mailet.Matcher;
 
 /**
  * Manages the mail spool.  This class is responsible for retrieving
@@ -59,7 +52,7 @@ import org.apache.mailet.Matcher;
  * 
  * TODO: We should better use a ExecutorService here and only spawn a new Thread if needed
  */
-public class JamesMailSpooler implements Runnable, MailSpooler, Configurable, LogEnabled,
MailSpoolerMBean {
+public class JamesMailSpooler implements Runnable, Configurable, LogEnabled, MailSpoolerMBean
{
 
     
     private MailQueue queue;
@@ -91,7 +84,7 @@ public class JamesMailSpooler implements
     /**
      * The mail processor 
      */
-    private MailProcessorList mailProcessor;
+    private MailProcessor mailProcessor;
 
     private Log logger;
 
@@ -104,7 +97,7 @@ public class JamesMailSpooler implements
     }
 
     @Resource(name="mailProcessor")
-    public void setMailProcessorList(MailProcessorList mailProcessor) {
+    public void setMailProcessor(MailProcessor mailProcessor) {
         this.mailProcessor = mailProcessor;
     }
     
@@ -236,45 +229,6 @@ public class JamesMailSpooler implements
 
     /*
      * (non-Javadoc)
-     * @see org.apache.james.mailetcontainer.api.MailSpooler#getProcessorNames()
-     */
-    public String[] getProcessorNames() {
-        return mailProcessor.getProcessorNames();
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see org.apache.james.mailetcontainer.api.MailSpooler#getMailets(java.lang.String)
-     */
-    public List<Mailet> getMailets(String processorName) {
-        MailetContainer mailetContainer = getMailetContainerByName(processorName);
-        if (mailetContainer == null) return new ArrayList<Mailet>();
-        return mailetContainer.getMailets();
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see org.apache.james.mailetcontainer.api.MailSpooler#getMatchers(java.lang.String)
-     */
-    public List<Matcher> getMatchers(String processorName) {
-        MailetContainer mailetContainer = getMailetContainerByName(processorName);
-        if (mailetContainer == null) return new ArrayList<Matcher>();
-        return mailetContainer.getMatchers();
-    }
-
-    
-    private MailetContainer getMailetContainerByName(String processorName) {        
-        MailProcessor processor = mailProcessor.getProcessor(processorName);
-        if (!(processor instanceof MailetContainer)) return null;
-        // TODO: decide, if we have to visit all sub-processors for being ProcessorLists

-        // on their very own and collecting the processor names deeply.
-        return (MailetContainer)processor;
-    }
-
-
-
-    /*
-     * (non-Javadoc)
      * @see org.apache.james.lifecycle.LogEnabled#setLog(org.apache.commons.logging.Log)
      */
     public void setLog(Log log) {



---------------------------------------------------------------------
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