cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r628323 - /cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/CocoonReloadingListener.java
Date Sat, 16 Feb 2008 15:20:20 GMT
Author: reinhard
Date: Sat Feb 16 07:20:15 2008
New Revision: 628323

URL: http://svn.apache.org/viewvc?rev=628323&view=rev
Log:
write changes of available classloader resources to the console, after the *first* update
or deletion
(This avoids a long [created] list at the startup of the container.)

Modified:
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/CocoonReloadingListener.java

Modified: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/CocoonReloadingListener.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/CocoonReloadingListener.java?rev=628323&r1=628322&r2=628323&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/CocoonReloadingListener.java
(original)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/CocoonReloadingListener.java
Sat Feb 16 07:20:15 2008
@@ -27,29 +27,35 @@
     private final Log log = LogFactory.getLog(CocoonReloadingListener.class);
 
     private static boolean reload = false;
-    
+
+    private boolean consoleOutput = false;
+
     public CocoonReloadingListener() {
         super();
     }
 
     public void onFileChange(File file) {
         super.onFileChange(file);
+        // after the first change/deletion of a file is detected, log to the console
+        this.consoleOutput = true;
         changeDetected(file, "update");
     }
-    
+
     public void onFileDelete(File file) {
         super.onFileDelete(file);
+        // after the first change/deletion of a file is detected, log to the console
+        this.consoleOutput = true;
         changeDetected(file, "delete");
     }
-    
+
     public void onFileCreate(File file) {
         super.onFileCreate(file);
         changeDetected(file, "create");
-    }   
-    
+    }
+
     protected void changeDetected(File changedFile, String operation) {
         String changedFileParentPath = changedFile.getParent().replace('\\', '/');
-        String changedFilePath = changedFile.getAbsolutePath().replace('\\', '/');      
 
+        String changedFilePath = changedFile.getAbsolutePath().replace('\\', '/');
 
         if(changedFileParentPath.endsWith("META-INF/cocoon/spring") ||              // global
Spring beans configurations
                 changedFileParentPath.endsWith("config/avalon") ||                  // global
Avalon components
@@ -57,9 +63,11 @@
                 changedFilePath.endsWith(".xmap.xml") ||                            // any
sitemap that ends with xmap.xml (sitemaps)
                 changedFilePath.endsWith(".class") ||                               // Java
class file change
                 changedFileParentPath.endsWith("config/spring")                     // local
Spring bean configurations
-           ) {                
+           ) {
             log.debug("Configuration or .class file change detected [" + operation + "]:
" + changedFile);
-            System.out.println("RCL [" + operation + "]: " + changedFile);
+            if (this.consoleOutput) {
+                System.out.println("RCL [" + operation + "]: " + changedFile);
+            }
             reload = true;
         } else {
             log.debug("Other file change detected, no reload [" + operation + "]: " + changedFile);
 // any other file change



Mime
View raw message