public interface ServletService extends ADEPT2Service
ServletService provides the means to publish a servlet at
runtime. The servlet has to be created by the caller.| Modifier and Type | Method and Description |
|---|---|
java.net.URL |
deployWebApp(java.lang.String hierarchicalContext,
java.lang.Class<?> baseClass,
DynamicServlet servlet,
java.util.Map<java.lang.String,java.lang.String> initParams,
java.util.Map<java.lang.String,java.lang.Object> contextAttrs,
java.lang.String urlMapping)
Deploys the designated servlet via this service with the designated
hierarchical context having the designated servlet context attributes.
|
java.net.URL |
deployWebApp(java.lang.String hierarchicalContext,
DynamicServlet servlet,
java.util.Map<java.lang.String,java.lang.Object> contextAttrs)
Deploys the designated servlet via this service with the designated
hierarchical context having the designated servlet context attributes.
|
java.net.URL |
getBaseURL()
Gets the base URL (without any context information) of the underlying
servlet container.
|
void |
undeployWebApp(java.lang.String hierarchicalContext,
java.lang.String servletName)
Undeploys the designated servlet deployed with the designated hierarchical
context and servlet name.
|
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, startjava.net.URL getBaseURL()
java.net.URL deployWebApp(java.lang.String hierarchicalContext,
DynamicServlet servlet,
java.util.Map<java.lang.String,java.lang.Object> contextAttrs)
throws ServletDeploymentException
Note that in case of an embedded servlet service, that is this service running within a servlet context, deploying service has to take place before the surrounding servlet context has been initialised.
hierarchicalContext - The hierarchical context of the servlet. This
corresponds to the file or directory name when deploying in the
file system (no trailing "/").servlet - The servlet which to deploy dynamically. Make sure that the
servlet name is set appropriately since this is required for
undeploying.contextAttrs - The attributes added to the servlet context when
deploying the servlet. Make sure that the keys are unique! In case
of an embedded servlet service, all servlets will have the very
same context. This may be null.ServletDeploymentException - If there are problems deploying the
designated servlet, a ServletDeploymentException
having no cause will be thrown, otherwise the causing exception
will be wrapped (mostly problems with URL-encoding or servlet
container configuration.java.net.URL deployWebApp(java.lang.String hierarchicalContext,
java.lang.Class<?> baseClass,
DynamicServlet servlet,
java.util.Map<java.lang.String,java.lang.String> initParams,
java.util.Map<java.lang.String,java.lang.Object> contextAttrs,
java.lang.String urlMapping)
throws ServletDeploymentException
Note that in case of an embedded servlet service, that is this service running within a servlet context, deploying service has to take place before the surrounding servlet context has been initialised.
hierarchicalContext - The hierarchical context of the servlet. This
corresponds to the file or directory name when deploying in the
file system (no trailing "/").baseClass - The class with which to load resources. This allows to
have a WEB-INF-directory which is not at the
top-level. It is expected to be besides this class. If this is
null, the usual behaviour applies which is a
top-level WEB-INF-directory.servlet - The servlet which to deploy dynamically. Make sure that the
servlet name is set appropriately since this is required for
undeploying.initParams - The init parameters of the servlet. This may be
null.contextAttrs - The attributes added to the servlet context when
deploying the servlet. Make sure that the keys are unique! In case
of an embedded servlet service, all servlets will have the very
same context. This may be null.urlMapping - The mapping for the designated servlet. This corresponds
to URL-pattern in the deployment descriptor. If this is
null, the default mapping "/" will be used.ServletDeploymentException - If there are problems deploying the
designated servlet, a ServletDeploymentException
having no cause will be thrown, otherwise the causing exception
will be wrapped (mostly problems with URL-encoding or servlet
container configuration.void undeployWebApp(java.lang.String hierarchicalContext,
java.lang.String servletName)
throws ServletDeploymentException
hierarchicalContext - The hierarchical context with which the servlet
has been deployed.servletName - The name of the servlet which to undeploy.ServletDeploymentException - If there are problems undeploying the
designated web application, a
ServletDeploymentException will be thrown. If this
is due to undeploying a non existing web application, it will
have no cause, problems when stopping the servlet will have the
appropriate cause.