public class JettyServer extends java.lang.Object implements ServerLifecycle
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Set<java.lang.Integer> |
addHttpPorts |
protected boolean |
enableSessionState |
protected boolean |
enableWebSocket |
protected java.util.concurrent.Executor |
executor |
protected HttpServerProps |
props |
protected org.eclipse.jetty.server.Server |
real |
protected SslConfig |
sslConfig |
构造器和说明 |
---|
JettyServer() |
限定符和类型 | 方法和说明 |
---|---|
void |
addHttpPort(int port)
添加 HttpPort(当 ssl 时,可再开个 http 端口)
|
protected org.eclipse.jetty.server.Handler |
buildHandler()
获取Server Handler
|
void |
enableSessionState(boolean enableSessionState) |
void |
enableSsl(boolean enable,
javax.net.ssl.SSLContext sslContext)
是否允许Ssl
|
void |
enableWebSocket(boolean enableWebSocket) |
protected org.eclipse.jetty.server.ServerConnector |
getConnector(org.eclipse.jetty.server.Server server,
java.lang.String host,
int port,
boolean autoSsl)
创建连接器(支持https)
|
HttpServerProps |
getProps() |
protected org.eclipse.jetty.servlet.ServletContextHandler |
getServletHandler() |
boolean |
isSecure() |
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, enableHttp2, enableSsl, isSupportedHttp2
protected org.eclipse.jetty.server.Server real
protected boolean enableWebSocket
protected java.util.concurrent.Executor executor
protected HttpServerProps props
protected SslConfig sslConfig
protected boolean enableSessionState
protected java.util.Set<java.lang.Integer> addHttpPorts
public void enableWebSocket(boolean enableWebSocket)
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
protected void setup(java.lang.String host, int port) throws java.io.IOException
java.io.IOException
protected org.eclipse.jetty.server.Handler buildHandler() throws java.io.IOException
java.io.IOException
public boolean isSecure()
public void enableSessionState(boolean enableSessionState)
public void enableSsl(boolean enable, javax.net.ssl.SSLContext sslContext)
enableSsl
在接口中 HttpServerConfigure
public void addHttpPort(int port)
addHttpPort
在接口中 HttpServerConfigure
public HttpServerProps getProps()
public void setExecutor(java.util.concurrent.Executor executor)
HttpServerConfigure
setExecutor
在接口中 HttpServerConfigure
protected org.eclipse.jetty.server.ServerConnector getConnector(org.eclipse.jetty.server.Server server, java.lang.String host, int port, boolean autoSsl) throws java.lang.RuntimeException
java.lang.RuntimeException
protected org.eclipse.jetty.servlet.ServletContextHandler getServletHandler() throws java.io.IOException
java.io.IOException