|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.startup.HostConfig
public class HostConfig
Startup event listener for a Host that configures the properties of that Host, and the associated defined contexts.
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 java.io.File |
appBase
App base. |
protected java.io.File |
configBase
Config base. |
protected java.lang.String |
configClass
The Java class name of the Context configuration class we should use. |
protected java.lang.String |
contextClass
The Java class name of the Context implementation we should use. |
protected java.util.HashMap<java.lang.String,HostConfig.DeployedApplication> |
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 java.util.Set<java.lang.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 javax.management.ObjectName |
oname
The JMX ObjectName of this component. |
protected java.util.ArrayList<java.lang.String> |
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 |
Constructor Summary | |
---|---|
HostConfig()
|
Method Summary | |
---|---|
void |
addServiced(java.lang.String name)
Add a serviced application to the list. |
protected void |
addWatchedResources(HostConfig.DeployedApplication app,
java.lang.String docBase,
Context context)
Add watched resources to the specified Context. |
protected java.io.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(java.lang.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 java.io.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(java.lang.String name)
Deploy applications for any directories or WAR files that are found in our "application root" directory. |
protected void |
deployDescriptor(java.lang.String contextPath,
java.io.File contextXml,
java.lang.String file)
|
protected void |
deployDescriptors(java.io.File configBase,
java.lang.String[] files)
Deploy XML context descriptors. |
protected void |
deployDirectories(java.io.File appBase,
java.lang.String[] files)
Deploy directories. |
protected void |
deployDirectory(java.lang.String contextPath,
java.io.File dir,
java.lang.String file)
|
protected boolean |
deploymentExists(java.lang.String contextPath)
Check if a webapp is already deployed in this host. |
protected void |
deployWAR(java.lang.String contextPath,
java.io.File war,
java.lang.String file)
|
protected void |
deployWARs(java.io.File appBase,
java.lang.String[] files)
Deploy WAR files. |
protected java.lang.String[] |
filterAppPaths(java.lang.String[] unfilteredAppPaths)
Filter the list of application file paths to remove those that match the regular expression defined by Host.getDeployIgnore() . |
java.lang.String |
getConfigBaseName()
Get the name of the configBase. |
java.lang.String |
getConfigClass()
Return the Context configuration class name. |
protected java.lang.String |
getConfigFile(java.lang.String path)
Given a context path, get the config file name. |
java.lang.String |
getContextClass()
Return the Context implementation class name. |
long |
getDeploymentTime(java.lang.String name)
Get the instant where an application was deployed. |
protected java.lang.String |
getDocBase(java.lang.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(java.lang.String name)
Has the specified application been deployed? |
boolean |
isDeployXML()
Return the deploy XML config file flag for this component. |
boolean |
isServiced(java.lang.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(java.lang.String name)
Removed a serviced application from the list. |
void |
setConfigClass(java.lang.String configClass)
Set the Context configuration class name. |
void |
setContextClass(java.lang.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(java.lang.String contextPath)
Remove a webapp from our control. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Log log
protected java.io.File appBase
protected java.io.File configBase
protected java.lang.String configClass
protected java.lang.String contextClass
protected Host host
protected javax.management.ObjectName oname
protected static final StringManager sm
protected boolean deployXML
protected boolean unpackWARs
appBase
directory?
protected java.util.HashMap<java.lang.String,HostConfig.DeployedApplication> deployed
protected java.util.ArrayList<java.lang.String> serviced
protected boolean xmlValidation
protected boolean xmlNamespaceAware
protected static Digester digester
Digester
instance used to parse context descriptors.
protected java.util.Set<java.lang.String> invalidWars
Constructor Detail |
---|
public HostConfig()
Method Detail |
---|
public java.lang.String getConfigClass()
public void setConfigClass(java.lang.String configClass)
configClass
- The new Context configuration class name.public java.lang.String getContextClass()
public void setContextClass(java.lang.String contextClass)
contextClass
- The new Context implementation class name.public boolean isDeployXML()
public void setDeployXML(boolean deployXML)
deployXML
- The new deploy XML flagpublic boolean isUnpackWARs()
public void setUnpackWARs(boolean unpackWARs)
unpackWARs
- The new unpack WARs flagpublic void setXmlValidation(boolean xmlValidation)
xmlValidation
- true to enable xml instance validationpublic boolean getXmlValidation()
public boolean getXmlNamespaceAware()
public void setXmlNamespaceAware(boolean xmlNamespaceAware)
xmlNamespaceAware
- true to enable namespace awarenesspublic void lifecycleEvent(LifecycleEvent event)
lifecycleEvent
in interface LifecycleListener
event
- The lifecycle event that has occurredpublic void addServiced(java.lang.String name)
public boolean isServiced(java.lang.String name)
public void removeServiced(java.lang.String name)
public long getDeploymentTime(java.lang.String name)
public boolean isDeployed(java.lang.String name)
true
if the application has been deployed and
false
if the applciation has not been deployed or does not
existprotected static Digester createDigester()
protected java.io.File appBase()
protected java.io.File configBase()
public java.lang.String getConfigBaseName()
protected java.lang.String getConfigFile(java.lang.String path)
protected java.lang.String getDocBase(java.lang.String path)
protected void deployApps()
protected java.lang.String[] filterAppPaths(java.lang.String[] unfilteredAppPaths)
Host.getDeployIgnore()
.
unfilteredAppPaths
- The list of application paths to filtert
protected void deployApps(java.lang.String name)
protected void deployDescriptors(java.io.File configBase, java.lang.String[] files)
protected void deployDescriptor(java.lang.String contextPath, java.io.File contextXml, java.lang.String file)
contextPath
- contextXml
- file
- protected void deployWARs(java.io.File appBase, java.lang.String[] files)
protected void deployWAR(java.lang.String contextPath, java.io.File war, java.lang.String file)
contextPath
- war
- file
- protected void deployDirectories(java.io.File appBase, java.lang.String[] files)
protected void deployDirectory(java.lang.String contextPath, java.io.File dir, java.lang.String file)
contextPath
- dir
- file
- protected boolean deploymentExists(java.lang.String contextPath)
contextPath
- of the context which will be checkedprotected void addWatchedResources(HostConfig.DeployedApplication app, java.lang.String docBase, Context context)
app
- HostConfig deployed appdocBase
- web app docBasecontext
- web application contextprotected void checkResources(HostConfig.DeployedApplication app)
public void start()
public void stop()
protected void undeployApps()
protected void check()
public void check(java.lang.String name)
public void manageApp(Context context)
public void unmanageApp(java.lang.String contextPath)
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |