geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1134173 - in /geronimo/server/trunk/framework: configs/karaf-framework/src/main/filtered-resources/etc/config.properties modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
Date Fri, 10 Jun 2011 02:03:54 GMT
Author: rwonly
Date: Fri Jun 10 02:03:53 2011
New Revision: 1134173

URL: http://svn.apache.org/viewvc?rev=1134173&view=rev
Log:
Do need to manually set the framework beginning start level

Modified:
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/config.properties
    geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/config.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/config.properties?rev=1134173&r1=1134172&r2=1134173&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/config.properties
(original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/config.properties
Fri Jun 10 02:03:53 2011
@@ -63,8 +63,11 @@ org.osgi.framework.executionenvironment=
 # To enable the use of the startup.properties file to control the start level:
 karaf.auto.start=startup.properties
 
+# OSGi framework beginning start level
 org.osgi.framework.startlevel.beginning=100
+# initial bundle start level
 karaf.startlevel.bundle=60
+# only used by karaf shell to filter the bundle list
 karaf.systemBundlesStartLevel=50
 
 #

Modified: geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java?rev=1134173&r1=1134172&r2=1134173&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
Fri Jun 10 02:03:53 2011
@@ -96,7 +96,6 @@ public class FrameworkLauncher {
     private Properties configProps = null;
         
     private Framework framework = null;
-    private int defaultStartLevel = 100;
     
     public void setLog4jConfigFile(String log4jFile) {
         this.log4jFile = log4jFile;
@@ -154,11 +153,7 @@ public class FrameworkLauncher {
             configProps.setProperty(Constants.FRAMEWORK_STORAGE_CLEAN, 
                                     Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
         }
-                
-        defaultStartLevel = Integer.parseInt(configProps.getProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL));
 
-        configProps.setProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, "1");
-        
         Runtime.getRuntime().addShutdownHook(new Thread() {
             public void run() {
                 FrameworkLauncher.this.destroy(false);
@@ -169,13 +164,19 @@ public class FrameworkLauncher {
         ServiceLoader<FrameworkFactory> loader = ServiceLoader.load(FrameworkFactory.class);
         FrameworkFactory factory = loader.iterator().next();
         framework = factory.newFramework(new StringMap(configProps, false));
-        framework.start();
-                
-        serverInfo = new ServerInfo(geronimoHome, geronimoBase);        
-        framework.getBundleContext().registerService(ServerInfo.class.getName(), serverInfo,
null);
+        
+        framework.init();
+        
+        BundleContext bundleContext = framework.getBundleContext();
+        
+        serverInfo = new ServerInfo(geronimoHome, geronimoBase);      
+        bundleContext.registerService(ServerInfo.class.getName(), serverInfo, null);
         
         List<BundleInfo> startList = loadStartupProperties();
-        startBundles(startList);        
+        startBundles(bundleContext, startList);
+        
+        framework.start();
+
     }
 
     public void destroy(boolean await) {
@@ -327,8 +328,7 @@ public class FrameworkLauncher {
         mth.invoke(classLoader, bundleFile.toURL());
     }
 
-    private void startBundles(List<BundleInfo> startList) throws Exception {
-        BundleContext context = framework.getBundleContext();
+    private void startBundles(BundleContext context, List<BundleInfo> startList) throws
Exception {
         
         // Retrieve the Start Level service, since it will be needed
         // to set the start level of the installed bundles.
@@ -357,7 +357,6 @@ public class FrameworkLauncher {
             info.bundle.start();
         }
         
-        sl.setStartLevel(defaultStartLevel);
     }
     
     private List<BundleInfo> loadStartupProperties() throws Exception {        



Mime
View raw message