incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1242720 - in /sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl: Sling.java SlingFelix.java
Date Fri, 10 Feb 2012 09:50:24 GMT
Author: cziegeler
Date: Fri Feb 10 09:50:24 2012
New Revision: 1242720

URL: http://svn.apache.org/viewvc?rev=1242720&view=rev
Log:
SLING-2416 : Launcher jar should not be closed when framework restarts

Modified:
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java?rev=1242720&r1=1242719&r2=1242720&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
Fri Feb 10 09:50:24 2012
@@ -232,7 +232,7 @@ public class Sling {
             startupManager.markInstalled();
 
             if (restart) {
-                stop(tmpFramework);
+                restart(tmpFramework);
                 tmpFramework = createFramework(notifiable, logger, props);
                 init(tmpFramework);
             }
@@ -366,10 +366,13 @@ public class Sling {
         this.startup(framework.getBundleContext());
     }
 
-    private void stop(final Framework framework) throws BundleException {
+    private void restart(final Framework framework) throws BundleException {
         if ((framework.getState() & (Bundle.STARTING|Bundle.ACTIVE|Bundle.STOPPING))
!= 0) {
-            framework.stop();
-
+            if ( framework instanceof SlingFelix ) {
+                ((SlingFelix)framework).restart();
+            } else {
+                framework.stop();
+            }
             try {
                 framework.waitForStop(REINIT_TIMEOUT);
             } catch (InterruptedException ie) {

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java?rev=1242720&r1=1242719&r2=1242720&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
Fri Feb 10 09:50:24 2012
@@ -63,6 +63,10 @@ public class SlingFelix extends Felix {
         super.stop();
     }
 
+    public void restart() throws BundleException {
+        super.stop();
+    }
+
     @Override
     public void stop() throws BundleException {
         startNotifier(false, null);



Mime
View raw message