Author: bago
Date: Sun Oct 18 12:43:27 2009
New Revision: 826425
URL: http://svn.apache.org/viewvc?rev=826425&view=rev
Log:
Defined an interface for the ProtocolHandlerChain (moved the impl to
PrototolHandlerChainImpl)
Added:
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
(with props)
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChainImpl.java
- copied, changed from r826423,
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
Modified:
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/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
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=826425&r1=826424&r2=826425&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:43:27 2009
@@ -34,7 +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;
+import org.apache.james.socket.shared.ProtocolHandlerChainImpl;
/**
* <p>Accepts POP3 connections on a server socket and dispatches them to
POP3Handlers.</p>
@@ -49,7 +49,7 @@
* The handler chain - POP3handlers can lookup handlerchain to obtain
* Command handlers , Message handlers and connection handlers
*/
- private ProtocolHandlerChain handlerChain;
+ private ProtocolHandlerChainImpl handlerChain;
/**
* The internal mail server service
@@ -125,7 +125,7 @@
private void prepareHandlerChain() throws Exception {
- handlerChain = loader.load(ProtocolHandlerChain.class);
+ handlerChain = loader.load(ProtocolHandlerChainImpl.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=826425&r1=826424&r2=826425&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:43:27 2009
@@ -37,7 +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;
+import org.apache.james.socket.shared.ProtocolHandlerChainImpl;
/**
* Provides a really rude network interface to administer James.
@@ -81,7 +81,7 @@
/**
* The chain to use
*/
- private ProtocolHandlerChain handlerChain;
+ private ProtocolHandlerChainImpl handlerChain;
/**
@@ -148,7 +148,7 @@
private void prepareHandlerChain() throws Exception {
- handlerChain = loader.load(ProtocolHandlerChain.class);
+ handlerChain = loader.load(ProtocolHandlerChainImpl.class);
//set the logger
handlerChain.setLog(new AvalonLogger(getLogger()));
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=826425&r1=826424&r2=826425&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:43:27 2009
@@ -38,7 +38,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;
+import org.apache.james.socket.shared.ProtocolHandlerChainImpl;
import org.apache.mailet.MailetContext;
/**
@@ -60,7 +60,7 @@
* Command handlers , Message handlers and connection handlers
* Constructed during initialisation to allow dependency injection.
*/
- private ProtocolHandlerChain handlerChain;
+ private ProtocolHandlerChainImpl 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(ProtocolHandlerChain.class);
+ handlerChain = loader.load(ProtocolHandlerChainImpl.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=826425&r1=826424&r2=826425&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:43:27 2009
@@ -45,7 +45,7 @@
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.james.socket.shared.ProtocolHandlerChainImpl;
import org.apache.mailet.MailetContext;
/**
@@ -70,7 +70,7 @@
* Command handlers , Message handlers and connection handlers
* Constructed during initialisation to allow dependency injection.
*/
- private ProtocolHandlerChain handlerChain;
+ private ProtocolHandlerChainImpl 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(ProtocolHandlerChain.class);
+ handlerChain = loader.load(ProtocolHandlerChainImpl.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=826425&r1=826424&r2=826425&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:43:27 2009
@@ -33,7 +33,7 @@
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.james.socket.shared.ProtocolHandlerChainImpl;
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 ProtocolHandlerChain handlerChain;
+ private ProtocolHandlerChainImpl handlerChain;
/** Cached configuration data for handler */
@@ -193,7 +193,7 @@
* @throws Exception
*/
private void prepareHandlerChain() throws Exception {
- handlerChain = getLoader().load(ProtocolHandlerChain.class);
+ handlerChain = getLoader().load(ProtocolHandlerChainImpl.class);
//set the logger
handlerChain.setLog(new AvalonLogger(getLogger()));
Added:
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java?rev=826425&view=auto
==============================================================================
---
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
(added)
+++
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
Sun Oct 18 12:43:27 2009
@@ -0,0 +1,17 @@
+package org.apache.james.socket.shared;
+
+import java.util.LinkedList;
+
+public interface ProtocolHandlerChain {
+
+ /**
+ * Returns a list of handler of the requested type.
+ * @param <T>
+ *
+ * @param type the type of handler we're interested in
+ * @return a List of handlers
+ */
+ @SuppressWarnings("unchecked")
+ public abstract <T> LinkedList<T> getHandlers(Class<T> type);
+
+}
\ No newline at end of file
Propchange:
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied:
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChainImpl.java
(from r826423,
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java)
URL:
http://svn.apache.org/viewvc/james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChainImpl.java?p2=james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChainImpl.java&p1=james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java&r1=826423&r2=826425&rev=826425&view=diff
==============================================================================
---
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChain.java
(original)
+++
james/server/trunk/socket-shared-library/src/main/java/org/apache/james/socket/shared/ProtocolHandlerChainImpl.java
Sun Oct 18 12:43:27 2009
@@ -40,10 +40,10 @@
*
*
*/
-public class ProtocolHandlerChain implements LogEnabled, Configurable {
+public class ProtocolHandlerChainImpl implements LogEnabled, Configurable,
ProtocolHandlerChain {
/** This log is the fall back shared by all instances */
- private static final Log FALLBACK_LOG =
LogFactory.getLog(ProtocolHandlerChain.class);
+ private static final Log FALLBACK_LOG =
LogFactory.getLog(ProtocolHandlerChainImpl.class);
/** Non context specific log should only be used when no context specific
log is available */
private Log log = FALLBACK_LOG;
@@ -58,7 +58,7 @@
}
/**
- * @see org.apache.james.socket.shared.ProtocolHandlerChain#getLog()
+ * @see org.apache.james.socket.shared.ProtocolHandlerChainImpl#getLog()
*/
protected Log getLog() {
return log;
@@ -173,12 +173,8 @@
}
- /**
- * Returns a list of handler of the requested type.
- * @param <T>
- *
- * @param type the type of handler we're interested in
- * @return a List of handlers
+ /* (non-Javadoc)
+ * @see
org.apache.james.socket.shared.ProtocolHandlerChain#getHandlers(java.lang.Class)
*/
@SuppressWarnings("unchecked")
public <T> LinkedList<T> getHandlers(Class<T> type) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]