// Populate redeploy resources with the WAR file
deployedApp.redeployResources.put
(dir.getAbsolutePath(), new Long(dir.lastModified()));
try {
Context context = (Context) Class.forName(contextClass).newInstance();
if (context instanceof Lifecycle) {
Class clazz = Class.forName(host.getConfigClass());
LifecycleListener listener =
(LifecycleListener) clazz.newInstance();
((Lifecycle) context).addLifecycleListener(listener);
}
context.setPath(contextPath);
context.setDocBase(file);
if (xml.exists()) {
context.setConfigFile(xml.getAbsolutePath());
deployedApp.redeployResources.put
(xml.getAbsolutePath(), new Long(xml.lastModified()));
}
host.addChild(context);
// If we're unpacking WARs, the docBase will be mutated after
// starting the context
if (unpackWARs && (context.getDocBase() != null)) {
String name = null;
String path = context.getPath();
if (path.equals("")) {
name = "ROOT";
} else {
if (path.startsWith("/")) {
name = path.substring(1);