类 JettyWebServer
java.lang.Object
org.springframework.boot.web.embedded.jetty.JettyWebServer
- 所有已实现的接口:
WebServer
WebServer that can be used to control a Jetty web server.- 从以下版本开始:
- 2.0.0
- 作者:
- Phillip Webb, Dave Syer, David Liu, Eddú Meléndez, Brian Clozel, Kristine Jetzke
- 另请参阅:
-
构造器概要
构造器构造器说明JettyWebServer(org.eclipse.jetty.server.Server server) Create a newJettyWebServerinstance.JettyWebServer(org.eclipse.jetty.server.Server server, boolean autoStart) Create a newJettyWebServerinstance. -
方法概要
修饰符和类型方法说明voiddestroy()Destroys the web server such that it cannot be started again.intgetPort()Return the port this server is listening on.org.eclipse.jetty.server.ServerReturns access to the underlying Jetty Server.voidshutDownGracefully(GracefulShutdownCallback callback) Initiates a graceful shutdown of the Jetty web server.voidstart()Starts the web server.voidstop()Stops the web server.
-
构造器详细资料
-
JettyWebServer
public JettyWebServer(org.eclipse.jetty.server.Server server) Create a newJettyWebServerinstance.- 参数:
server- the underlying Jetty server
-
JettyWebServer
public JettyWebServer(org.eclipse.jetty.server.Server server, boolean autoStart) Create a newJettyWebServerinstance.- 参数:
server- the underlying Jetty serverautoStart- if auto-starting the server
-
-
方法详细资料
-
start
从接口复制的说明:WebServerStarts the web server. Calling this method on an already started server has no effect.- 指定者:
start在接口中WebServer- 抛出:
WebServerException- if the server cannot be started
-
stop
public void stop()从接口复制的说明:WebServerStops the web server. Calling this method on an already stopped server has no effect. -
destroy
public void destroy()从接口复制的说明:WebServerDestroys the web server such that it cannot be started again. -
getPort
public int getPort()从接口复制的说明:WebServerReturn the port this server is listening on. -
shutDownGracefully
Initiates a graceful shutdown of the Jetty web server. Handling of new requests is prevented and the givencallbackis invoked at the end of the attempt. The attempt can be explicitly ended by invokingstop().Once shutdown has been initiated Jetty will reject any new connections. Requests on existing connections will be accepted, however, a
Connection: closeheader will be returned in the response.- 指定者:
shutDownGracefully在接口中WebServer- 参数:
callback- the callback to invoke when the graceful shutdown completes
-
getServer
public org.eclipse.jetty.server.Server getServer()Returns access to the underlying Jetty Server.- 返回:
- the Jetty server
-