public class JettyEmbeddedServletContainer extends Object implements EmbeddedServletContainer
EmbeddedServletContainer
that can be used to control an embedded Jetty server.
Usually this class should be created using the
JettyEmbeddedServletContainerFactory
and not directly.JettyEmbeddedServletContainerFactory
Constructor and Description |
---|
JettyEmbeddedServletContainer(org.eclipse.jetty.server.Server server)
Create a new
JettyEmbeddedServletContainer instance. |
JettyEmbeddedServletContainer(org.eclipse.jetty.server.Server server,
boolean autoStart)
Create a new
JettyEmbeddedServletContainer instance. |
Modifier and Type | Method and Description |
---|---|
int |
getPort()
Return the port this server is listening on.
|
org.eclipse.jetty.server.Server |
getServer()
Returns access to the underlying Jetty Server.
|
void |
start()
Starts the embedded servlet container.
|
void |
stop()
Stops the embedded servlet container.
|
public JettyEmbeddedServletContainer(org.eclipse.jetty.server.Server server)
JettyEmbeddedServletContainer
instance.server
- the underlying Jetty serverpublic JettyEmbeddedServletContainer(org.eclipse.jetty.server.Server server, boolean autoStart)
JettyEmbeddedServletContainer
instance.server
- the underlying Jetty serverautoStart
- if auto-starting the containerpublic void start() throws EmbeddedServletContainerException
EmbeddedServletContainer
start
in interface EmbeddedServletContainer
EmbeddedServletContainerException
- if the container cannot be startedpublic void stop()
EmbeddedServletContainer
stop
in interface EmbeddedServletContainer
public int getPort()
EmbeddedServletContainer
getPort
in interface EmbeddedServletContainer
public org.eclipse.jetty.server.Server getServer()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.