public class HostConfig extends Object implements LifecycleListener
Modifier and Type | Field and Description |
---|---|
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 int |
debug
The debugging detail level for this component.
|
protected List<String> |
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 Set<String> |
invalidWars
The list of Wars in the appBase to be ignored because they are invalid
(e.g.
|
Constructor and Description |
---|
HostConfig() |
Modifier and Type | Method and Description |
---|---|
protected File |
appBase()
Return a File object representing the "application root" directory
for our associated Host.
|
protected void |
check()
Deploy webapps.
|
protected void |
checkContextLastModified()
Check deployment descriptors last modified date.
|
protected File |
configBase()
Return a File object representing the "configuration root" directory
for our associated Host.
|
protected void |
deployApps()
Deploy applications for any directories or WAR files that are found
in our "application root" directory.
|
protected void |
deployDescriptors(File configBase,
String[] files)
Deploy XML context descriptors.
|
protected void |
deployDirectories(File appBase,
String[] files)
Deploy directories.
|
protected void |
deployWARs(File appBase,
String[] files)
Deploy WAR files.
|
protected void |
expand(InputStream input,
File docBase,
String name)
Expand the specified input stream into the specified directory, creating
a file named from the specified relative path.
|
protected String |
expand(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.
|
String |
getConfigClass()
Return the Context configuration class name.
|
String |
getContextClass()
Return the Context implementation class name.
|
int |
getDebug()
Return the debugging detail level for this component.
|
boolean |
getXmlNamespaceAware()
Get the server.xml
|
boolean |
getXmlValidation()
Get the server.xml
|
boolean |
isDeployXML()
Return the deploy XML config file 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(String message)
Log a message on the Logger associated with our Host (if any)
|
protected void |
log(String message,
Throwable throwable)
Log a message on the Logger associated with our Host (if any)
|
protected boolean |
restartContext(Context context) |
void |
setConfigClass(String configClass)
Set the Context configuration class name.
|
void |
setContextClass(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 |
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.
|
protected String configClass
protected String contextClass
protected int debug
protected List<String> deployed
protected Host host
public String getConfigClass()
public void setConfigClass(String configClass)
configClass
- The new Context configuration class name.public String getContextClass()
public void setContextClass(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 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 occurredprotected File appBase()
protected File configBase()
protected void deployApps()
protected void deployDescriptors(File configBase, String[] files)
protected void deployDirectories(File appBase, String[] files)
protected void checkContextLastModified()
protected boolean restartContext(Context context)
protected String expand(URL war) throws IOException
war
- URL of the web application archive to be expanded
(must start with "jar:")IllegalArgumentException
- if this is not a "jar:" URLIOException
- if an input/output error was encountered
during expansionprotected void expand(InputStream input, File docBase, String name) throws IOException
input
- InputStream to be copieddocBase
- Document base directory into which we are expandingname
- Relative pathname of the file to be createdIOException
- if an input/output error occursprotected void log(String message)
message
- Message to be loggedprotected void log(String message, Throwable throwable)
message
- Message to be loggedthrowable
- Associated exceptionpublic void start()
public void stop()
protected void undeployApps()
protected void check()
Copyright © 2020. All rights reserved.