You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2008/11/25 18:07:26 UTC

svn commit: r720541 - /incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java

Author: bdelacretaz
Date: Tue Nov 25 09:07:25 2008
New Revision: 720541

URL: http://svn.apache.org/viewvc?rev=720541&view=rev
Log:
SLING-733 - call  osgiController.executeScheduledOperations() in handleInitialUninstalls() to make things more sequential

Modified:
    incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java

Modified: incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java?rev=720541&r1=720540&r2=720541&view=diff
==============================================================================
--- incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java (original)
+++ incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java Tue Nov 25 09:07:25 2008
@@ -266,8 +266,8 @@
         return path;
     }
     
-    /** Uninstall resources as needed when starting up */
-    void handleInitialUninstalls() {
+    /** Uninstall resources as needed when starting up */ 
+    void handleInitialUninstalls() throws Exception {
         // If regexp has changed, uninstall resources left in folders 
         // that don't match the new regexp
         // TODO this happens right after activate() is called on this service,
@@ -308,7 +308,9 @@
         } catch(Exception e) {
             log.warn("Exception in root WatchFolder.checkDeletions call", e);
         }
-
+        
+        // Let the OSGi controller execute the uninstalls
+        osgiController.executeScheduledOperations();
     }
     
     /**
@@ -335,11 +337,15 @@
         }
         log.info("No bundle events in the last {} msec, starting processing", bundleEventDelayMsec);
 
-        handleInitialUninstalls();
         
         // We could use the scheduler service but that makes things harder to test
+        boolean firstCycle = true;
         while (running) {
             try {
+            	if(firstCycle) {
+            		handleInitialUninstalls();
+            		firstCycle = false;
+            	}
                 runOneCycle();
             } catch (IllegalArgumentException ie) {
                 log.warn("IllegalArgumentException  in " + getClass().getSimpleName(), ie);