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 rd...@apache.org on 2009/09/05 09:48:33 UTC
svn commit: r811598 - in
/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver:
SMTPHandlerChain.java SMTPServer.java
Author: rdonkin
Date: Sat Sep 5 07:48:33 2009
New Revision: 811598
URL: http://svn.apache.org/viewvc?rev=811598&view=rev
Log:
Switch from using Avalon to initialise handler chain
Modified:
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java
Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java?rev=811598&r1=811597&r2=811598&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java (original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java Sat Sep 5 07:48:33 2009
@@ -44,7 +44,7 @@
* The SMTPHandlerChain is per service object providing access
* ConnectHandlers, Commandhandlers and message handlers
*/
-public class SMTPHandlerChain extends AbstractLogEnabled implements Configurable, Serviceable, Initializable {
+public class SMTPHandlerChain extends AbstractLogEnabled implements Configurable, Serviceable {
private List<Object> handlers = new LinkedList<Object>();
@@ -133,7 +133,7 @@
}
/**
- * @see org.apache.avalon.framework.activity.Initializable#initialize()
+ * Initializes chain.
*/
public void initialize() throws Exception {
// SMTPCommandDispatcherLineHandler commandDispatcherLineHandler = new SMTPCommandDispatcherLineHandler();
Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java?rev=811598&r1=811597&r2=811598&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java (original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java Sat Sep 5 07:48:33 2009
@@ -250,29 +250,22 @@
}
}
- private void prepareHandlerChain() throws ConfigurationException {
+ private void prepareHandlerChain() throws Exception {
handlerChain = loader.load(SMTPHandlerChain.class);
//set the logger
ContainerUtil.enableLogging(handlerChain,getLogger());
- try {
- ContainerUtil.service(handlerChain,serviceManager);
- } catch (ServiceException e) {
- if (getLogger().isErrorEnabled()) {
- getLogger().error("Failed to service handlerChain",e);
- }
- throw new ConfigurationException("Failed to service handlerChain");
- }
+ ContainerUtil.service(handlerChain,serviceManager);
//read from the XML configuration and create and configure each of the handlers
ContainerUtil.configure(handlerChain,handlerConfiguration.getChild("handlerchain"));
+ handlerChain.initialize();
}
@Override
protected void prepareInit() throws Exception {
prepareHandlerChain();
- ContainerUtil.initialize(handlerChain);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org