tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1483816 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
Date Fri, 17 May 2013 14:15:29 GMT
Author: markt
Date: Fri May 17 14:15:29 2013
New Revision: 1483816

URL: http://svn.apache.org/r1483816
Log:
Add dummy reload resources to trigger a reload if a WAR or DIR is added to an XML
Add dummy redploy resources to trigger a redeploy if an XML is added to a WAR

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1483816&r1=1483815&r2=1483816&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Fri May 17 14:15:29 2013
@@ -631,6 +631,11 @@ public class HostConfig
                     if (warDocBase.exists()) {
                         deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
                                 Long.valueOf(warDocBase.lastModified()));
+                    } else {
+                        // Trigger a reload if a WAR is added
+                        deployedApp.reloadResources.put(
+                                warDocBase.getAbsolutePath(),
+                                Long.valueOf(0));
                     }
                 }
                 if (expandedDocBase.exists()) {
@@ -639,6 +644,12 @@ public class HostConfig
                     addWatchedResources(deployedApp,
                             expandedDocBase.getAbsolutePath(), context);
                 } else {
+                    if (!isExternal && !unpackWARs) {
+                        // Trigger a reload if a DIR is added
+                        deployedApp.reloadResources.put(
+                                expandedDocBase.getAbsolutePath(),
+                                Long.valueOf(0));
+                    }
                     addWatchedResources(deployedApp, null, context);
                 }
                 // Add the context XML to the list of files which should trigger a redeployment
@@ -923,6 +934,12 @@ public class HostConfig
             if (deployXML && xml.exists() && copyXML) {
                 deployedApp.redeployResources.put(xml.getAbsolutePath(),
                         Long.valueOf(xml.lastModified()));
+            } else if (!copyXML ) {
+                // In case an XML file is added to the config base later
+                deployedApp.redeployResources.put(
+                        (new File(host.getConfigBaseFile(),
+                                cn.getBaseName() + ".xml")).getAbsolutePath(),
+                        Long.valueOf(0));
             }
 
             Class<?> clazz = Class.forName(host.getConfigClass());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message