Class JettyServerManager
- java.lang.Object
-
- com.adaptris.core.management.webserver.JettyServerManager
-
- All Implemented Interfaces:
ServerManager
public class JettyServerManager extends java.lang.Object implements ServerManager
Implementation of theServerManager
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.
-
-
Field Summary
Fields Modifier and Type Field 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 propertyinterlok.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 theWebAppContext
should throw an exception or not.
-
Constructor Summary
Constructors Constructor Description JettyServerManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(java.lang.String contextPath)
Method for removing a deployment from the server(s).void
removeDeployment(org.eclipse.jetty.servlet.ServletHolder holder, java.lang.String path)
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.
-
-
-
Field Detail
-
DEFAULT_DESCRIPTOR_XML
public static final java.lang.String DEFAULT_DESCRIPTOR_XML
- See Also:
- Constant Field Values
-
DEFAULT_JETTY_XML
public static final java.lang.String DEFAULT_JETTY_XML
- See Also:
- Constant Field Values
-
SYS_PROP_THROW_UNAVAILABLE_EXCEPTION
public static final java.lang.String SYS_PROP_THROW_UNAVAILABLE_EXCEPTION
System property that controls whether or not starting theWebAppContext
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.
- See Also:
- Constant Field Values
-
CONTEXT_PATH
public static final java.lang.String CONTEXT_PATH
- See Also:
- Constant Field Values
-
SECURITY_CONSTRAINTS
public static final java.lang.String SECURITY_CONSTRAINTS
- See Also:
- Constant Field Values
-
JETTY_DEBUG
public static final boolean JETTY_DEBUG
Enable additional debug logging by specifying the system propertyinterlok.jetty.debug
to true.
-
-
Method Detail
-
addServer
public void addServer(org.eclipse.jetty.server.Server server)
-
removeServer
public void removeServer(org.eclipse.jetty.server.Server server)
-
isStarted
public boolean isStarted()
Description copied from interface:ServerManager
Query whether or not the underlying webserver is started or not.- Specified by:
isStarted
in interfaceServerManager
- Returns:
- true if the underlying webserver is started.
-
addServlet
public void addServlet(javax.servlet.Servlet servlet, java.util.HashMap<java.lang.String,java.lang.Object> additionalProperties) throws java.lang.Exception
Description copied from interface:ServerManager
Method for adding a servlet to the server(s).- Specified by:
addServlet
in interfaceServerManager
- Parameters:
servlet
- - The servlet to be added to the server.additionalProperties
- - Additional properties needed for the deployment.- Throws:
java.lang.Exception
- on exception.
-
addServlet
public void addServlet(org.eclipse.jetty.servlet.ServletHolder servlet, java.util.HashMap<java.lang.String,java.lang.Object> additionalProperties) throws java.lang.Exception
- Throws:
java.lang.Exception
-
removeDeployment
public void removeDeployment(java.lang.String contextPath) throws java.lang.Exception
Description copied from interface:ServerManager
Method for removing a deployment from the server(s). Basically this is for removing a deployment during runtime.- Specified by:
removeDeployment
in interfaceServerManager
- Parameters:
contextPath
- - The context path of the deployment.- Throws:
java.lang.Exception
- on exception.
-
removeDeployment
public void removeDeployment(org.eclipse.jetty.servlet.ServletHolder holder, java.lang.String path) throws java.lang.Exception
- Throws:
java.lang.Exception
-
startDeployment
public void startDeployment(java.lang.String contextPath) throws java.lang.Exception
Description copied from interface:ServerManager
If for any reason a deployment should be started.- Specified by:
startDeployment
in interfaceServerManager
- Throws:
java.lang.Exception
- on exception.
-
stopDeployment
public void stopDeployment(java.lang.String contextPath) throws java.lang.Exception
Description copied from interface:ServerManager
If for any reason a deployment should be stopped.- Specified by:
stopDeployment
in interfaceServerManager
- Throws:
java.lang.Exception
- on exception.
-
-