From 2e72227a4f2f93113ae2ad57bd0c6895eac86649 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 24 Apr 2018 19:31:09 +0900 Subject: [PATCH] ing --- src/main/java/com/loafle/commons/server/Server.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/loafle/commons/server/Server.java b/src/main/java/com/loafle/commons/server/Server.java index 3d4a529..b274fc7 100644 --- a/src/main/java/com/loafle/commons/server/Server.java +++ b/src/main/java/com/loafle/commons/server/Server.java @@ -6,6 +6,7 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import io.netty.bootstrap.ServerBootstrap; @@ -22,6 +23,11 @@ import io.netty.channel.nio.NioEventLoopGroup; */ public abstract class Server { private static final Logger logger = LoggerFactory.getLogger(Server.class); + public static final String CHANNEL_CLASS = "SERVER_CHANNEL_CLASS"; + public static final String CHANNEL_OPTIONS = "SERVER_CHANNEL_OPTIONS"; + public static final String CHANNEL_HANDLER = "SERVER_CHANNEL_HANDLER"; + public static final String CHANNEL_INITIALIZER = "SERVER_CHANNEL_INITIALIZER"; + public static final String SOCKET_ADDRESS = "SERVER_SOCKET_ADDRESS"; @Value("${server.netty.thread.count.boss}") protected int threadCountBoss; @@ -29,15 +35,19 @@ public abstract class Server { protected int threadCountWorker; @Autowired + @Qualifier(CHANNEL_CLASS) protected Class channelClass; - @Autowired + @Qualifier(CHANNEL_OPTIONS) protected List> channelOptions; @Autowired + @Qualifier(CHANNEL_HANDLER) protected ChannelHandler channelHandler; @Autowired + @Qualifier(CHANNEL_INITIALIZER) protected ChannelInitializer channelInitializer; @Autowired + @Qualifier(SOCKET_ADDRESS) protected SocketAddress address; public void start() throws Exception {