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 boolean |
enableWebSocket |
protected boolean |
isSecure |
protected HttpServerProps |
props |
protected SslConfig |
sslConfig |
| 构造器和说明 |
|---|
UndertowServer(HttpServerProps props) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 |
isEnableHttp2() |
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, waitenableDebug, enableSslprotected io.undertow.Undertow _server
protected boolean isSecure
protected boolean enableWebSocket
protected final HttpServerProps props
protected SslConfig sslConfig
protected java.util.Set<java.lang.Integer> addHttpPorts
protected boolean enableHttp2
public UndertowServer(HttpServerProps props)
public boolean isSecure()
public void enableWebSocket(boolean enableWebSocket)
public void start(java.lang.String host,
int port)
ServerLifecyclestart 在接口中 ServerLifecyclehost - 主机(ip)port - 端口public void stop()
throws java.lang.Throwable
ServerLifecyclestop 在接口中 ServerLifecyclejava.lang.Throwableprotected void setup(java.lang.String host,
int port)
throws java.lang.Throwable
java.lang.Throwableprotected io.undertow.server.HttpHandler buildHandler()
throws java.lang.Exception
java.lang.Exceptionpublic void enableSsl(boolean enable,
@Nullable
javax.net.ssl.SSLContext sslContext)
enableSsl 在接口中 HttpServerConfigurepublic boolean isSupportedHttp2()
HttpServerConfigureisSupportedHttp2 在接口中 HttpServerConfigurepublic void enableHttp2(boolean enable)
HttpServerConfigureenableHttp2 在接口中 HttpServerConfigurepublic boolean isEnableHttp2()
public void addHttpPort(int port)
addHttpPort 在接口中 HttpServerConfigurepublic void setExecutor(java.util.concurrent.Executor executor)
HttpServerConfiguresetExecutor 在接口中 HttpServerConfigurepublic HttpServerProps getProps()
protected io.undertow.servlet.api.DeploymentInfo initDeploymentInfo()
protected java.lang.String getResourceRoot()
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprotected java.net.URL getRootPath()