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 no...@apache.org on 2011/03/22 08:07:38 UTC

svn commit: r1084082 - /james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java

Author: norman
Date: Tue Mar 22 07:07:38 2011
New Revision: 1084082

URL: http://svn.apache.org/viewvc?rev=1084082&view=rev
Log:
Allow to override the used ServerSocketChannelFactory

Modified:
    james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java

Modified: james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java?rev=1084082&r1=1084081&r2=1084082&view=diff
==============================================================================
--- james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java (original)
+++ james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java Tue Mar 22 07:07:38 2011
@@ -27,6 +27,7 @@ import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelPipelineFactory;
 import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.channel.group.DefaultChannelGroup;
+import org.jboss.netty.channel.socket.ServerSocketChannelFactory;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
 
 /**
@@ -103,7 +104,7 @@ public abstract class AbstractAsyncServe
 
         if (port < 1) throw new RuntimeException("Please specify a port to which the server should get bound!");
 
-        bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor(), ioWorker));
+        bootstrap = new ServerBootstrap(createSocketChannelFactory());
         ChannelPipelineFactory factory = createPipelineFactory(channels);
         
         // Configure the pipeline factory.
@@ -125,6 +126,10 @@ public abstract class AbstractAsyncServe
 
     }
 
+    protected ServerSocketChannelFactory createSocketChannelFactory() {
+        return new NioServerSocketChannelFactory(createBossExecutor(), createWorkerExecutor(), ioWorker);
+    }
+    
     /**
      * Stop the server
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org