public class JettyServerManager extends java.lang.Object implements ServerManager
ServerManager
interface for managing Jetty servers.
This class only deals with a specific handler structure. The uppermost handler must be a HandlerCollection and we add the deployment to all of it's appropriate childhandlers.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXT_PATH |
static java.lang.String |
DEFAULT_DESCRIPTOR_XML |
static java.lang.String |
DEFAULT_JETTY_XML |
static boolean |
JETTY_DEBUG
Enable additional debug logging by specifying the system property
interlok.jetty.debug
to true. |
static java.lang.String |
SECURITY_CONSTRAINTS |
static java.lang.String |
SYS_PROP_THROW_UNAVAILABLE_EXCEPTION
System property that controls whether or not starting the
WebAppContext should throw an exception or not. |
Constructor and Description |
---|
JettyServerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addServer(org.eclipse.jetty.server.Server server) |
void |
addServlet(javax.servlet.Servlet servlet,
java.util.HashMap<java.lang.String,java.lang.Object> additionalProperties)
Method for adding a servlet to the server(s).
|
void |
addServlet(org.eclipse.jetty.servlet.ServletHolder servlet,
java.util.HashMap<java.lang.String,java.lang.Object> additionalProperties) |
boolean |
isStarted()
Query whether or not the underlying webserver is started or not.
|
void |
removeDeployment(org.eclipse.jetty.servlet.ServletHolder holder,
java.lang.String path) |
void |
removeDeployment(java.lang.String contextPath)
Method for removing a deployment from the server(s).
|
void |
removeServer(org.eclipse.jetty.server.Server server) |
void |
startDeployment(java.lang.String contextPath)
If for any reason a deployment should be started.
|
void |
stopDeployment(java.lang.String contextPath)
If for any reason a deployment should be stopped.
|
public static final java.lang.String DEFAULT_DESCRIPTOR_XML
public static final java.lang.String DEFAULT_JETTY_XML
public static final java.lang.String SYS_PROP_THROW_UNAVAILABLE_EXCEPTION
WebAppContext
should throw an exception or not.
The default is false for backwards compatibility; but can be toggled to true; it will be defaulted to true in a future release.
public static final java.lang.String CONTEXT_PATH
public static final java.lang.String SECURITY_CONSTRAINTS
public static final boolean JETTY_DEBUG
interlok.jetty.debug
to true.public void addServer(org.eclipse.jetty.server.Server server)
public void removeServer(org.eclipse.jetty.server.Server server)
public boolean isStarted()
ServerManager
isStarted
in interface ServerManager
public void addServlet(javax.servlet.Servlet servlet, java.util.HashMap<java.lang.String,java.lang.Object> additionalProperties) throws java.lang.Exception
ServerManager
addServlet
in interface ServerManager
servlet
- - The servlet to be added to the server.additionalProperties
- - Additional properties needed for the deployment.java.lang.Exception
- on exception.public void addServlet(org.eclipse.jetty.servlet.ServletHolder servlet, java.util.HashMap<java.lang.String,java.lang.Object> additionalProperties) throws java.lang.Exception
java.lang.Exception
public void removeDeployment(java.lang.String contextPath) throws java.lang.Exception
ServerManager
removeDeployment
in interface ServerManager
contextPath
- - The context path of the deployment.java.lang.Exception
- on exception.public void removeDeployment(org.eclipse.jetty.servlet.ServletHolder holder, java.lang.String path) throws java.lang.Exception
java.lang.Exception
public void startDeployment(java.lang.String contextPath) throws java.lang.Exception
ServerManager
startDeployment
in interface ServerManager
java.lang.Exception
- on exception.public void stopDeployment(java.lang.String contextPath) throws java.lang.Exception
ServerManager
stopDeployment
in interface ServerManager
java.lang.Exception
- on exception.