incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r724676 - /incubator/sling/trunk/extensions/jcrinstall/service/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java
Date Tue, 09 Dec 2008 12:51:38 GMT
Author: bdelacretaz
Date: Tue Dec  9 04:51:38 2008
New Revision: 724676

URL: http://svn.apache.org/viewvc?rev=724676&view=rev
Log:
SLING-762 - jcrinstall does not change start level anymore when stopped

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

Modified: incubator/sling/trunk/extensions/jcrinstall/service/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/jcrinstall/service/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java?rev=724676&r1=724675&r2=724676&view=diff
==============================================================================
--- incubator/sling/trunk/extensions/jcrinstall/service/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java
(original)
+++ incubator/sling/trunk/extensions/jcrinstall/service/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/RepositoryObserver.java
Tue Dec  9 04:51:38 2008
@@ -34,7 +34,6 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.observation.Event;
-import javax.servlet.http.HttpServletResponse;
 
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.jcrinstall.jcr.JcrInstallService;
@@ -247,7 +246,7 @@
     
     protected void deactivate(ComponentContext context) {
         log.debug("deactivate()");
-        shutdown();
+        shutdown(false);
         if(context != null) {
             context.getBundleContext().removeFrameworkListener(this);
         }
@@ -257,7 +256,7 @@
     }
     
     /** Called at deactivation time, or when repository stops being available */
-    protected void shutdown() {
+    protected void shutdown(boolean allowStartLevelChange) {
         log.debug("shutdown()");
         
         observationCycleActive = false;
@@ -282,7 +281,7 @@
     	listeners.clear();
         folders.clear();
         
-        if(componentContext != null) {
+        if(componentContext != null && allowStartLevelChange)  {
             final int currentStartLevel = startLevel.getStartLevel();
             final int myStartLevel = startLevel.getBundleStartLevel(componentContext.getBundleContext().getBundle());
             if(currentStartLevel > myStartLevel) {
@@ -488,7 +487,7 @@
         // to go back to it if repository comes back
         startLevelToSetAtStartup = startLevel.getStartLevel();
         log.debug("unbindSlingRepository() called at start level {}", startLevelToSetAtStartup);
-        shutdown();
+        shutdown(true);
         repository = null;
     }
 



Mime
View raw message