import java.net.InetAddress;
import java.net.InetSocketAddress;
+import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
import org.opendaylight.openflowjava.protocol.impl.connection.ServerFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private NioEventLoopGroup workerGroup;
private NioEventLoopGroup bossGroup;
private final SettableFuture<Boolean> isOnlineFuture;
+ private ThreadConfiguration threadConfig;
private PublishingChannelInitializer channelInitializer;
*/
@Override
public void run() {
- bossGroup = new NioEventLoopGroup();
- workerGroup = new NioEventLoopGroup();
+ if (threadConfig != null) {
+ bossGroup = new NioEventLoopGroup(threadConfig.getBossThreadCount());
+ workerGroup = new NioEventLoopGroup(threadConfig.getWorkerThreadCount());
+ } else {
+ bossGroup = new NioEventLoopGroup();
+ workerGroup = new NioEventLoopGroup();
+ }
/*
* We generally do not perform IO-unrelated tasks, so we want to have
this.channelInitializer = channelInitializer;
}
+ /**
+ * @param threadConfig EventLoopGroup configuration
+ */
+ public void setThreadConfig(ThreadConfiguration threadConfig) {
+ this.threadConfig = threadConfig;
+ }
}