|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.startup.HostConfig
Startup event listener for a Host that configures the properties of that Host, and the associated defined contexts.
Field Summary | |
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 int |
debug
The debugging detail level for this component. |
protected java.util.ArrayList |
deployed
The names of applications that we have auto-deployed (to avoid double deployment attempts). |
protected Host |
host
The Host we are associated with. |
protected static StringManager |
sm
The string resources for this package. |
Constructor Summary | |
HostConfig()
|
Method Summary | |
void |
addChild(Container child)
Used by digester to add a context in getContextPath(java.io.File) . |
protected java.io.File |
appBase()
Return a File object representing the "application root" directory for our associated Host. |
protected void |
checkDeployed()
Check the list of files that have been auto-deployed to see if any of them have been removed, eg by the Manager app. |
protected void |
checkWebXmlLastModified()
Check deployment descriptors last modified date. |
protected org.apache.commons.digester.Digester |
createDigester()
Create (if necessary) and return a Digester configured to process the context configuration descriptor for an application. |
protected void |
deployApps()
Deploy applications for any directories or WAR files that are found in our "application root" directory. |
protected void |
deployDescriptors(java.io.File appBase,
java.lang.String[] files)
Deploy XML context descriptors. |
protected void |
deployDirectories(java.io.File appBase,
java.lang.String[] files)
Deploy directories. |
protected void |
deployWARs(java.io.File appBase,
java.lang.String[] files)
Deploy WAR files. |
protected void |
enableDigesterSubstitutor(org.apache.commons.digester.Digester digester)
Adds a substitutor to interpolate system properties |
protected void |
expand(java.io.InputStream input,
java.io.File docBase,
java.lang.String name)
Expand the specified input stream into the specified directory, creating a file named from the specified relative path. |
protected java.lang.String |
expand(java.net.URL war)
Expand the WAR file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory. |
java.lang.String |
getConfigClass()
Return the Context configuration class name. |
java.lang.String |
getContextClass()
Return the Context implementation class name. |
protected java.lang.String |
getContextPath(java.io.File configFile)
Get the path from a context defined by an XML context descriptor. |
int |
getDebug()
Return the debugging detail level for this component. |
java.lang.ClassLoader |
getParentClassLoader()
Delegate a request for the parent class loader to our associated Host. |
boolean |
isDeployXML()
Return the deploy XML config file flag for this component. |
boolean |
isLiveDeploy()
Return the live deploy flag for this component. |
boolean |
isUnpackWARs()
Return the unpack WARs flag. |
void |
lifecycleEvent(LifecycleEvent event)
Process the START event for an associated Host. |
protected void |
log(java.lang.String message)
Log a message on the Logger associated with our Host (if any) |
protected void |
log(java.lang.String message,
java.lang.Throwable throwable)
Log a message on the Logger associated with our Host (if any) |
void |
run()
The background thread that checks for web application autoDeploy and changes to the web.xml config. |
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 |
setDebug(int debug)
Set the debugging detail level for this component. |
void |
setDeployXML(boolean deployXML)
Set the deploy XML config file flag for this component. |
void |
setLiveDeploy(boolean liveDeploy)
Set the live deploy flag for this component. |
void |
setUnpackWARs(boolean unpackWARs)
Set the unpack WARs flag. |
protected void |
start()
Process a "start" event for this Host. |
protected void |
stop()
Process a "stop" event for this Host. |
protected void |
threadSleep()
Sleep for the duration specified by the checkInterval
property. |
protected void |
threadStart()
Start the background thread that will periodically check for web application autoDeploy and changes to the web.xml config. |
protected void |
threadStop()
Stop the background thread that is periodically checking for for web application autoDeploy and changes to the web.xml config. |
protected void |
undeployApps()
Undeploy all deployed applications. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String configClass
protected java.lang.String contextClass
protected int debug
protected java.util.ArrayList deployed
protected Host host
protected static final StringManager sm
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 int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic boolean isDeployXML()
public void setDeployXML(boolean deployXML)
deployXML
- The new deploy XML flagpublic boolean isLiveDeploy()
public void setLiveDeploy(boolean liveDeploy)
liveDeploy
- The new live deploy flagpublic boolean isUnpackWARs()
public void setUnpackWARs(boolean unpackWARs)
unpackWARs
- The new unpack WARs flagpublic void lifecycleEvent(LifecycleEvent event)
lifecycleEvent
in interface LifecycleListener
event
- The lifecycle event that has occurredprotected java.io.File appBase()
protected void deployApps()
protected void checkDeployed()
protected void deployDescriptors(java.io.File appBase, java.lang.String[] files)
protected java.lang.String getContextPath(java.io.File configFile)
protected void enableDigesterSubstitutor(org.apache.commons.digester.Digester digester)
digester
- The digester to which we add the substitutorprotected org.apache.commons.digester.Digester createDigester()
public void addChild(Container child)
getContextPath(java.io.File)
.
public java.lang.ClassLoader getParentClassLoader()
protected void deployWARs(java.io.File appBase, java.lang.String[] files)
protected void deployDirectories(java.io.File appBase, java.lang.String[] files)
protected void checkWebXmlLastModified()
protected java.lang.String expand(java.net.URL war) throws java.io.IOException
war
- URL of the web application archive to be expanded
(must start with "jar:")
java.lang.IllegalArgumentException
- if this is not a "jar:" URL
java.io.IOException
- if an input/output error was encountered
during expansionprotected void expand(java.io.InputStream input, java.io.File docBase, java.lang.String name) throws java.io.IOException
input
- InputStream to be copieddocBase
- Document base directory into which we are expandingname
- Relative pathname of the file to be created
java.io.IOException
- if an input/output error occursprotected void log(java.lang.String message)
message
- Message to be loggedprotected void log(java.lang.String message, java.lang.Throwable throwable)
message
- Message to be loggedthrowable
- Associated exceptionprotected void start()
protected void stop()
protected void undeployApps()
protected void threadStart()
java.lang.IllegalStateException
- if we should not be starting
a background thread nowprotected void threadStop()
protected void threadSleep()
checkInterval
property.
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |