ing
This commit is contained in:
parent
d106b06371
commit
2e72227a4f
|
@ -6,6 +6,7 @@ import java.util.List;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
|
@ -22,6 +23,11 @@ import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
*/
|
*/
|
||||||
public abstract class Server {
|
public abstract class Server {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Server.class);
|
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}")
|
@Value("${server.netty.thread.count.boss}")
|
||||||
protected int threadCountBoss;
|
protected int threadCountBoss;
|
||||||
|
@ -29,15 +35,19 @@ public abstract class Server {
|
||||||
protected int threadCountWorker;
|
protected int threadCountWorker;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier(CHANNEL_CLASS)
|
||||||
protected Class<? extends ServerChannel> channelClass;
|
protected Class<? extends ServerChannel> channelClass;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier(CHANNEL_OPTIONS)
|
||||||
protected List<ChannelOptionItem<?>> channelOptions;
|
protected List<ChannelOptionItem<?>> channelOptions;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier(CHANNEL_HANDLER)
|
||||||
protected ChannelHandler channelHandler;
|
protected ChannelHandler channelHandler;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier(CHANNEL_INITIALIZER)
|
||||||
protected ChannelInitializer<?> channelInitializer;
|
protected ChannelInitializer<?> channelInitializer;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier(SOCKET_ADDRESS)
|
||||||
protected SocketAddress address;
|
protected SocketAddress address;
|
||||||
|
|
||||||
public void start() throws Exception {
|
public void start() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user