K - 请求ID的数据类型, 例如HTTP协议请求标识为url,请求ID的数据类型就是StringC - ContextR - RequestP - ResponseS - Servletpublic abstract class Server<K extends java.io.Serializable,C extends Context,R extends Request<C>,P extends Response<C,R>,S extends Servlet<C,R,P>>
extends java.lang.Object
详情见: http://redkale.org
| 限定符和类型 | 字段和说明 |
|---|---|
protected java.net.InetSocketAddress |
address |
protected int |
backlog |
protected int |
bufferCapacity |
protected int |
bufferPoolSize |
protected java.nio.charset.Charset |
charset |
protected AnyValue |
config |
protected C |
context |
protected java.util.concurrent.ExecutorService |
executor |
protected java.util.logging.Logger |
logger |
protected int |
maxbody |
protected java.lang.String |
name |
protected PrepareServlet<K,C,R,P,S> |
prepare |
protected java.lang.String |
protocol |
protected int |
readTimeoutSecond |
static java.lang.String |
RESNAME_SERVER_ROOT |
protected int |
responsePoolSize |
protected ProtocolServer |
serverChannel |
protected long |
serverStartTime |
protected int |
threads |
protected WatchFactory |
watch |
protected int |
writeTimeoutSecond |
| 限定符 | 构造器和说明 |
|---|---|
protected |
Server(long serverStartTime,
java.lang.String protocol,
PrepareServlet<K,C,R,P,S> servlet,
WatchFactory watch) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addServlet(S servlet,
java.lang.Object attachment,
AnyValue conf,
K... mappings) |
protected abstract C |
createContext() |
protected java.text.Format |
createFormat() |
void |
destroy(AnyValue config) |
java.util.logging.Logger |
getLogger() |
java.lang.String |
getName() |
java.lang.String |
getProtocol() |
java.net.InetSocketAddress |
getSocketAddress() |
void |
init(AnyValue config) |
static java.net.URL[] |
loadLib(java.util.logging.Logger logger,
java.lang.String lib) |
void |
shutdown() |
void |
start() |
public static final java.lang.String RESNAME_SERVER_ROOT
protected final java.util.logging.Logger logger
protected final long serverStartTime
protected final WatchFactory watch
protected java.lang.String name
protected final java.lang.String protocol
protected final PrepareServlet<K extends java.io.Serializable,C extends Context,R extends Request<C>,P extends Response<C,R>,S extends Servlet<C,R,P>> prepare
protected AnyValue config
protected java.nio.charset.Charset charset
protected java.net.InetSocketAddress address
protected int backlog
protected ProtocolServer serverChannel
protected int bufferCapacity
protected int threads
protected java.util.concurrent.ExecutorService executor
protected int bufferPoolSize
protected int responsePoolSize
protected int maxbody
protected int readTimeoutSecond
protected int writeTimeoutSecond
protected Server(long serverStartTime,
java.lang.String protocol,
PrepareServlet<K,C,R,P,S> servlet,
WatchFactory watch)
public void init(AnyValue config) throws java.lang.Exception
java.lang.Exceptionpublic void destroy(AnyValue config) throws java.lang.Exception
java.lang.Exceptionpublic java.net.InetSocketAddress getSocketAddress()
public java.lang.String getName()
public java.lang.String getProtocol()
public java.util.logging.Logger getLogger()
public void addServlet(S servlet, java.lang.Object attachment, AnyValue conf, K... mappings)
public void start()
throws java.io.IOException
java.io.IOExceptionprotected abstract C createContext()
public void shutdown()
throws java.io.IOException
java.io.IOExceptionprotected java.text.Format createFormat()
public static java.net.URL[] loadLib(java.util.logging.Logger logger,
java.lang.String lib)
throws java.lang.Exception
java.lang.Exception