[jboss-osgi-commits] JBoss-OSGI SVN: r93108 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade: plugins and 1 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue Sep 1 19:59:46 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-09-01 19:59:46 -0400 (Tue, 01 Sep 2009)
New Revision: 93108

Added:
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/StartLevelImpl.java
Modified:
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/SystemPackagesPluginImpl.java
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/MicrocontainerServiceImpl.java
Log:
Add simple StartLevel service

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java	2009-09-01 23:58:52 UTC (rev 93107)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java	2009-09-01 23:59:46 UTC (rev 93108)
@@ -54,6 +54,7 @@
 import org.jboss.osgi.plugins.facade.api.BundleStoragePlugin;
 import org.jboss.osgi.plugins.facade.api.FrameworkEventsPlugin;
 import org.jboss.osgi.plugins.facade.service.MicrocontainerServiceImpl;
+import org.jboss.osgi.plugins.facade.service.StartLevelImpl;
 import org.jboss.osgi.plugins.filter.NoFilter;
 import org.jboss.osgi.plugins.metadata.AbstractOSGiMetaData;
 import org.jboss.osgi.spi.metadata.OSGiMetaData;
@@ -889,7 +890,8 @@
 
       // Register build-in services 
       BundleContext sysContext = systemBundle.getBundleContext();
-      new MicrocontainerServiceImpl(kernel, sysContext).start();
+      new MicrocontainerServiceImpl(kernel, sysContext);
+      new StartLevelImpl(sysContext);
       
       // All installed bundles must be started
       AutoInstallPlugin autoInstall = getOptionalPlugin(AutoInstallPlugin.class);

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/SystemPackagesPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/SystemPackagesPluginImpl.java	2009-09-01 23:58:52 UTC (rev 93107)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/SystemPackagesPluginImpl.java	2009-09-01 23:59:46 UTC (rev 93108)
@@ -101,9 +101,7 @@
          allPackages.add("org.osgi.framework.launch");
          allPackages.add("org.osgi.service.startlevel");
          allPackages.add("org.osgi.service.packageadmin");
-         allPackages.add("org.osgi.util.tracker");
          
-         
          String asString = packagesAsString(allPackages);
          bundleManager.setProperty(Constants.FRAMEWORK_SYSTEMPACKAGES, asString);
       }

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/MicrocontainerServiceImpl.java	2009-09-01 23:58:52 UTC (rev 93107)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/MicrocontainerServiceImpl.java	2009-09-01 23:59:46 UTC (rev 93108)
@@ -73,10 +73,7 @@
 
       this.kernel = kernel;
       this.sysContext = sysContext;
-   }
-
-   public void start()
-   {
+      
       installKernelBean(BEAN_SYSTEM_BUNDLE_CONTEXT, sysContext);
       sysContext.registerService(MicrocontainerService.class.getName(), this, null);
 

Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/StartLevelImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/StartLevelImpl.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/StartLevelImpl.java	2009-09-01 23:59:46 UTC (rev 93108)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.plugins.facade.service;
+
+//$Id:$
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.startlevel.StartLevel;
+
+/**
+ * An implementation of the {@link StartLevel}.
+ * 
+ * [TODO] Move this service to a plugin and implement properly 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 31-Aug-2009
+ */
+public class StartLevelImpl implements StartLevel
+{
+   /** The log */
+   private static final Logger log = Logger.getLogger(StartLevelImpl.class);
+
+   public StartLevelImpl(BundleContext sysContext)
+   {
+      if (sysContext == null)
+         throw new IllegalArgumentException("Null sysContext");
+      
+      sysContext.registerService(StartLevel.class.getName(), this, null);
+   }
+   
+   public int getBundleStartLevel(Bundle bundle)
+   {
+      return 0;
+   }
+
+   public int getInitialBundleStartLevel()
+   {
+      return 0;
+   }
+
+   public int getStartLevel()
+   {
+      return 0;
+   }
+
+   public boolean isBundleActivationPolicyUsed(Bundle bundle)
+   {
+      return false;
+   }
+
+   public boolean isBundlePersistentlyStarted(Bundle bundle)
+   {
+      return false;
+   }
+
+   public void setBundleStartLevel(Bundle bundle, int startlevel)
+   {
+      log.info("Ignore setBundleStartLevel(" + bundle + "," + startlevel + ")");
+   }
+
+   public void setInitialBundleStartLevel(int startlevel)
+   {
+      log.info("Ignore setInitialBundleStartLevel(" + startlevel + ")");
+   }
+
+   public void setStartLevel(int startlevel)
+   {
+      log.info("Ignore setStartLevel(" + startlevel + ")");
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/StartLevelImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF



More information about the jboss-osgi-commits mailing list