public class SmHttpServerComb extends java.lang.Object implements HttpServerConfigure, ServerLifecycle
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Set<java.lang.Integer> |
addHttpPorts |
protected boolean |
enableDebug |
protected boolean |
enableSsl |
protected java.util.List<SmHttpServer> |
servers |
protected javax.net.ssl.SSLContext |
sslContext |
构造器和说明 |
---|
SmHttpServerComb() |
限定符和类型 | 方法和说明 |
---|---|
void |
addHttpPort(int port)
添加 HttpPort(当 ssl 时,可再开个 http 端口)
|
void |
enableDebug(boolean enable)
启用调试模式 (不一定所有服务都支持)
|
void |
enableSsl(boolean enable,
javax.net.ssl.SSLContext sslContext)
是否允许Ssl
|
void |
enableWebSocket(boolean enableWebSocket) |
boolean |
isSecure() |
void |
setCoreThreads(int coreThreads) |
void |
setExecutor(java.util.concurrent.Executor executor)
设置执行器(线程池)
|
void |
setHandler(Handler handler) |
void |
start(java.lang.String host,
int port)
启动
|
void |
stop()
停止
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enableHttp2, enableSsl, isSupportedHttp2
protected boolean enableSsl
protected javax.net.ssl.SSLContext sslContext
protected boolean enableDebug
protected java.util.Set<java.lang.Integer> addHttpPorts
protected java.util.List<SmHttpServer> servers
public void enableSsl(boolean enable, javax.net.ssl.SSLContext sslContext)
enableSsl
在接口中 HttpServerConfigure
public void enableDebug(boolean enable)
HttpServerConfigure
enableDebug
在接口中 HttpServerConfigure
public void addHttpPort(int port)
addHttpPort
在接口中 HttpServerConfigure
public void setHandler(Handler handler)
public void setCoreThreads(int coreThreads)
public void setExecutor(java.util.concurrent.Executor executor)
HttpServerConfigure
setExecutor
在接口中 HttpServerConfigure
public void enableWebSocket(boolean enableWebSocket)
public boolean isSecure()
public void start(java.lang.String host, int port) throws java.lang.Throwable
ServerLifecycle
start
在接口中 ServerLifecycle
host
- 主机(ip)port
- 端口java.lang.Throwable
public void stop() throws java.lang.Throwable
ServerLifecycle
stop
在接口中 ServerLifecycle
java.lang.Throwable