org.apache.catalina.startup
public class HostConfig extends Object implements LifecycleListener
Version: $Revision: 892815 $ $Date: 2009-12-21 14:27:57 +0100 (Mon, 21 Dec 2009) $
Nested Class Summary | |
---|---|
protected class | HostConfig.DeployedApplication
This class represents the state of a deployed application, as well as
the monitored resources. |
Field Summary | |
---|---|
protected File | appBase
App base. |
protected File | configBase
Config base. |
protected String | configClass
The Java class name of the Context configuration class we should use. |
protected String | contextClass
The Java class name of the Context implementation we should use. |
protected HashMap | deployed
Map of deployed applications. |
protected boolean | deployXML
Should we deploy XML Context config files? |
protected static Digester | digester
The Digester instance used to parse context descriptors. |
protected Host | host
The Host we are associated with. |
protected Set<String> | invalidWars
The list of Wars in the appBase to be ignored because they are invalid
(e.g. contain /../ sequences). |
protected static Log | log |
protected ObjectName | oname
The JMX ObjectName of this component. |
protected ArrayList | serviced
List of applications which are being serviced, and shouldn't be
deployed/undeployed/redeployed at the moment. |
protected static StringManager | sm
The string resources for this package. |
protected boolean | unpackWARs
Should we unpack WAR files when auto-deploying applications in the
appBase directory? |
protected boolean | xmlNamespaceAware
Attribute value used to turn on/off XML namespace awarenes. |
protected boolean | xmlValidation
Attribute value used to turn on/off XML validation |
Method Summary | |
---|---|
void | addServiced(String name)
Add a serviced application to the list. |
protected void | addWatchedResources(HostConfig.DeployedApplication app, String docBase, Context context)
Add watched resources to the specified Context. |
protected File | appBase()
Return a File object representing the "application root" directory
for our associated Host. |
protected void | check()
Check status of all webapps. |
void | check(String name)
Check status of a specific webapp, for use with stuff like management webapps. |
protected void | checkResources(HostConfig.DeployedApplication app)
Check resources for redeployment and reloading. |
protected File | configBase()
Return a File object representing the "configuration root" directory
for our associated Host. |
protected static Digester | createDigester()
Create the digester which will be used to parse context config files. |
protected void | deployApps()
Deploy applications for any directories or WAR files that are found
in our "application root" directory. |
protected void | deployApps(String name)
Deploy applications for any directories or WAR files that are found
in our "application root" directory. |
protected void | deployDescriptor(String contextPath, File contextXml, String file) |
protected void | deployDescriptors(File configBase, String[] files)
Deploy XML context descriptors. |
protected void | deployDirectories(File appBase, String[] files)
Deploy directories. |
protected void | deployDirectory(String contextPath, File dir, String file) |
protected boolean | deploymentExists(String contextPath)
Check if a webapp is already deployed in this host.
|
protected void | deployWAR(String contextPath, File war, String file) |
protected void | deployWARs(File appBase, String[] files)
Deploy WAR files. |
String | getConfigBaseName()
Get the name of the configBase.
|
String | getConfigClass()
Return the Context configuration class name. |
protected String | getConfigFile(String path)
Given a context path, get the config file name. |
String | getContextClass()
Return the Context implementation class name. |
long | getDeploymentTime(String name)
Get the instant where an application was deployed. |
protected String | getDocBase(String path)
Given a context path, get the docBase. |
boolean | getXmlNamespaceAware()
Get the server.xml <host> attribute's xmlNamespaceAware. |
boolean | getXmlValidation()
Get the server.xml <host> attribute's xmlValidation. |
boolean | isDeployed(String name)
Has the specified application been deployed? |
boolean | isDeployXML()
Return the deploy XML config file flag for this component. |
boolean | isServiced(String name)
Is application serviced ? |
boolean | isUnpackWARs()
Return the unpack WARs flag. |
void | lifecycleEvent(LifecycleEvent event)
Process the START event for an associated Host.
|
void | manageApp(Context context)
Add a new Context to be managed by us.
|
void | removeServiced(String name)
Removed a serviced application from the list. |
void | setConfigClass(String configClass)
Set the Context configuration class name.
|
void | setContextClass(String contextClass)
Set the Context implementation class name.
|
void | setDeployXML(boolean deployXML)
Set the deploy XML config file flag for this component.
|
void | setUnpackWARs(boolean unpackWARs)
Set the unpack WARs flag.
|
void | setXmlNamespaceAware(boolean xmlNamespaceAware)
Set the namespace aware feature of the XML parser used when
parsing xml instances. |
void | setXmlValidation(boolean xmlValidation)
Set the validation feature of the XML parser used when
parsing xml instances. |
void | start()
Process a "start" event for this Host. |
void | stop()
Process a "stop" event for this Host. |
protected void | undeployApps()
Undeploy all deployed applications. |
void | unmanageApp(String contextPath)
Remove a webapp from our control.
|
Digester
instance used to parse context descriptors.appBase
directory?Parameters: app HostConfig deployed app docBase web app docBase context web application context
Parameters: contextPath contextXml file
Parameters: contextPath dir file
Parameters: contextPath of the context which will be checked
Parameters: contextPath war file
Returns: 0L if no application with that name is deployed, or the instant on which the application was deployed
Returns: true if namespace awarenes is enabled.
Returns: true if validation is enabled.
Returns: true
if the application has been deployed and
false
if the applciation has not been deployed or does not
exist
Returns: state of the application
Parameters: event The lifecycle event that has occurred
Parameters: configClass The new Context configuration class name.
Parameters: contextClass The new Context implementation class name.
Parameters: deployXML The new deploy XML flag
Parameters: unpackWARs The new unpack WARs flag
Parameters: xmlNamespaceAware true to enable namespace awareness
Parameters: xmlValidation true to enable xml instance validation