Index: C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/remotemanager/RemoteManager.java =================================================================== --- C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/remotemanager/RemoteManager.java (revision 410479) +++ C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/remotemanager/RemoteManager.java (working copy) @@ -18,7 +18,6 @@ package org.apache.james.remotemanager; import org.apache.avalon.cornerstone.services.store.Store; -import org.apache.avalon.excalibur.pool.ObjectFactory; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.service.ServiceException; @@ -115,7 +114,6 @@ if (prompt == null) prompt = ""; else if (!prompt.equals("") && !prompt.endsWith(" ")) prompt += " "; } - theHandlerFactory = new RemoteManagerHandlerFactory(); } /** @@ -133,31 +131,17 @@ } /** - * The factory for producing handlers. + * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() */ - private static class RemoteManagerHandlerFactory - implements ObjectFactory { + public Object newInstance() throws Exception { + return new RemoteManagerHandler(); + } - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() - */ - public Object newInstance() throws Exception { - return new RemoteManagerHandler(); - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() - */ - public Class getCreatedClass() { - return RemoteManagerHandler.class; - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#decommision(Object) - */ - public void decommission( Object object ) throws Exception { - return; - } + /** + * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() + */ + public Class getCreatedClass() { + return RemoteManagerHandler.class; } /** Index: C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/core/AbstractJamesService.java =================================================================== --- C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/core/AbstractJamesService.java (revision 410479) +++ C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/core/AbstractJamesService.java (working copy) @@ -53,7 +53,7 @@ * */ public abstract class AbstractJamesService extends AbstractHandlerFactory - implements Serviceable, Configurable, Disposable, Initializable, ConnectionHandlerFactory { + implements Serviceable, Configurable, Disposable, Initializable, ConnectionHandlerFactory, ObjectFactory { /** * The default value for the connection timeout. @@ -168,11 +168,6 @@ protected Pool theHandlerPool = null; /** - * The factory used to provide Handler objects - */ - protected ObjectFactory theHandlerFactory = null; - - /** * The factory used to generate Watchdog objects */ protected WatchdogFactory theWatchdogFactory = null; @@ -395,14 +390,14 @@ getLogger().info(logString); if (connectionLimit != null) { - theHandlerPool = new HardResourceLimitingPool(theHandlerFactory, 5, connectionLimit.intValue()); + theHandlerPool = new HardResourceLimitingPool((ObjectFactory) this, 5, connectionLimit.intValue()); if (getLogger().isDebugEnabled()) { getLogger().debug("Using a bounded pool for "+getServiceType()+" handlers with upper limit " + connectionLimit.intValue()); } } else { // NOTE: The maximum here is not a real maximum. The handler pool will continue to // provide handlers beyond this value. - theHandlerPool = new DefaultPool(theHandlerFactory, null, 5, 30); + theHandlerPool = new DefaultPool((ObjectFactory) this, null, 5, 30); getLogger().debug("Using an unbounded pool for "+getServiceType()+" handlers."); } ContainerUtil.enableLogging(theHandlerPool, getLogger()); @@ -595,5 +590,14 @@ public String getSocketType() { return serverSocketType; } + + + /** + * @see org.apache.avalon.excalibur.pool.ObjectFactory#decommision(Object) + */ + public void decommission( Object object ) throws Exception { + return; + } + } Index: C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/nntpserver/NNTPServer.java =================================================================== --- C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/nntpserver/NNTPServer.java (revision 410479) +++ C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/nntpserver/NNTPServer.java (working copy) @@ -17,7 +17,6 @@ package org.apache.james.nntpserver; -import org.apache.avalon.excalibur.pool.ObjectFactory; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.service.ServiceException; @@ -83,7 +82,6 @@ } } } - theHandlerFactory = new NNTPHandlerFactory(); } /** @@ -101,33 +99,20 @@ } /** - * The factory for producing handlers. + * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() */ - private static class NNTPHandlerFactory - implements ObjectFactory { + public Object newInstance() throws Exception { + return new NNTPHandler(); + } - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() - */ - public Object newInstance() throws Exception { - return new NNTPHandler(); - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() - */ - public Class getCreatedClass() { - return NNTPHandler.class; - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#decommision(Object) - */ - public void decommission( Object object ) throws Exception { - return; - } + /** + * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() + */ + public Class getCreatedClass() { + return NNTPHandler.class; } + /** * A class to provide NNTP handler configuration to the handlers */ Index: C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/pop3server/POP3Server.java =================================================================== --- C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/pop3server/POP3Server.java (revision 410479) +++ C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/pop3server/POP3Server.java (working copy) @@ -17,8 +17,6 @@ package org.apache.james.pop3server; -import org.apache.avalon.cornerstone.services.connection.ConnectionHandler; -import org.apache.avalon.excalibur.pool.ObjectFactory; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.container.ContainerUtil; @@ -106,7 +104,6 @@ ContainerUtil.configure(handlerChain,handlerConfiguration.getChild("handlerchain")); } - theHandlerFactory = new POP3HandlerFactory(); } /** @@ -123,47 +120,21 @@ return "POP3 Service"; } - /** - * @see org.apache.avalon.cornerstone.services.connection.AbstractHandlerFactory#newHandler() + * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() */ - protected ConnectionHandler newHandler() - throws Exception { - - POP3Handler theHandler = (POP3Handler) super.newHandler(); - + public Object newInstance() throws Exception { + POP3Handler theHandler = new POP3Handler(); //pass the handler chain to every POP3handler theHandler.setHandlerChain(handlerChain); - return theHandler; } /** - * The factory for producing handlers. + * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() */ - private static class POP3HandlerFactory - implements ObjectFactory { - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() - */ - public Object newInstance() throws Exception { - return new POP3Handler(); - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() - */ - public Class getCreatedClass() { - return POP3Handler.class; - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#decommision(Object) - */ - public void decommission( Object object ) throws Exception { - return; - } + public Class getCreatedClass() { + return POP3Handler.class; } /** Index: C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/smtpserver/SMTPServer.java =================================================================== --- C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/smtpserver/SMTPServer.java (revision 410479) +++ C:/Lab/VOID/projects/james-trunk/src/java/org/apache/james/smtpserver/SMTPServer.java (working copy) @@ -17,8 +17,6 @@ package org.apache.james.smtpserver; -import org.apache.avalon.cornerstone.services.connection.ConnectionHandler; -import org.apache.avalon.excalibur.pool.ObjectFactory; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.container.ContainerUtil; @@ -229,7 +227,6 @@ } else { mailetcontext.setAttribute(Constants.HELLO_NAME, "localhost"); } - theHandlerFactory = new SMTPHandlerFactory(); } /** @@ -247,45 +244,20 @@ } /** - * @see org.apache.avalon.cornerstone.services.connection.AbstractHandlerFactory#newHandler() + * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() */ - protected ConnectionHandler newHandler() - throws Exception { - - SMTPHandler theHandler = (SMTPHandler) super.newHandler(); - + public Object newInstance() throws Exception { + SMTPHandler theHandler = new SMTPHandler(); //pass the handler chain to every SMTPhandler theHandler.setHandlerChain(handlerChain); - return theHandler; } /** - * The factory for producing handlers. + * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() */ - private static class SMTPHandlerFactory - implements ObjectFactory { - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance() - */ - public Object newInstance() throws Exception { - return new SMTPHandler(); - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#getCreatedClass() - */ - public Class getCreatedClass() { - return SMTPHandler.class; - } - - /** - * @see org.apache.avalon.excalibur.pool.ObjectFactory#decommision(Object) - */ - public void decommission( Object object ) throws Exception { - return; - } + public Class getCreatedClass() { + return SMTPHandler.class; } /**