if (!docBase.getCanonicalPath().startsWith(
appBase().getAbsolutePath() + File.separator)) {
isExternal = true;
- deployedApp.redeployResources.put
- (contextXml.getAbsolutePath(), new Long(contextXml.lastModified()));
+ deployedApp.redeployResources.put(
+ contextXml.getAbsolutePath(),
+ Long.valueOf(contextXml.lastModified()));
deployedApp.redeployResources.put(docBase.getAbsolutePath(),
- new Long(docBase.lastModified()));
+ Long.valueOf(docBase.lastModified()));
if (docBase.getAbsolutePath().toLowerCase(Locale.ENGLISH).endsWith(".war")) {
isExternalWar = true;
}
// watched inside it
if (isExternalWar && unpackWARs) {
deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(),
- new Long(expandedDocBase.lastModified()));
- deployedApp.redeployResources.put
- (contextXml.getAbsolutePath(), new Long(contextXml.lastModified()));
+ Long.valueOf(expandedDocBase.lastModified()));
+ deployedApp.redeployResources.put(contextXml.getAbsolutePath(),
+ Long.valueOf(contextXml.lastModified()));
addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context);
} else {
// Find an existing matching war and expanded folder
File warDocBase = new File(expandedDocBase.getAbsolutePath() + ".war");
if (warDocBase.exists()) {
deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
- new Long(warDocBase.lastModified()));
+ Long.valueOf(warDocBase.lastModified()));
}
}
if (expandedDocBase.exists()) {
deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(),
- new Long(expandedDocBase.lastModified()));
+ Long.valueOf(expandedDocBase.lastModified()));
addWatchedResources(deployedApp,
expandedDocBase.getAbsolutePath(), context);
} else {
}
// Add the context XML to the list of files which should trigger a redeployment
if (!isExternal) {
- deployedApp.redeployResources.put
- (contextXml.getAbsolutePath(), new Long(contextXml.lastModified()));
+ deployedApp.redeployResources.put(
+ contextXml.getAbsolutePath(),
+ Long.valueOf(contextXml.lastModified()));
}
}
} catch (Throwable t) {
istream.close();
istream = null;
}
- } catch (Exception e) {
- // Ignore and continue
+ } catch (IOException e) {
+ /* Ignore */
+ } finally {
if (ostream != null) {
try {
ostream.close();
}
istream = null;
}
- } finally {
entry = null;
if (jar != null) {
try {
context.setConfigFile(new URL("jar:" +
war.toURI().toString() + "!/" +
Constants.ApplicationContextXml));
- } catch (Exception e) {
+ } finally {
if (istream != null) {
try {
istream.close();
- } catch (Throwable t) {
- ExceptionUtils.handleThrowable(t);
+ } catch (IOException e) {
+ /* Ignore */
}
istream = null;
}
- } finally {
entry = null;
if (jar != null) {
try {
jar.close();
- } catch (Throwable t) {
- ExceptionUtils.handleThrowable(t);
+ } catch (IOException e) {
+ /* Ignore */
}
jar = null;
}
digester.reset();
}
}
- if (context == null) {
- log.error(sm.getString("hostConfig.deployDescriptor.error",
- file));
- return;
- }
} else {
context = (Context) Class.forName(contextClass).newInstance();
}
// Populate redeploy resources with the WAR file
deployedApp.redeployResources.put
- (war.getAbsolutePath(), new Long(war.lastModified()));
+ (war.getAbsolutePath(), Long.valueOf(war.lastModified()));
if (deployXML && xml.exists()) {
- deployedApp.redeployResources.put
- (xml.getAbsolutePath(), new Long(xml.lastModified()));
+ deployedApp.redeployResources.put(xml.getAbsolutePath(),
+ Long.valueOf(xml.lastModified()));
}
Class<?> clazz = Class.forName(host.getConfigClass());
if (unpackWARs && (context.getDocBase() != null)) {
File docBase = new File(appBase(), cn.getBaseName());
deployedApp.redeployResources.put(docBase.getAbsolutePath(),
- new Long(docBase.lastModified()));
+ Long.valueOf(docBase.lastModified()));
addWatchedResources(deployedApp, docBase.getAbsolutePath(),
context);
} else {
context.setDocBase(file);
host.addChild(context);
deployedApp.redeployResources.put(dir.getAbsolutePath(),
- new Long(dir.lastModified()));
+ Long.valueOf(dir.lastModified()));
if (xmlCopy != null) {
- deployedApp.redeployResources.put
- (xmlCopy.getAbsolutePath(), new Long(xmlCopy.lastModified()));
+ deployedApp.redeployResources.put(
+ xmlCopy.getAbsolutePath(),
+ Long.valueOf(xmlCopy.lastModified()));
}
addWatchedResources(deployedApp, dir.getAbsolutePath(), context);
} catch (Throwable t) {
log.debug("Watching WatchedResource '" +
resource.getAbsolutePath() + "'");
app.reloadResources.put(resource.getAbsolutePath(),
- new Long(resource.lastModified()));
+ Long.valueOf(resource.lastModified()));
}
}
}
// Update times
app.reloadResources.put(resources[i],
- new Long(resource.lastModified()));
+ Long.valueOf(resource.lastModified()));
app.timestamp = System.currentTimeMillis();
return;
}
docBase = new File(appBase(), context.getDocBase());
}
deployedApp.redeployResources.put(docBase.getAbsolutePath(),
- new Long(docBase.lastModified()));
+ Long.valueOf(docBase.lastModified()));
if (docBase.getAbsolutePath().toLowerCase(Locale.ENGLISH).endsWith(".war")) {
isWar = true;
}
if (isWar && unpackWARs) {
File docBase = new File(appBase(), context.getBaseName());
deployedApp.redeployResources.put(docBase.getAbsolutePath(),
- new Long(docBase.lastModified()));
+ Long.valueOf(docBase.lastModified()));
addWatchedResources(deployedApp, docBase.getAbsolutePath(), context);
} else {
addWatchedResources(deployedApp, null, context);
* This class represents the state of a deployed application, as well as
* the monitored resources.
*/
- protected class DeployedApplication {
+ protected static class DeployedApplication {
public DeployedApplication(String name) {
this.name = name;
}