incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1591236 - in /sling/trunk/launchpad/base/src/main: java/org/apache/sling/launchpad/base/impl/ java/org/apache/sling/launchpad/base/shared/ resources/
Date Wed, 30 Apr 2014 10:30:33 GMT
Author: cziegeler
Date: Wed Apr 30 10:30:32 2014
New Revision: 1591236

URL: http://svn.apache.org/r1591236
Log:
SLING-3529 : Move startup handling to a separate bundle

Removed:
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java
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/StartupManager.java
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/SharedConstants.java
    sling/trunk/launchpad/base/src/main/resources/sling.properties

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=1591236&r1=1591235&r2=1591236&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
Wed Apr 30 10:30:32 2014
@@ -222,8 +222,6 @@ public class Sling {
                 init(tmpFramework);
             }
 
-            new DefaultStartupHandler(tmpFramework.getBundleContext(), logger, startupManager);
-
             // finally start
             tmpFramework.start();
 

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/StartupManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/StartupManager.java?rev=1591236&r1=1591235&r2=1591236&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/StartupManager.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/StartupManager.java
Wed Apr 30 10:30:32 2014
@@ -29,7 +29,6 @@ import java.util.Map;
 import org.apache.felix.framework.Logger;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.apache.sling.launchpad.api.StartupMode;
-import org.apache.sling.launchpad.base.shared.SharedConstants;
 import org.osgi.framework.Constants;
 
 /**
@@ -61,10 +60,6 @@ public class StartupManager {
 
     private final File confDir;
 
-    private final long targetStartLevel;
-
-    private final boolean incrementalStartupEnabled;
-
     StartupManager(final Map<String, String> properties,
                    final Logger logger) {
         this.logger = logger;
@@ -78,16 +73,7 @@ public class StartupManager {
         } else {
             this.mode = detectMode(properties.get(Constants.FRAMEWORK_STORAGE));
             this.logger.log(Logger.LOG_INFO, "Detected startup mode. Starting in mode " +
this.mode);
-        }
-
-        this.targetStartLevel = Long.valueOf(properties.get(Constants.FRAMEWORK_BEGINNING_STARTLEVEL));
-
-        this.incrementalStartupEnabled = Boolean.valueOf(properties.get(SharedConstants.SLING_INSTALL_INCREMENTAL_START));
-
-        // if this is not a restart, reduce start level
-        if ( this.mode != StartupMode.RESTART && this.incrementalStartupEnabled )
{
-            final String startLevel = properties.get(SharedConstants.SLING_INSTALL_STARTLEVEL);
-            properties.put(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, startLevel != null ?
startLevel : "10");
+            properties.put(OVERRIDE_PROP, this.mode.toString());
         }
     }
 
@@ -100,21 +86,6 @@ public class StartupManager {
     }
 
     /**
-     * Is the incremental startup enabled?
-     */
-    public boolean isIncrementalStartupEnabled() {
-        return this.incrementalStartupEnabled;
-    }
-
-    /**
-     * Return the target start level.
-     * @return Target start level
-     */
-    public long getTargetStartLevel() {
-        return this.targetStartLevel;
-    }
-
-    /**
      * Detect the startup mode by comparing time stamps
      */
     private StartupMode detectMode(final String osgiStorageDir) {

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/SharedConstants.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/SharedConstants.java?rev=1591236&r1=1591235&r2=1591236&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/SharedConstants.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/SharedConstants.java
Wed Apr 30 10:30:32 2014
@@ -125,7 +125,9 @@ public interface SharedConstants {
      * the initial framework start level is reached (value is "sling.framework.install.incremental").
      * The default value is false, disabling this feature.
      * @since 2.4.0
+     * @deprecated This property is not used anymore.
      */
+    @Deprecated
     public static final String SLING_INSTALL_INCREMENTAL_START = "sling.framework.install.incremental";
 
     /**
@@ -136,6 +138,8 @@ public interface SharedConstants {
      * This level is only used if {@link #SLING_INSTALL_INCREMENTAL_START} is
      * enabled. Default value is 10.
      * @since 2.4.0
+     * @deprecated This property is not used anymore.
      */
+    @Deprecated
     public static final String SLING_INSTALL_STARTLEVEL = "sling.framework.install.startlevel";
 }

Modified: sling/trunk/launchpad/base/src/main/resources/sling.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/sling.properties?rev=1591236&r1=1591235&r2=1591236&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/sling.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/sling.properties Wed Apr 30 10:30:32 2014
@@ -130,13 +130,28 @@ org.osgi.framework.storage = ${sling.lau
 # Default initial framework start level 
 org.osgi.framework.startlevel.beginning=30
 
-# Install and update initial framework start level
-# This should be lower than the default initial framework start level
-# During an install or update, the framework starts with this level
-# and the startup manager increases the start level by one
-# until the initial framework start level is reached.
+# 
+# By default the framework on startup tries to go straight to
+# the beginning start level (set above).
+# However, in the case of an install or update a slower startup
+# by increasing the level one by one and waiting for the OSGi
+# installer to finish might be more appropriate.
+# In this case, set org.osgi.framework.startlevel.beginning to
+# a lower start level and sling.framework.install.startlevel to
+# the final start level. The framework is then started with
+# the beginning start level and Sling's startup handler will
+# increase it to the sling.framework.startup.startlevel.
+# If sling.framework.startup.incremental is set to true for
+# an install and update this is done level by level.
+# If you use the below properties make sure to comment the above
+# definition for org.osgi.framework.startlevel out.
+# 
 # sling.framework.install.incremental=true
-# sling.framework.install.startlevel=10
+# org.osgi.framework.startlevel.beginning=10
+# sling.framework.install.startlevel=30
+# sling.framework.startup.incremental=true
+# sling.framework.startup.startlevel
+
 
 #
 # Default start level for newly installed bundles not explicitly assigned



Mime
View raw message