public class UndertowServer extends java.lang.Object implements ServerLifecycle
限定符和类型 | 字段和说明 |
---|---|
protected io.undertow.Undertow |
_server |
protected java.util.Set<java.lang.Integer> |
addHttpPorts |
protected boolean |
enableHttp2 |
protected HttpServerProps |
props |
protected SslConfig |
sslConfig |
构造器和说明 |
---|
UndertowServer() |
限定符和类型 | 方法和说明 |
---|---|
void |
addHttpPort(int port)
添加 HttpPort(当 ssl 时,可再开个 http 端口)
|
protected io.undertow.server.HttpHandler |
buildHandler() |
void |
enableHttp2(boolean enable)
启用 http2 (不一定所有服务都支持)
|
void |
enableSsl(boolean enable,
javax.net.ssl.SSLContext sslContext)
是否允许Ssl
|
void |
enableWebSocket(boolean enableWebSocket) |
HttpServerProps |
getProps() |
protected java.lang.String |
getResourceRoot() |
protected java.net.URL |
getRootPath() |
protected io.undertow.servlet.api.DeploymentInfo |
initDeploymentInfo() |
boolean |
isSecure() |
boolean |
isSupportedHttp2()
是否支持 http2
|
void |
setExecutor(java.util.concurrent.Executor executor)
设置执行器(线程池)
|
protected void |
setup(java.lang.String host,
int port) |
void |
start(java.lang.String host,
int port)
启动
|
void |
stop()
停止
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
enableDebug, enableSsl
protected io.undertow.Undertow _server
protected HttpServerProps props
protected SslConfig sslConfig
protected boolean enableHttp2
protected java.util.Set<java.lang.Integer> addHttpPorts
public boolean isSecure()
public void enableWebSocket(boolean enableWebSocket)
public void start(java.lang.String host, int port)
ServerLifecycle
start
在接口中 ServerLifecycle
host
- 主机(ip)port
- 端口public void stop() throws java.lang.Throwable
ServerLifecycle
stop
在接口中 ServerLifecycle
java.lang.Throwable
protected void setup(java.lang.String host, int port) throws java.lang.Throwable
java.lang.Throwable
protected io.undertow.server.HttpHandler buildHandler() throws java.lang.Exception
java.lang.Exception
public void enableSsl(boolean enable, @Nullable javax.net.ssl.SSLContext sslContext)
enableSsl
在接口中 HttpServerConfigure
public boolean isSupportedHttp2()
HttpServerConfigure
isSupportedHttp2
在接口中 HttpServerConfigure
public void enableHttp2(boolean enable)
HttpServerConfigure
enableHttp2
在接口中 HttpServerConfigure
public void addHttpPort(int port)
addHttpPort
在接口中 HttpServerConfigure
public void setExecutor(java.util.concurrent.Executor executor)
HttpServerConfigure
setExecutor
在接口中 HttpServerConfigure
public HttpServerProps getProps()
protected io.undertow.servlet.api.DeploymentInfo initDeploymentInfo()
protected java.lang.String getResourceRoot() throws java.io.FileNotFoundException
java.io.FileNotFoundException
protected java.net.URL getRootPath()