Index: C:/Lab/VOID/projects/james-merge/src/java/org/apache/james/transport/LinearProcessor.java =================================================================== --- C:/Lab/VOID/projects/james-merge/src/java/org/apache/james/transport/LinearProcessor.java (revision 168008) +++ C:/Lab/VOID/projects/james-merge/src/java/org/apache/james/transport/LinearProcessor.java (working copy) @@ -17,24 +17,29 @@ package org.apache.james.transport; -import org.apache.avalon.framework.activity.Initializable; import org.apache.avalon.framework.activity.Disposable; +import org.apache.avalon.framework.activity.Initializable; import org.apache.avalon.framework.logger.AbstractLogEnabled; -import org.apache.avalon.framework.logger.Logger; import org.apache.james.core.MailImpl; import org.apache.james.core.MailetConfigImpl; -import org.apache.james.services.SpoolRepository; -import org.apache.mailet.*; +import org.apache.mailet.GenericMailet; +import org.apache.mailet.GenericMatcher; +import org.apache.mailet.Mail; +import org.apache.mailet.MailAddress; +import org.apache.mailet.Mailet; +import org.apache.mailet.MailetConfig; +import org.apache.mailet.MailetException; +import org.apache.mailet.Matcher; import javax.mail.MessagingException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collection; -import java.util.List; -import java.util.Random; import java.util.Iterator; +import java.util.List; import java.util.Locale; +import java.util.Random; /** * Implements a processor for mails, directing the mail down @@ -56,7 +61,7 @@ * it is implemented on the <mailet> tag. The specification is: * * <mailet match="..." class="..." - * [onMatchException="{noMatch|matchAll|error|<aProcessorName>}"] + * [onMatchException="{noMatch|matchAll|error|<aProcessorName>}"] * [onMailetException="{ignore|error|<aProcessorName>}"]> * * noMatch: no addresses are considered to match @@ -69,7 +74,7 @@ *
CVS $Id$
* @version 2.2.0 */ -public class LinearProcessor +public class LinearProcessor extends AbstractLogEnabled implements Initializable, Disposable { @@ -96,23 +101,8 @@ private List mailets; // The list of mailets for this processor private List matchers; // The list of matchers for this processor private volatile boolean listsClosed; // Whether the matcher/mailet lists have been closed. - private SpoolRepository spool; // The spool on which this processor is acting /** - * Set the spool to be used by this LinearProcessor. - * - * @param spool the spool to be used by this processor - * - * @throws IllegalArgumentException when the spool passed in is null - */ - public void setSpool(SpoolRepository spool) { - if (spool == null) { - throw new IllegalArgumentException("The spool cannot be null"); - } - this.spool = spool; - } - - /** * @see org.apache.avalon.framework.activity.Initializable#initialize() */ public void initialize() { @@ -150,7 +140,7 @@ * *It is an essential part of the contract of the LinearProcessor * that a particular matcher/mailet combination be used to - * terminate the processor chain. This is done by calling the + * terminate the processor chain. This is done by calling the * closeProcessorList method.
* *Once the closeProcessorList has been called any subsequent @@ -196,12 +186,12 @@ public Collection match(Mail mail) { return mail.getRecipients(); } - + public String getMatcherInfo() { return TERMINATING_MATCHER_NAME; } }; - Mailet terminatingMailet = + Mailet terminatingMailet = new GenericMailet() { public void service(Mail mail) { if (!(Mail.ERROR.equals(mail.getState()))) { @@ -217,11 +207,11 @@ } mail.setState(Mail.GHOST); } - + public String getMailetInfo() { return getMailetName(); } - + public String getMailetName() { return TERMINATING_MAILET_NAME; } @@ -238,21 +228,17 @@ * *
If the matcher/mailet lists have not been closed by a call to the closeProcessorLists
* method then a call to this method will result in an IllegalStateException.
- * The end of the matcher/mailet chain must be a matcher that matches all mails and
- * a mailet that sets every mail to GHOST status. This is necessary to ensure that
+ * The end of the matcher/mailet chain must be a matcher that matches all mails and
+ * a mailet that sets every mail to GHOST status. This is necessary to ensure that
* mails are removed from the spool in an orderly fashion. The closeProcessorLists method
* ensures this.