+1 thanks Stefano for doing this simplification
Bernd On 8/27/06, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
Hi Bernd, I think that this change is safe as James Server already have a default hardcoded configuration for the smtp handlerchain but I don't know the postage code too much and I would like you review it. Stefano [EMAIL PROTECTED] wrote: > Author: bago > Date: Sun Aug 27 06:15:41 2006 > New Revision: 437374 > > URL: http://svn.apache.org/viewvc?rev=437374&view=rev > Log: > Remove the hardcoded configuration of the smtphandler as SMTPHandler already define its own default handlerchain if no chain is specified. > > Modified: > james/postage/trunk/src/main/java/org/apache/james/postage/smtpserver/SimpleSMTPServerConfiguration.java > > Modified: james/postage/trunk/src/main/java/org/apache/james/postage/smtpserver/SimpleSMTPServerConfiguration.java > URL: http://svn.apache.org/viewvc/james/postage/trunk/src/main/java/org/apache/james/postage/smtpserver/SimpleSMTPServerConfiguration.java?rev=437374&r1=437373&r2=437374&view=diff > ============================================================================== > --- james/postage/trunk/src/main/java/org/apache/james/postage/smtpserver/SimpleSMTPServerConfiguration.java (original) > +++ james/postage/trunk/src/main/java/org/apache/james/postage/smtpserver/SimpleSMTPServerConfiguration.java Sun Aug 27 06:15:41 2006 > @@ -6,9 +6,9 @@ > * 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 * > - * * > + * * > + * 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 * > @@ -22,19 +22,6 @@ > > import org.apache.avalon.framework.configuration.DefaultConfiguration; > import org.apache.avalon.framework.configuration.Configuration; > -import org.apache.james.smtpserver.HeloCmdHandler; > -import org.apache.james.smtpserver.EhloCmdHandler; > -import org.apache.james.smtpserver.AuthCmdHandler; > -import org.apache.james.smtpserver.NoopCmdHandler; > -import org.apache.james.smtpserver.SendMailHandler; > -import org.apache.james.smtpserver.VrfyCmdHandler; > -import org.apache.james.smtpserver.ExpnCmdHandler; > -import org.apache.james.smtpserver.MailCmdHandler; > -import org.apache.james.smtpserver.RcptCmdHandler; > -import org.apache.james.smtpserver.DataCmdHandler; > -import org.apache.james.smtpserver.RsetCmdHandler; > -import org.apache.james.smtpserver.HelpCmdHandler; > -import org.apache.james.smtpserver.QuitCmdHandler; > > public class SimpleSMTPServerConfiguration extends DefaultConfiguration { > private int m_smtpListenerPort; > @@ -47,31 +34,6 @@ > return defaultConfiguration; > } > > - public static DefaultConfiguration createHandlerChainConfiguration() { > - DefaultConfiguration handlerChainConfig = new DefaultConfiguration("handlerchain"); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("HELO", HeloCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("EHLO", EhloCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("AUTH", AuthCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("VRFY", VrfyCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("EXPN", ExpnCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("MAIL", MailCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("RCPT", RcptCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("DATA", DataCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("RSET", RsetCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("HELP", HelpCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("QUIT", QuitCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("NOOP", NoopCmdHandler.class)); > - handlerChainConfig.addChild(createCommandHandlerConfiguration("Default SendMailHandler", SendMailHandler.class)); > - return handlerChainConfig; > - } > - > - private static DefaultConfiguration createCommandHandlerConfiguration(String command, Class commandClass) { > - DefaultConfiguration cmdHandlerConfig = new DefaultConfiguration("handler"); > - cmdHandlerConfig.setAttribute("command", command); > - String classname = commandClass.getName(); > - cmdHandlerConfig.setAttribute("class", classname); > - return cmdHandlerConfig; > - } > public SimpleSMTPServerConfiguration(int smtpListenerPort) { > super("smptserver"); > > @@ -113,7 +75,6 @@ > handlerConfig.addChild(getValuedConfiguration("maxmessagesize", "" + 0)); > handlerConfig.addChild(getValuedConfiguration("authRequired", m_authorizingMode)); > > - handlerConfig.addChild(createHandlerChainConfiguration()); > addChild(handlerConfig); > } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]