From 90dda2f9643c4315272f3da54d865ed54301d45f Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 24 Apr 2018 11:51:31 +0900 Subject: [PATCH] ing --- .../java/com/loafle/commons/server/Server.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/loafle/commons/server/Server.java b/src/main/java/com/loafle/commons/server/Server.java index 673a83e..ccc6b3c 100644 --- a/src/main/java/com/loafle/commons/server/Server.java +++ b/src/main/java/com/loafle/commons/server/Server.java @@ -29,12 +29,12 @@ public abstract class Server { protected int threadCountWorker; @Autowired - protected List> channelClasses; + protected Class channelClass; @Autowired protected List> channelOptions; @Autowired - protected List channelHandlers; + protected ChannelHandler channelHandler; @Autowired protected ChannelInitializer channelInitializer; @Autowired @@ -48,20 +48,16 @@ public abstract class Server { ServerBootstrap serverBootstrap = new ServerBootstrap(); serverBootstrap.group(bossGroup, workerGroup); - if (null != this.channelClasses) { - for (Class channelClass : this.channelClasses) { - serverBootstrap.channel(channelClass); - } + if (null != this.channelClass) { + serverBootstrap = serverBootstrap.channel(this.channelClass); } if (null != this.channelOptions) { for (ChannelOptionItem optionItem : this.channelOptions) { optionItem.setOption(serverBootstrap); } } - if (null != this.channelHandlers) { - for (ChannelHandler channelHandler : this.channelHandlers) { - serverBootstrap.handler(channelHandler); - } + if (null != this.channelHandler) { + serverBootstrap.handler(this.channelHandler); } serverBootstrap.childHandler(this.channelInitializer);