Class JettyWebServer
java.lang.Object
org.springframework.boot.web.embedded.jetty.JettyWebServer
- All Implemented Interfaces:
- WebServer
WebServer that can be used to control a Jetty web server.- Since:
- 2.0.0
- Author:
- Phillip Webb, Dave Syer, David Liu, EddĂș MelĂ©ndez, Brian Clozel, Kristine Jetzke
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionJettyWebServer(org.eclipse.jetty.server.Server server) Create a newJettyWebServerinstance.JettyWebServer(org.eclipse.jetty.server.Server server, boolean autoStart) Create a newJettyWebServerinstance.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddestroy()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 web server.voidstart()Starts the web server.voidstop()Stops the web server.
- 
Constructor Details- 
JettyWebServerpublic JettyWebServer(org.eclipse.jetty.server.Server server) Create a newJettyWebServerinstance.- Parameters:
- server- the underlying Jetty server
 
- 
JettyWebServerpublic JettyWebServer(org.eclipse.jetty.server.Server server, boolean autoStart) Create a newJettyWebServerinstance.- Parameters:
- server- the underlying Jetty server
- autoStart- if auto-starting the server
 
 
- 
- 
Method Details- 
startDescription copied from interface:WebServerStarts the web server. Calling this method on an already started server has no effect.- Specified by:
- startin interface- WebServer
- Throws:
- WebServerException- if the server cannot be started
 
- 
stoppublic void stop()Description copied from interface:WebServerStops the web server. Calling this method on an already stopped server has no effect.
- 
destroypublic void destroy()Description copied from interface:WebServerDestroys the web server such that it cannot be started again.
- 
getPortpublic int getPort()Description copied from interface:WebServerReturn the port this server is listening on.
- 
shutDownGracefullyDescription copied from interface:WebServerInitiates a graceful shutdown of the 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 invokingWebServer.stop(). The default implementation invokes the callback immediately withGracefulShutdownResult.IMMEDIATE, i.e. no attempt is made at a graceful shutdown.- Specified by:
- shutDownGracefullyin interface- WebServer
- Parameters:
- callback- the callback to invoke when the graceful shutdown completes
 
- 
getServerpublic org.eclipse.jetty.server.Server getServer()Returns access to the underlying Jetty Server.- Returns:
- the Jetty server
 
 
-