Author: norman
Date: Fri Mar 25 06:30:12 2011
New Revision: 1085263
URL: http://svn.apache.org/viewvc?rev=1085263&view=rev
Log:
Allow to override configuration parameters of ServerBootstrap
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=1085263&r1=1085262&r2=1085263&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
Fri Mar 25 06:30:12 2011
@@ -109,11 +109,7 @@ public abstract class AbstractAsyncServe
// Configure the pipeline factory.
bootstrap.setPipelineFactory(factory);
-
- // Bind and start to accept incoming connections.
- bootstrap.setOption("backlog", backlog);
- bootstrap.setOption("reuseAddress", true);
- bootstrap.setOption("child.tcpNoDelay", true);
+ configureBootstrap(bootstrap);
Channel serverChannel;
if (getIP() == null) {
serverChannel = bootstrap.bind(new InetSocketAddress(port));
@@ -126,6 +122,18 @@ public abstract class AbstractAsyncServe
}
+ /**
+ * Configure the bootstrap before it get bound
+ *
+ * @param bootstrap
+ */
+ protected void configureBootstrap(ServerBootstrap bootstrap) {
+ // Bind and start to accept incoming connections.
+ bootstrap.setOption("backlog", backlog);
+ bootstrap.setOption("reuseAddress", true);
+ bootstrap.setOption("child.tcpNoDelay", true);
+ }
+
protected ServerSocketChannelFactory createSocketChannelFactory() {
return new NioServerSocketChannelFactory(createBossExecutor(),
createWorkerExecutor(), ioWorker);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]