public class SmHttpServerComb extends java.lang.Object implements HttpServerConfigure, ServerLifecycle
| 限定符和类型 | 字段和说明 | 
|---|---|
protected java.util.Set<java.lang.Integer> | 
addHttpPorts  | 
protected int | 
coreThreads  | 
protected boolean | 
enableDebug  | 
protected boolean | 
enableSsl  | 
protected boolean | 
enableWebSocket  | 
protected Handler | 
handler  | 
protected HttpServerProps | 
props  | 
protected java.util.List<SmHttpServer> | 
servers  | 
protected javax.net.ssl.SSLContext | 
sslContext  | 
protected java.util.concurrent.Executor | 
workExecutor  | 
| 构造器和说明 | 
|---|
SmHttpServerComb(HttpServerProps props)  | 
| 限定符和类型 | 方法和说明 | 
|---|---|
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, waitenableHttp2, enableSsl, isSupportedHttp2protected final HttpServerProps props
protected int coreThreads
protected java.util.concurrent.Executor workExecutor
protected boolean enableWebSocket
protected Handler handler
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 SmHttpServerComb(HttpServerProps props)
public void enableSsl(boolean enable,
                      javax.net.ssl.SSLContext sslContext)
enableSsl 在接口中 HttpServerConfigurepublic void enableDebug(boolean enable)
HttpServerConfigureenableDebug 在接口中 HttpServerConfigurepublic void addHttpPort(int port)
addHttpPort 在接口中 HttpServerConfigurepublic void setHandler(Handler handler)
public void setCoreThreads(int coreThreads)
public void setExecutor(java.util.concurrent.Executor executor)
HttpServerConfiguresetExecutor 在接口中 HttpServerConfigurepublic void enableWebSocket(boolean enableWebSocket)
public boolean isSecure()
public void start(java.lang.String host,
                  int port)
           throws java.lang.Throwable
ServerLifecyclestart 在接口中 ServerLifecyclehost - 主机(ip)port - 端口java.lang.Throwablepublic void stop()
          throws java.lang.Throwable
ServerLifecyclestop 在接口中 ServerLifecyclejava.lang.Throwable