public abstract class AbstractTomcatContainer extends Object implements TomcatContainer
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractTomcatContainer.FilterMapType
The Enum FilterMapType.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.catalina.connector.Connector[] |
connectors
The connectors.
|
protected ObjectName |
deployerOName
The deployer o name.
|
protected org.apache.catalina.Host |
host
The host.
|
protected org.slf4j.Logger |
logger
The logger.
|
protected MBeanServer |
mbeanServer
The mbean server.
|
| Constructor and Description |
|---|
AbstractTomcatContainer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFilterMapping(String filterName,
String dispatcherMap,
String filterClass,
String[] types,
List<FilterMapping> results,
AbstractTomcatContainer.FilterMapType filterMapType)
Adds the filter mapping.
|
void |
bindToContext(org.apache.catalina.Context context)
Binds a naming context to the current thread's classloader.
|
protected void |
checkChanges(String name)
Check changes.
|
protected void |
compileItem(String jspName,
org.apache.jasper.Options opt,
org.apache.catalina.Context ctx,
org.apache.jasper.compiler.JspRuntimeContext jrctx,
Summary summary,
URLClassLoader classLoader,
int level,
boolean compile)
Lists and optionally compiles a directory recursively.
|
protected abstract org.apache.jasper.JspCompilationContext |
createJspCompilationContext(String name,
org.apache.jasper.Options opt,
javax.servlet.ServletContext sctx,
org.apache.jasper.compiler.JspRuntimeContext jrctx,
ClassLoader classLoader)
Creates the jsp compilation context.
|
protected abstract org.apache.catalina.Valve |
createValve()
Creates the valve.
|
void |
discardWorkDir(org.apache.catalina.Context context)
Deletes the "work" directory of the given context.
|
List<org.apache.catalina.connector.Connector> |
findConnectors()
Find connectors.
|
org.apache.catalina.Context |
findContext(String name)
Finds a context based on its path.
|
protected org.apache.catalina.Context |
findContextInternal(String name)
Find context internal.
|
List<org.apache.catalina.Context> |
findContexts()
Find contexts.
|
String |
formatContextFilename(String contextName)
Formats a context name so that it can be used as a step for the context descriptor .xml or
deployed .war file.
|
String |
formatContextName(String name)
Formats a context name to a path that the container will recognize.
|
File |
getAppBase()
This method always returns absolute path, no matter what Tomcat is up to.
|
boolean |
getAvailable(org.apache.catalina.Context context)
Gets the available.
|
String |
getConfigBase()
Gets the config base.
|
File |
getConfigFile(org.apache.catalina.Context context)
Returns the context descriptor filename for the given context.
|
String |
getHostName()
Gets the host name.
|
String |
getName()
Gets the name.
|
protected abstract Object |
getNamingToken(org.apache.catalina.Context context)
Returns the security token required to bind to a naming context.
|
String |
getServletFileNameForJsp(org.apache.catalina.Context context,
String jspName)
Returns the JSP servlet filename for the given JSP file.
|
boolean |
installContext(String contextName)
Deploys a context, assuming an context descriptor file exists on the server already.
|
void |
installWar(String name,
URL url)
Installs .war file at the given context name.
|
void |
listContextJsps(org.apache.catalina.Context context,
Summary summary,
boolean compile)
Lists and optionally compiles all JSPs for the given context.
|
void |
recompileJsps(org.apache.catalina.Context context,
Summary summary,
List<String> names)
Compiles a list of JSPs.
|
protected void |
registerGlobalResourceAccess(org.apache.tomcat.util.descriptor.web.ContextResourceLink resourceLink)
Register access to global resources.
|
void |
remove(String name)
Undeploys a context.
|
void |
setWrapper(org.apache.catalina.Wrapper wrapper)
Sets the wrapper.
|
void |
start(String name)
Starts the context with the given name.
|
void |
stop(String name)
Stops the context with the given name.
|
void |
unbindFromContext(org.apache.catalina.Context context)
Unbinds a naming context from the current thread's classloader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddContextResource, addContextResourceLink, canBoundTo, getApplicationFilterMaps, getApplicationFilters, getApplicationInitParams, getResourceAttributes, getResourceStream, resourceExistsprotected final org.slf4j.Logger logger
protected org.apache.catalina.Host host
protected org.apache.catalina.connector.Connector[] connectors
protected ObjectName deployerOName
protected MBeanServer mbeanServer
public void setWrapper(org.apache.catalina.Wrapper wrapper)
TomcatContainersetWrapper in interface TomcatContainerwrapper - the new wrapperpublic File getAppBase()
TomcatContainergetAppBase in interface TomcatContainerpublic String getConfigBase()
TomcatContainergetConfigBase in interface TomcatContainerpublic String getHostName()
TomcatContainergetHostName in interface TomcatContainerpublic String getName()
TomcatContainergetName in interface TomcatContainerpublic List<org.apache.catalina.Context> findContexts()
TomcatContainerfindContexts in interface TomcatContainerpublic List<org.apache.catalina.connector.Connector> findConnectors()
TomcatContainerfindConnectors in interface TomcatContainerpublic boolean installContext(String contextName) throws Exception
TomcatContainerinstallContext in interface TomcatContainercontextName - the context path, which should match the filenametrue if deployment was successfulException - if deployment fails spectacularlypublic void stop(String name) throws Exception
TomcatContainerstop in interface TomcatContainername - the name of the context to stopException - if stopping the context fails spectacularlypublic void start(String name) throws Exception
TomcatContainerstart in interface TomcatContainername - the name of the context to startException - if starting the context fails spectacularlypublic void remove(String name) throws Exception
TomcatContainerremove in interface TomcatContainername - the context pathException - if undeployment fails spectacularlypublic void installWar(String name, URL url) throws Exception
TomcatContainerinstallWar in interface TomcatContainername - the name of the contexturl - pointer to .war file to be deployedException - if installing the .war fails spectacularlypublic org.apache.catalina.Context findContext(String name)
TomcatContainerfindContext in interface TomcatContainername - the context pathpublic String formatContextName(String name)
TomcatContainer/ character, although there is special behavior for the root context.formatContextName in interface TomcatContainername - the context namepublic String formatContextFilename(String contextName)
TomcatContainer/ character, although there
is special behavior for the root context.formatContextFilename in interface TomcatContainercontextName - the context namepublic void discardWorkDir(org.apache.catalina.Context context)
TomcatContainerdiscardWorkDir in interface TomcatContainercontext - the contextpublic String getServletFileNameForJsp(org.apache.catalina.Context context, String jspName)
TomcatContainergetServletFileNameForJsp in interface TomcatContainercontext - the contextjspName - the JSP filenamepublic void recompileJsps(org.apache.catalina.Context context,
Summary summary,
List<String> names)
TomcatContainerrecompileJsps in interface TomcatContainercontext - the contextsummary - the summary in which the output is storednames - the list of JSPs to compilepublic void listContextJsps(org.apache.catalina.Context context,
Summary summary,
boolean compile)
TomcatContainerlistContextJsps in interface TomcatContainercontext - the contextsummary - the summary in which the output is storedcompile - whether to compile all of the JSPs or notpublic boolean getAvailable(org.apache.catalina.Context context)
TomcatContainergetAvailable in interface TomcatContainercontext - the contextpublic File getConfigFile(org.apache.catalina.Context context)
TomcatContainergetConfigFile in interface TomcatContainercontext - the contextnullpublic void bindToContext(org.apache.catalina.Context context)
throws NamingException
TomcatContainerbindToContext in interface TomcatContainercontext - the catalina contextNamingException - if binding the classloader failspublic void unbindFromContext(org.apache.catalina.Context context)
throws NamingException
TomcatContainerunbindFromContext in interface TomcatContainercontext - the catalina contextNamingException - if unbinding the classloader failsprotected void registerGlobalResourceAccess(org.apache.tomcat.util.descriptor.web.ContextResourceLink resourceLink)
resourceLink - the resource linkprotected void compileItem(String jspName, org.apache.jasper.Options opt, org.apache.catalina.Context ctx, org.apache.jasper.compiler.JspRuntimeContext jrctx, Summary summary, URLClassLoader classLoader, int level, boolean compile)
jspName - name of JSP file or directory to be listed and compiled.opt - the JSP compiler optionsctx - the contextjrctx - the runtime context used to create the compilation contextsummary - the summary in which the output is storedclassLoader - the classloader used by the compilerlevel - the depth in the tree at which the item was encounteredcompile - whether or not to compile the item or just to check whether it's out of dateprotected org.apache.catalina.Context findContextInternal(String name)
name - the context nameprotected void checkChanges(String name) throws Exception
name - the nameException - the exceptionprotected abstract Object getNamingToken(org.apache.catalina.Context context)
context - the catalina contextContextBindingsprotected abstract org.apache.jasper.JspCompilationContext createJspCompilationContext(String name, org.apache.jasper.Options opt, javax.servlet.ServletContext sctx, org.apache.jasper.compiler.JspRuntimeContext jrctx, ClassLoader classLoader)
name - the nameopt - the optsctx - the sctxjrctx - the jrctxclassLoader - the class loaderprotected abstract org.apache.catalina.Valve createValve()
protected void addFilterMapping(String filterName, String dispatcherMap, String filterClass, String[] types, List<FilterMapping> results, AbstractTomcatContainer.FilterMapType filterMapType)
filterName - the filter namedispatcherMap - the dispatcher mapfilterClass - the filter classtypes - the types as urls or servlet nameresults - the resultsfilterMapType - the filter map typeCopyright © 2009–2020 psi-probe. All rights reserved.