public class SmHttpServer extends java.lang.Object implements ServerLifecycle
限定符和类型 | 字段和说明 |
---|---|
protected int |
coreThreads |
protected boolean |
enableDebug |
protected boolean |
enableWebSocket |
protected Handler |
handler |
protected boolean |
isSecure |
protected HttpServerProps |
props |
protected org.smartboot.http.server.HttpBootstrap |
server |
protected SslConfig |
sslConfig |
protected java.util.concurrent.Executor |
workExecutor |
构造器和说明 |
---|
SmHttpServer(HttpServerProps props) |
限定符和类型 | 方法和说明 |
---|---|
void |
enableDebug(boolean enable) |
void |
enableSsl(boolean enable,
javax.net.ssl.SSLContext sslContext) |
void |
enableWebSocket(boolean enableWebSocket) |
boolean |
isSecure() |
void |
setCoreThreads(int coreThreads) |
void |
setHandler(Handler handler) |
void |
setWorkExecutor(java.util.concurrent.Executor executor) |
void |
start(java.lang.String host,
int port)
启动
|
void |
stop()
停止
|
protected final HttpServerProps props
protected org.smartboot.http.server.HttpBootstrap server
protected Handler handler
protected int coreThreads
protected java.util.concurrent.Executor workExecutor
protected boolean enableWebSocket
protected SslConfig sslConfig
protected boolean enableDebug
protected boolean isSecure
public SmHttpServer(HttpServerProps props)
public boolean isSecure()
public void enableSsl(boolean enable, @Nullable javax.net.ssl.SSLContext sslContext)
public void enableDebug(boolean enable)
public void enableWebSocket(boolean enableWebSocket)
public void setHandler(Handler handler)
public void setWorkExecutor(java.util.concurrent.Executor executor)
public void setCoreThreads(int coreThreads)
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