Author: bago
Date: Sun Oct 18 12:41:32 2009
New Revision: 826424

URL: http://svn.apache.org/viewvc?rev=826424&view=rev
Log:
Remove protocol-specific HandlerChains in favor of a generic 
ProtocolHandlerChain

Removed:
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerChain.java
    
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManagerHandlerChain.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/protocol/SMTPHandlerChain.java
Modified:
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java
    
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManager.java
    
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManagerHandler.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandler.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerComposed.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AsyncSMTPServer.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/SMTPIoHandler.java

Modified: 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
 (original)
+++ 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
 Sun Oct 18 12:41:32 2009
@@ -36,6 +36,7 @@
 import org.apache.james.socket.api.ProtocolContext;
 import org.apache.james.socket.api.Watchdog;
 import org.apache.james.socket.shared.AbstractProtocolHandler;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 import org.apache.mailet.Mail;
 
 /**
@@ -84,7 +85,7 @@
     /**
      * The POP3HandlerChain object set by POP3Server
      */
-    private final POP3HandlerChain handlerChain;
+    private final ProtocolHandlerChain handlerChain;
 
     /**
      * The session termination status
@@ -108,7 +109,7 @@
      */
     private final LinkedList<ConnectHandler> connectHandlers;
     
-    public POP3Handler(final POP3HandlerConfigurationData theConfigData, final 
POP3HandlerChain handlerChain) {
+    public POP3Handler(final POP3HandlerConfigurationData theConfigData, final 
ProtocolHandlerChain handlerChain) {
         this.theConfigData = theConfigData;
         this.handlerChain = handlerChain;
         connectHandlers = handlerChain.getHandlers(ConnectHandler.class);

Modified: 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java
 (original)
+++ 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java
 Sun Oct 18 12:41:32 2009
@@ -34,6 +34,7 @@
 import org.apache.james.socket.AbstractProtocolServer;
 import org.apache.james.socket.api.ProtocolHandler;
 import org.apache.james.socket.configuration.JamesConfiguration;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 
 /**
  * <p>Accepts POP3 connections on a server socket and dispatches them to 
POP3Handlers.</p>
@@ -48,7 +49,7 @@
      * The handler chain - POP3handlers can lookup handlerchain to obtain
      * Command handlers , Message handlers and connection handlers
      */
-    private POP3HandlerChain handlerChain;
+    private ProtocolHandlerChain handlerChain;
 
     /**
      * The internal mail server service
@@ -124,7 +125,7 @@
     
     private void prepareHandlerChain() throws Exception {
 
-        handlerChain = loader.load(POP3HandlerChain.class);
+        handlerChain = loader.load(ProtocolHandlerChain.class);
         
         //set the logger
         handlerChain.setLog(new AvalonLogger(getLogger()));

Modified: 
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManager.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManager.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManager.java
 (original)
+++ 
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManager.java
 Sun Oct 18 12:41:32 2009
@@ -37,6 +37,7 @@
 import org.apache.james.socket.AbstractProtocolServer;
 import org.apache.james.socket.api.ProtocolHandler;
 import org.apache.james.socket.configuration.JamesConfiguration;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 
 /**
  * Provides a really rude network interface to administer James.
@@ -80,7 +81,7 @@
     /**
      * The chain to use
      */
-    private RemoteManagerHandlerChain handlerChain;
+    private ProtocolHandlerChain handlerChain;
 
 
     /**
@@ -147,7 +148,7 @@
     
     private void prepareHandlerChain() throws Exception {
 
-        handlerChain = loader.load(RemoteManagerHandlerChain.class);
+        handlerChain = loader.load(ProtocolHandlerChain.class);
         
         //set the logger
         handlerChain.setLog(new AvalonLogger(getLogger()));

Modified: 
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManagerHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManagerHandler.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManagerHandler.java
 (original)
+++ 
james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/RemoteManagerHandler.java
 Sun Oct 18 12:41:32 2009
@@ -33,6 +33,7 @@
 import org.apache.james.socket.api.ProtocolContext;
 import org.apache.james.socket.api.ProtocolHandler;
 import org.apache.james.socket.api.Watchdog;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 
 
 /**
@@ -52,13 +53,13 @@
 
     private boolean sessionEnded;
 
-    private RemoteManagerHandlerChain handlerChain;
+    private ProtocolHandlerChain handlerChain;
 
     private LinkedList<ConnectHandler> connectHandlers;
 
     private LinkedList<LineHandler> lineHandlers;
     
-    public RemoteManagerHandler(final RemoteManagerHandlerConfigurationData 
theConfigData, final RemoteManagerHandlerChain handlerChain) {
+    public RemoteManagerHandler(final RemoteManagerHandlerConfigurationData 
theConfigData, final ProtocolHandlerChain handlerChain) {
         this.theConfigData = theConfigData; 
         this.handlerChain = handlerChain;
         connectHandlers = handlerChain.getHandlers(ConnectHandler.class);

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandler.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandler.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandler.java
 Sun Oct 18 12:41:32 2009
@@ -31,13 +31,13 @@
 import org.apache.james.smtpserver.protocol.ConnectHandler;
 import org.apache.james.smtpserver.protocol.LineHandler;
 import org.apache.james.smtpserver.protocol.SMTPConfiguration;
-import org.apache.james.smtpserver.protocol.SMTPHandlerChain;
 import org.apache.james.smtpserver.protocol.SMTPResponse;
 import org.apache.james.smtpserver.protocol.SMTPRetCode;
 import org.apache.james.smtpserver.protocol.SMTPSession;
 import org.apache.james.socket.api.ProtocolContext;
 import org.apache.james.socket.shared.AbstractProtocolHandler;
 import org.apache.james.socket.shared.CRLFDelimitedByteBuffer;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 
 /**
  * Provides SMTP functionality by carrying out the server side of the SMTP
@@ -86,11 +86,11 @@
 
        private boolean authSupported;
 
-       private final SMTPHandlerChain handlerChain;
+       private final ProtocolHandlerChain handlerChain;
 
        private String smtpID;
 
-       public SMTPHandler(SMTPHandlerChain handlerChain, final 
SMTPConfiguration theConfigData) {
+       public SMTPHandler(ProtocolHandlerChain handlerChain, final 
SMTPConfiguration theConfigData) {
         this.handlerChain = handlerChain;
         connectHandlers = handlerChain.getHandlers(ConnectHandler.class);
         lineHandlers = handlerChain.getHandlers(LineHandler.class);

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=826424&r1=826423&r2=826424&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
 Sun Oct 18 12:41:32 2009
@@ -33,12 +33,12 @@
 import org.apache.james.api.kernel.LoaderService;
 import org.apache.james.services.MailServer;
 import org.apache.james.smtpserver.protocol.SMTPConfiguration;
-import org.apache.james.smtpserver.protocol.SMTPHandlerChain;
 import org.apache.james.smtpserver.protocol.SMTPServerMBean;
 import org.apache.james.smtpserver.protocol.core.CoreCmdHandlerLoader;
 import org.apache.james.socket.AbstractProtocolServer;
 import org.apache.james.socket.api.ProtocolHandler;
 import org.apache.james.socket.configuration.JamesConfiguration;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 import org.apache.mailet.MailetContext;
 
 /**
@@ -60,7 +60,7 @@
      * Command handlers , Message handlers and connection handlers
      * Constructed during initialisation to allow dependency injection.
      */
-    private SMTPHandlerChain handlerChain;
+    private ProtocolHandlerChain handlerChain;
 
     /**
      * The mailet context - we access it here to set the hello name for the 
Mailet API
@@ -237,7 +237,7 @@
     }
 
     private void prepareHandlerChain() throws Exception {
-        handlerChain = loader.load(SMTPHandlerChain.class);
+        handlerChain = loader.load(ProtocolHandlerChain.class);
         
         //set the logger
         handlerChain.setLog(new AvalonLogger(getLogger()));

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerComposed.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerComposed.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerComposed.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerComposed.java
 Sun Oct 18 12:41:32 2009
@@ -39,13 +39,13 @@
 import org.apache.james.api.kernel.LoaderService;
 import org.apache.james.services.MailServer;
 import org.apache.james.smtpserver.protocol.SMTPConfiguration;
-import org.apache.james.smtpserver.protocol.SMTPHandlerChain;
 import org.apache.james.smtpserver.protocol.core.CoreCmdHandlerLoader;
 import org.apache.james.socket.AvalonProtocolServer;
 import org.apache.james.socket.api.ProtocolHandler;
 import org.apache.james.socket.api.ProtocolHandlerFactory;
 import org.apache.james.socket.api.ProtocolServer;
 import org.apache.james.socket.configuration.JamesConfiguration;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 import org.apache.mailet.MailetContext;
 
 /**
@@ -70,7 +70,7 @@
      * Command handlers , Message handlers and connection handlers
      * Constructed during initialisation to allow dependency injection.
      */
-    private SMTPHandlerChain handlerChain;
+    private ProtocolHandlerChain handlerChain;
 
     /**
      * The mailet context - we access it here to set the hello name for the 
Mailet API
@@ -263,7 +263,7 @@
     }
 
     private void prepareHandlerChain() throws Exception {
-        handlerChain = loader.load(SMTPHandlerChain.class);
+        handlerChain = loader.load(ProtocolHandlerChain.class);
         
         //set the logger
         handlerChain.setLog(new AvalonLogger(getLogger()));

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AsyncSMTPServer.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AsyncSMTPServer.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AsyncSMTPServer.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AsyncSMTPServer.java
 Sun Oct 18 12:41:32 2009
@@ -26,14 +26,14 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.impl.AvalonLogger;
 import org.apache.james.api.dnsservice.util.NetMatcher;
-import org.apache.james.smtpserver.mina.filter.SMTPValidationFilter;
 import org.apache.james.smtpserver.mina.filter.SMTPResponseFilter;
+import org.apache.james.smtpserver.mina.filter.SMTPValidationFilter;
 import org.apache.james.smtpserver.protocol.SMTPConfiguration;
-import org.apache.james.smtpserver.protocol.SMTPHandlerChain;
 import org.apache.james.smtpserver.protocol.SMTPServerMBean;
 import org.apache.james.smtpserver.protocol.core.CoreCmdHandlerLoader;
 import org.apache.james.socket.configuration.JamesConfiguration;
 import org.apache.james.socket.mina.AbstractAsyncServer;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
 import org.apache.mina.core.service.IoHandler;
 
@@ -55,7 +55,7 @@
      * Command handlers , Message handlers and connection handlers
      * Constructed during initialisation to allow dependency injection.
      */
-    private SMTPHandlerChain handlerChain;
+    private ProtocolHandlerChain handlerChain;
 
    
     /** Cached configuration data for handler */
@@ -193,7 +193,7 @@
      * @throws Exception
      */
     private void prepareHandlerChain() throws Exception {
-        handlerChain = getLoader().load(SMTPHandlerChain.class);
+        handlerChain = getLoader().load(ProtocolHandlerChain.class);
                       
         //set the logger
         handlerChain.setLog(new AvalonLogger(getLogger()));

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/SMTPIoHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/SMTPIoHandler.java?rev=826424&r1=826423&r2=826424&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/SMTPIoHandler.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/SMTPIoHandler.java
 Sun Oct 18 12:41:32 2009
@@ -26,9 +26,9 @@
 import org.apache.james.smtpserver.protocol.ConnectHandler;
 import org.apache.james.smtpserver.protocol.LineHandler;
 import org.apache.james.smtpserver.protocol.SMTPConfiguration;
-import org.apache.james.smtpserver.protocol.SMTPHandlerChain;
 import org.apache.james.smtpserver.protocol.SMTPRequest;
 import org.apache.james.smtpserver.protocol.SMTPSession;
+import org.apache.james.socket.shared.ProtocolHandlerChain;
 import org.apache.mina.core.service.IoHandlerAdapter;
 import org.apache.mina.core.session.IdleStatus;
 import org.apache.mina.core.session.IoSession;
@@ -43,16 +43,16 @@
     private final static String SMTP_SESSION = 
"org.apache.james.smtpserver.mina.SMTPIoHandler.SMTP_SESSION";
     
     private Log logger;
-    private SMTPHandlerChain chain;
+    private ProtocolHandlerChain chain;
     private SMTPConfiguration conf;
     private SslContextFactory contextFactory;
 
-    public SMTPIoHandler(SMTPHandlerChain chain,
+    public SMTPIoHandler(ProtocolHandlerChain chain,
             SMTPConfiguration conf, Log logger) {
         this(chain,conf,logger,null);
     }
     
-    public SMTPIoHandler(SMTPHandlerChain chain,
+    public SMTPIoHandler(ProtocolHandlerChain chain,
             SMTPConfiguration conf, Log logger, SslContextFactory 
contextFactory) {
         this.chain = chain;
         this.conf = conf;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to