public class ServerConfig extends AbstractIdConfig implements Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
accepts
服务端允许客户端建立的连接数
|
protected boolean |
adaptivePort
The Adaptive port.
|
protected int |
aliveTime
线程池回收时间
|
protected boolean |
autoStart
是否自动启动
|
protected String |
contextPath
基本路径
|
protected int |
coreThreads
业务线程池大小
|
protected boolean |
daemon
是否hold住端口,true的话随主线程退出而退出,false的话则要主动退出
|
protected String |
dispatcher
已过时。
|
protected boolean |
epoll
是否启动epoll
|
protected String |
host
实际监听IP,与网卡对应
|
protected int |
ioThreads
io线程池大小
|
protected int |
maxThreads
业务线程池大小
|
protected List<ChannelListener> |
onConnect
连接事件监听器实例,连接或者断开时触发
|
protected Map<String,String> |
parameters
The Parameters.
|
protected int |
payload
已过时。
|
protected int |
port
监听端口
|
protected boolean |
preStartCore
线程池是否初始化核心线程
|
protected String |
protocol
配置名称
|
protected int |
queues
业务线程池回收时间
|
protected String |
queueType
线程池类型,默认普通线程池
|
protected String |
serialization
序列化方式
|
protected int |
stopTimeout
服务端关闭超时时间
|
protected boolean |
telnet
是否允许telnet,针对自定义协议
|
protected String |
threadPoolType
线程池类型
|
protected String |
transport
传输层
|
protected String |
virtualHost
镜像ip,例如监听地址是1.2.3.4,告诉注册中心的确是3.4.5.6
|
protected Integer |
virtualPort
镜像端口
|
| 构造器和说明 |
|---|
ServerConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
Server |
buildIfAbsent()
启动服务
|
void |
destroy()
关闭服务
|
boolean |
equals(Object obj)
Equals boolean.
|
int |
getAccepts()
Gets accepts.
|
int |
getAliveTime()
Gets alive time.
|
String |
getBoundHost()
Gets bound host
|
String |
getContextPath()
Gets context path.
|
int |
getCoreThreads()
Gets core threads.
|
String |
getDispatcher()
Gets dispatcher.
|
String |
getHost()
Gets host.
|
int |
getIoThreads()
Gets ioThreads.
|
int |
getMaxThreads()
Gets max threads.
|
List<ChannelListener> |
getOnConnect()
Gets onConnect.
|
Map<String,String> |
getParameters()
Gets parameters.
|
int |
getPayload()
Gets payload.
|
int |
getPort()
Gets port.
|
String |
getProtocol()
Gets protocol.
|
int |
getQueues()
Gets queues.
|
String |
getQueueType()
Gets queue type.
|
String |
getSerialization()
Gets serialization.
|
Server |
getServer()
Gets server.
|
int |
getStopTimeout()
Gets stop timeout.
|
String |
getThreadPoolType()
Gets threadPoolType.
|
String |
getTransport()
Gets transport.
|
String |
getVirtualHost()
Gets virtualHost.
|
Integer |
getVirtualPort()
Gets virtual port.
|
int |
hashCode()
Hash code.
|
boolean |
isAdaptivePort()
Is adaptive port boolean.
|
boolean |
isAutoStart()
Is auto start boolean.
|
boolean |
isDaemon()
Is daemon boolean.
|
boolean |
isEpoll()
Is epoll boolean.
|
boolean |
isPreStartCore()
Is pre start core boolean.
|
boolean |
isTelnet()
Is telnet boolean.
|
ServerConfig |
setAccepts(int accepts)
Sets accepts.
|
ServerConfig |
setAdaptivePort(boolean adaptivePort)
Sets adaptive port.
|
ServerConfig |
setAliveTime(int aliveTime)
Sets alive time.
|
ServerConfig |
setAutoStart(boolean autoStart)
Sets auto start.
|
ServerConfig |
setBoundHost(String boundHost)
Sets bound host.
|
ServerConfig |
setContextPath(String contextPath)
Sets context path.
|
ServerConfig |
setCoreThreads(int coreThreads)
Sets core threads.
|
ServerConfig |
setDaemon(boolean daemon)
Sets daemon.
|
ServerConfig |
setDispatcher(String dispatcher)
Sets dispatcher.
|
ServerConfig |
setEpoll(boolean epoll)
Sets epoll.
|
ServerConfig |
setHost(String host)
Sets host.
|
ServerConfig |
setIoThreads(int ioThreads)
Sets ioThreads.
|
ServerConfig |
setMaxThreads(int maxThreads)
Sets max threads.
|
ServerConfig |
setOnConnect(List<ChannelListener> onConnect)
Sets onConnect.
|
ServerConfig |
setParameters(Map<String,String> parameters)
Sets parameters.
|
ServerConfig |
setPayload(int payload)
Sets payload.
|
ServerConfig |
setPort(int port)
Sets port.
|
ServerConfig |
setPreStartCore(boolean preStartCore)
Sets pre start core.
|
ServerConfig |
setProtocol(String protocol)
Sets protocol.
|
ServerConfig |
setQueues(int queues)
Sets queues.
|
ServerConfig |
setQueueType(String queueType)
Sets queue type.
|
ServerConfig |
setSerialization(String serialization)
Sets serialization.
|
ServerConfig |
setStopTimeout(int stopTimeout)
Sets stop timeout.
|
ServerConfig |
setTelnet(boolean telnet)
Sets telnet.
|
ServerConfig |
setThreadPoolType(String threadPoolType)
Sets threadPoolType.
|
ServerConfig |
setTransport(String transport)
Sets transport.
|
ServerConfig |
setVirtualHost(String virtualHost)
Sets virtualHost.
|
ServerConfig |
setVirtualPort(Integer virtualPort)
Sets virtual port.
|
String |
toString()
To string.
|
castThis, getId, setIdprotected String protocol
protected String host
protected int port
protected String contextPath
protected int ioThreads
protected String threadPoolType
protected int coreThreads
protected int maxThreads
protected boolean telnet
protected String queueType
protected int queues
protected int aliveTime
protected boolean preStartCore
protected int accepts
@Deprecated protected int payload
protected String serialization
@Deprecated protected String dispatcher
protected String virtualHost
protected Integer virtualPort
protected transient List<ChannelListener> onConnect
protected boolean epoll
protected boolean daemon
protected boolean adaptivePort
protected String transport
protected boolean autoStart
protected int stopTimeout
public Server buildIfAbsent()
public void destroy()
public String getProtocol()
public ServerConfig setProtocol(String protocol)
protocol - the protocolpublic String getHost()
public ServerConfig setHost(String host)
host - the hostpublic int getPort()
public ServerConfig setPort(int port)
port - the portpublic String getContextPath()
public ServerConfig setContextPath(String contextPath)
contextPath - the context pathpublic int getIoThreads()
public ServerConfig setIoThreads(int ioThreads)
ioThreads - the ioThreadspublic String getThreadPoolType()
public ServerConfig setThreadPoolType(String threadPoolType)
threadPoolType - the threadPoolTypepublic int getCoreThreads()
public ServerConfig setCoreThreads(int coreThreads)
coreThreads - the core threadspublic int getMaxThreads()
public ServerConfig setMaxThreads(int maxThreads)
maxThreads - the max threadspublic boolean isTelnet()
public ServerConfig setTelnet(boolean telnet)
telnet - the telnetpublic String getQueueType()
public ServerConfig setQueueType(String queueType)
queueType - the queue typepublic int getQueues()
public ServerConfig setQueues(int queues)
queues - the queuespublic int getAliveTime()
public ServerConfig setAliveTime(int aliveTime)
aliveTime - the alive timepublic boolean isPreStartCore()
public ServerConfig setPreStartCore(boolean preStartCore)
preStartCore - the pre start corepublic int getAccepts()
public ServerConfig setAccepts(int accepts)
accepts - the acceptspublic int getPayload()
public ServerConfig setPayload(int payload)
payload - the payloadpublic String getSerialization()
public ServerConfig setSerialization(String serialization)
serialization - the serializationpublic String getDispatcher()
public ServerConfig setDispatcher(String dispatcher)
dispatcher - the dispatcherpublic ServerConfig setParameters(Map<String,String> parameters)
parameters - the parameterspublic String getVirtualHost()
public ServerConfig setVirtualHost(String virtualHost)
virtualHost - the virtualHostpublic Integer getVirtualPort()
public ServerConfig setVirtualPort(Integer virtualPort)
virtualPort - the virtual portpublic List<ChannelListener> getOnConnect()
public ServerConfig setOnConnect(List<ChannelListener> onConnect)
onConnect - the onConnectpublic boolean isEpoll()
public ServerConfig setEpoll(boolean epoll)
epoll - the epollpublic boolean isDaemon()
public ServerConfig setDaemon(boolean daemon)
daemon - the daemonpublic String getTransport()
public ServerConfig setTransport(String transport)
transport - the transportpublic boolean isAdaptivePort()
public ServerConfig setAdaptivePort(boolean adaptivePort)
adaptivePort - the adaptive portpublic boolean isAutoStart()
public ServerConfig setAutoStart(boolean autoStart)
autoStart - the auto startpublic int getStopTimeout()
public ServerConfig setStopTimeout(int stopTimeout)
stopTimeout - the stop timeoutpublic Server getServer()
public ServerConfig setBoundHost(String boundHost)
boundHost - the bound hostpublic String getBoundHost()
public int hashCode()
hashCode 在类中 ObjectObject.hashCode()public boolean equals(Object obj)
equals 在类中 Objectobj - the objObject.equals(Object)public String toString()
toString 在类中 ObjectObject.toString()Copyright © 2008–2018 The Ant Financial. All rights reserved.