sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1067955 - /sling/trunk/bundles/extensions/settings/src/main/java/org/apache/sling/settings/impl/Activator.java
Date Mon, 07 Feb 2011 14:55:34 GMT
Author: cziegeler
Date: Mon Feb  7 14:55:33 2011
New Revision: 1067955

URL: http://svn.apache.org/viewvc?rev=1067955&view=rev
Log:
SLING-1970 : Potential deadlock during start of settings service

Modified:
    sling/trunk/bundles/extensions/settings/src/main/java/org/apache/sling/settings/impl/Activator.java

Modified: sling/trunk/bundles/extensions/settings/src/main/java/org/apache/sling/settings/impl/Activator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/settings/src/main/java/org/apache/sling/settings/impl/Activator.java?rev=1067955&r1=1067954&r2=1067955&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/settings/src/main/java/org/apache/sling/settings/impl/Activator.java
(original)
+++ sling/trunk/bundles/extensions/settings/src/main/java/org/apache/sling/settings/impl/Activator.java
Mon Feb  7 14:55:33 2011
@@ -56,6 +56,7 @@ public class Activator implements Bundle
 
         if ( this.settingsService.isDelayedStart() ) {
             this.bundleContext.addBundleListener(this);
+            this.tryToStart();
         } else {
             this.startService();
         }
@@ -66,13 +67,19 @@ public class Activator implements Bundle
      */
     public void bundleChanged(BundleEvent event) {
         if ( SlingSettingsServiceImpl.ENGINE_SYMBOLIC_NAME.equals(event.getBundle().getSymbolicName()))
{
+            this.tryToStart();
+        }
+
+    }
+
+    private synchronized void tryToStart() {
+        if ( this.settingsService.isDelayedStart() ) {
             this.settingsService.initDelayed(this.bundleContext);
             if ( !this.settingsService.isDelayedStart() ) {
                 this.bundleContext.removeBundleListener(this);
                 this.startService();
             }
         }
-
     }
 
     private void startService() {



Mime
View raw message