Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.catalina.core.ContainerBase
org.apache.catalina.core.StandardHost
Nested Class Summary |
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase | |
ContainerBase.ContainerBackgroundProcessor , ContainerBase.PrivilegedAddChild |
Field Summary |
Fields inherited from class org.apache.catalina.core.ContainerBase | |
backgroundProcessorDelay , children , cluster , controller , debug , domain , initialized , lifecycle , listeners , loader , logger , manager , mserver , name , oname , parent , parentClassLoader , pipeline , realm , resources , sm , started , suffix , support , type |
Fields inherited from interface org.apache.catalina.Container | |
ADD_CHILD_EVENT , ADD_MAPPER_EVENT , ADD_VALVE_EVENT , REMOVE_CHILD_EVENT , REMOVE_MAPPER_EVENT , REMOVE_VALVE_EVENT |
Fields inherited from interface org.apache.catalina.Deployer | |
INSTALL_EVENT , PRE_INSTALL_EVENT , REMOVE_EVENT |
Fields inherited from interface org.apache.catalina.Host | |
ADD_ALIAS_EVENT , REMOVE_ALIAS_EVENT |
Fields inherited from interface org.apache.catalina.Lifecycle | |
AFTER_START_EVENT , AFTER_STOP_EVENT , BEFORE_START_EVENT , BEFORE_STOP_EVENT , START_EVENT , STOP_EVENT |
Constructor Summary | |
|
Method Summary | |
void |
|
void | |
void |
|
void |
|
ObjectName |
|
String[] |
|
Context |
|
String[] |
|
String[] | |
String |
|
boolean |
|
String |
|
String |
|
DefaultContext |
|
boolean |
|
Deployer | |
String |
|
String |
|
boolean |
|
String |
|
String[] |
|
String |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
boolean |
|
Context |
|
ObjectName |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
public void addAlias(String alias)
Add an alias name that should be mapped to this same Host.
- Parameters:
alias
- The alias to be added
public void addChild(Container child)
Add a child Container, only if the proposed child is an implementation of Context.
- Overrides:
- addChild in interface ContainerBase
- Parameters:
child
- Child container to be added
public void addDefaultContext(DefaultContext defaultContext)
Set the DefaultContext for new web applications.
- Specified by:
- addDefaultContext in interface Host
- Parameters:
defaultContext
- The new DefaultContext
public void backgroundProcess()
Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.
- Specified by:
- backgroundProcess in interface Container
- Overrides:
- backgroundProcess in interface ContainerBase
public ObjectName createObjectName(String domain, ObjectName parent) throws Exception
- Overrides:
- createObjectName in interface ContainerBase
public String[] findAliases()
Return the set of alias names for this Host. If none are defined, a zero length array is returned.
- Specified by:
- findAliases in interface Host
public Context findDeployedApp(String contextPath)
Return the Context for the deployed application that is associated with the specified context path (if any); otherwise returnnull
.
- Specified by:
- findDeployedApp in interface Deployer
- Parameters:
contextPath
- The context path of the requested web application
public String[] findDeployedApps()
Return the context paths of all deployed web applications in this Container. If there are no deployed applications, a zero-length array is returned.
- Specified by:
- findDeployedApps in interface Deployer
public String[] getAliases()
public String getAppBase()
Return the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.
- Specified by:
- getAppBase in interface Host
public boolean getAutoDeploy()
Return the value of the auto deploy flag. If true, it indicates that this host's child webapps will be dynamically deployed.
- Specified by:
- getAutoDeploy in interface Host
public String getConfigClass()
Return the Java class name of the context configuration class for new web applications.
public String getContextClass()
Return the Java class name of the Context implementation class for new web applications.
public DefaultContext getDefaultContext()
Retrieve the DefaultContext for new web applications.
- Specified by:
- getDefaultContext in interface Host
public boolean getDeployOnStartup()
Return the value of the deploy on startup flag. If true, it indicates that this host's child webapps should be discovred and automatically deployed at startup time.
- Specified by:
- getDeployOnStartup in interface Host
public String getErrorReportValveClass()
Return the Java class name of the error report valve class for new web applications.
public String getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format<description>/<version>
.
- Overrides:
- getInfo in interface ContainerBase
public boolean getLiveDeploy()
Return the value of the live deploy flag. If true, it indicates that a background thread should be started that looks for web application context files, WAR files, or unpacked directories being dropped in to theappBase
directory, and deploys new ones as they are encountered.
public String getName()
Return the canonical, fully qualified, name of the virtual host this Container represents.
- Overrides:
- getName in interface ContainerBase
public String[] getValveNames() throws Exception
Return the MBean Names of the Valves assoicated with this Host
public String getWorkDir()
Host work directory base.
public boolean getXmlNamespaceAware()
Get the server.xmlattribute's xmlNamespaceAware.
- Specified by:
- getXmlNamespaceAware in interface Host
- Returns:
- true if namespace awarenes is enabled.
public boolean getXmlValidation()
Get the server.xmlattribute's xmlValidation.
- Specified by:
- getXmlValidation in interface Host
- Returns:
- true if validation is enabled.
public void importDefaultContext(Context context)
Import the DefaultContext config into a web application context.
- Specified by:
- importDefaultContext in interface Host
- Parameters:
context
- web application context to import default context
public void install(String contextPath, URL war) throws IOException
Install a new web application, whose web application archive is at the specified URL, into this container with the specified context path. A context path of "" (the empty string) should be used for the root application for this container. Otherwise, the context path must start with a slash. If this application is successfully installed, a ContainerEvent of typeINSTALL_EVENT
will be sent to all registered listeners, with the newly createdContext
as an argument.
- Parameters:
contextPath
- The context path to which this application should be installed (must be unique)war
- A URL of type "jar:" that points to a WAR file, or type "file:" that points to an unpacked directory structure containing the web application to be installed
public void install(URL war) throws IOException
Installs a new web application from the web application archive at the specified URL, which must contain a META-INF/context.xml context configuration file (consisting of a<Context>
element). The web application is installed at the path specified inside the embedded META-INF/context.xml. The docBase (if any) specified inside the embedded META-INF/context.xml is overridden with the web application's location. If the installation succeeds, a ContainerEvent of typeINSTALL_EVENT
is sent to all registered listeners, with the newly createdContext
as its argument.
- Parameters:
war
- URL pointing to web application location (WAR-packaged or unpacked directory)
public void install(URL config, URL war) throws IOException
Install a new web application, whose context configuration file (consisting of a<Context>
element) and web application archive are at the specified URLs. If this application is successfully installed, a ContainerEvent of typeINSTALL_EVENT
will be sent to all registered listeners, with the newly createdContext
as an argument.
- Parameters:
config
- A URL that points to the context configuration file to be used for configuring the new Contextwar
- A URL of type "jar:" that points to a WAR file, or type "file:" that points to an unpacked directory structure containing the web application to be installed
public void installDefaultContext(Context context)
Install the StandardContext portion of the DefaultContext configuration into current Context.
- Parameters:
context
- current web application context
public boolean isDeployXML()
Deploy XML Context config files flag accessor.
- Specified by:
- isDeployXML in interface Deployer
public boolean isUnpackWARs()
Unpack WARs flag accessor.
public Context map(String uri)
Return the Context that would be used to process the specified host-relative request URI, if any; otherwise returnnull
.
- Parameters:
uri
- Request URI to be mapped
public ObjectName preRegister(MBeanServer server, ObjectName oname) throws Exception
- Overrides:
- preRegister in interface ContainerBase
public void remove(String contextPath) throws IOException
Remove an existing web application, attached to the specified context path. If this application is successfully removed, a ContainerEvent of typeREMOVE_EVENT
will be sent to all registered listeners, with the removedContext
as an argument.
- Parameters:
contextPath
- The context path of the application to be removed
public void remove(String contextPath, boolean undeploy) throws IOException
Remove an existing web application, attached to the specified context path. If this application is successfully removed, a ContainerEvent of typeREMOVE_EVENT
will be sent to all registered listeners, with the removedContext
as an argument. Deletes the web application war file and/or directory if they exist in the Host's appBase.
- Parameters:
contextPath
- The context path of the application to be removedundeploy
- boolean flag to remove web application from server
public void removeAlias(String alias)
Remove the specified alias name from the aliases for this Host.
- Specified by:
- removeAlias in interface Host
- Parameters:
alias
- Alias name to be removed
public void setAppBase(String appBase)
Set the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.
- Specified by:
- setAppBase in interface Host
- Parameters:
appBase
- The new application root
public void setAutoDeploy(boolean autoDeploy)
Set the auto deploy flag value for this host.
- Specified by:
- setAutoDeploy in interface Host
- Parameters:
autoDeploy
- The new auto deploy flag
public void setConfigClass(String configClass)
Set the Java class name of the context configuration class for new web applications.
- Parameters:
configClass
- The new context configuration class
public void setContextClass(String contextClass)
Set the Java class name of the Context implementation class for new web applications.
- Parameters:
contextClass
- The new context implementation class
public void setDeployOnStartup(boolean deployOnStartup)
Set the deploy on startup flag value for this host.
- Specified by:
- setDeployOnStartup in interface Host
- Parameters:
deployOnStartup
- The new deploy on startup flag
public void setDeployXML(boolean deployXML)
Deploy XML Context config files flag mutator.
public void setErrorReportValveClass(String errorReportValveClass)
Set the Java class name of the error report valve class for new web applications.
- Parameters:
errorReportValveClass
- The new error report valve class
public void setLiveDeploy(boolean liveDeploy)
Set the live deploy flag value for this host.
- Parameters:
liveDeploy
- The new live deploy flag
public void setName(String name)
Set the canonical, fully qualified, name of the virtual host this Container represents.
- Overrides:
- setName in interface ContainerBase
- Parameters:
name
- Virtual host name
public void setUnpackWARs(boolean unpackWARs)
Unpack WARs flag mutator.
public void setWorkDir(String workDir)
Host work directory base.
public void setXmlNamespaceAware(boolean xmlNamespaceAware)
Set the namespace aware feature of the XML parser used when parsing xml instances.
- Specified by:
- setXmlNamespaceAware in interface Host
- Parameters:
xmlNamespaceAware
- true to enable namespace awareness
public void setXmlValidation(boolean xmlValidation)
Set the validation feature of the XML parser used when parsing xml instances.
- Specified by:
- setXmlValidation in interface Host
- Parameters:
xmlValidation
- true to enable xml instance validation
public void start() throws LifecycleException
Start this host.
- Overrides:
- start in interface ContainerBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents it from being started
public void start(String contextPath) throws IOException
Start an existing web application, attached to the specified context path. Only starts a web application if it is not running.
- Parameters:
contextPath
- The context path of the application to be started
public void stop(String contextPath) throws IOException
Stop an existing web application, attached to the specified context path. Only stops a web application if it is running.
- Parameters:
contextPath
- The context path of the application to be stopped
public String toString()
Return a String representation of this component.