remm2004/07/26 01:09:21
Modified:catalina/src/share/org/apache/catalina/startup
HostConfig.java ContextRuleSet.java
catalina/src/share/org/apache/catalina/core
StandardContext.java
catalina/src/share/org/apache/catalina Context.java
Added: catalina/src/conf context.xml
Log:
- Add code to handle resource relaoding.
- Add one extra element to Context (I couldn't find a way to avoid it).
- Add a global context.xml file, to define two basic reload resources.
- Now, I'll do the new anti locking code.
Revision ChangesPath
1.36 +40 -27
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
Index: HostConfig.java
===
RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- HostConfig.java 25 Jul 2004 23:35:37 - 1.35
+++ HostConfig.java 26 Jul 2004 08:09:19 - 1.36
@@ -464,28 +464,28 @@
// Assume this is a configuration descriptor and deploy it
log.debug(sm.getString(hostConfig.deployDescriptor, files[i]));
try {
-Context newContext = null;
+Context context = null;
synchronized (digester) {
-newContext = (Context) digester.parse(contextXml);
+context = (Context) digester.parse(contextXml);
}
-if (newContext instanceof Lifecycle) {
+if (context instanceof Lifecycle) {
Class clazz = Class.forName(host.getConfigClass());
LifecycleListener listener =
(LifecycleListener) clazz.newInstance();
-((Lifecycle) newContext).addLifecycleListener(listener);
+((Lifecycle) context).addLifecycleListener(listener);
}
-newContext.setConfigFile(contextXml.getAbsolutePath());
-newContext.setPath(contextPath);
+context.setConfigFile(contextXml.getAbsolutePath());
+context.setPath(contextPath);
// Add the context XML to the list of watched files
deployedApp.reloadResources.put
(contextXml.getAbsolutePath(), new
Long(contextXml.lastModified()));
// Add the associated docBase to the redeployed list if it's a
WAR
boolean isWar = false;
-if (newContext.getDocBase() != null) {
-File docBase = new File(newContext.getDocBase());
+if (context.getDocBase() != null) {
+File docBase = new File(context.getDocBase());
if (!docBase.isAbsolute()) {
docBase = new File(new File(host.getAppBase()),
-newContext.getDocBase());
+context.getDocBase());
}
deployedApp.redeployResources.put(docBase.getAbsolutePath(),
new Long(docBase.lastModified()));
@@ -493,21 +493,18 @@
isWar = true;
}
}
-host.addChild(newContext);
+host.addChild(context);
// Add the eventual unpacked WAR and all the resources which
will be
// watched inside it
-if (isWar unpackWARs (newContext.getDocBase() != null)) {
-File docBase = new File(newContext.getDocBase());
+if (isWar unpackWARs (context.getDocBase() != null)) {
+File docBase = new File(context.getDocBase());
if (!docBase.isAbsolute()) {
docBase = new File(new File(host.getAppBase()),
-newContext.getDocBase());
+context.getDocBase());
}
deployedApp.redeployResources.put(docBase.getAbsolutePath(),
new Long(docBase.lastModified()));
-// FIXME: Add the list of reload resources as given by the
context
-//This list would by default contain
/WEB-INF/web.xml and
-///META-INF/context.xml
-//Add new element in Context