[jboss-cvs] JBossAS SVN: r92586 - in projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc: framework and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 19 16:15:29 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-08-19 16:15:29 -0400 (Wed, 19 Aug 2009)
New Revision: 92586

Modified:
   projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/api/FrameworkBootstrap.java
   projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkBootstrapImpl.java
   projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
   projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java
Log:
Prepare MC Framework configuration

Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/api/FrameworkBootstrap.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/api/FrameworkBootstrap.java	2009-08-19 19:56:30 UTC (rev 92585)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/api/FrameworkBootstrap.java	2009-08-19 20:15:29 UTC (rev 92586)
@@ -26,12 +26,14 @@
 import org.osgi.framework.launch.Framework;
 
 /**
- * An impementation of an OSGi Framework
+ * An abstration of a bootstrap bean that can provide an OSGi Framework. 
  * 
  * @author thomas.diesler at jboss.com
  * @since 29-Jul-2009
  */
 public interface FrameworkBootstrap
 {
+   public static final String BEAN_FRAMEWORK_BOOTSTRAP = "jboss.osgi:service=FrameworkBootstrap";
+
    Framework getFramework();
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkBootstrapImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkBootstrapImpl.java	2009-08-19 19:56:30 UTC (rev 92585)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkBootstrapImpl.java	2009-08-19 20:15:29 UTC (rev 92586)
@@ -28,11 +28,19 @@
 import java.util.Map;
 
 import org.jboss.logging.Logger;
+import org.jboss.osgi.jbossmc.api.BundleEventManager;
+import org.jboss.osgi.jbossmc.api.BundleFactory;
+import org.jboss.osgi.jbossmc.api.BundlePersistentStorage;
+import org.jboss.osgi.jbossmc.api.BundleRegistry;
+import org.jboss.osgi.jbossmc.api.BundleResolver;
 import org.jboss.osgi.jbossmc.api.FrameworkBootstrap;
+import org.jboss.osgi.jbossmc.api.FrameworkEventManager;
+import org.jboss.osgi.jbossmc.api.ServiceEventManager;
+import org.jboss.osgi.jbossmc.api.ServiceRegistry;
 import org.osgi.framework.launch.Framework;
 
 /**
- * An impementation of an OSGi Framework
+ * An implementation of a bootstrap bean that can provide an OSGi Framework. 
  * 
  * @author thomas.diesler at jboss.com
  * @since 29-Jul-2009
@@ -47,6 +55,15 @@
    private List<URL> autoStart;
    private Framework framework;
 
+   private BundleRegistry bundleRegistry;
+   private BundleFactory bundleFactory;
+   private BundleResolver bundleResolver;
+   private BundleEventManager bundleEventManager;
+   private BundlePersistentStorage bundlePersistentStorage;
+   private FrameworkEventManager frameworkEventManager;
+   private ServiceEventManager serviceEventManager;
+   private ServiceRegistry serviceRegistry;
+   
    public void setProperties(Map<String, Object> properties)
    {
       this.properties = properties;
@@ -62,11 +79,60 @@
       this.autoStart = autoStart;
    }
 
+   public void setBundleRegistry(BundleRegistry bundleRegistry)
+   {
+      this.bundleRegistry = bundleRegistry;
+   }
+
+   public void setBundleFactory(BundleFactory bundleFactory)
+   {
+      this.bundleFactory = bundleFactory;
+   }
+
+   public void setBundleResolver(BundleResolver bundleResolver)
+   {
+      this.bundleResolver = bundleResolver;
+   }
+
+   public void setBundleEventManager(BundleEventManager bundleEventManager)
+   {
+      this.bundleEventManager = bundleEventManager;
+   }
+
+   public void setBundlePersistentStorage(BundlePersistentStorage bundlePersistentStorage)
+   {
+      this.bundlePersistentStorage = bundlePersistentStorage;
+   }
+
+   public void setServiceEventManager(ServiceEventManager serviceEventManager)
+   {
+      this.serviceEventManager = serviceEventManager;
+   }
+
+   public void setServiceRegistry(ServiceRegistry serviceRegistry)
+   {
+      this.serviceRegistry = serviceRegistry;
+   }
+
+   public void setFrameworkEventManager(FrameworkEventManager frameworkEventManager)
+   {
+      this.frameworkEventManager = frameworkEventManager;
+   }
+
    public Framework getFramework()
    {
       if (framework == null)
       {
-         framework = new FrameworkImpl(properties);
+         FrameworkImpl frameworkImpl = new FrameworkImpl(properties);
+         frameworkImpl.setBundleFactory(bundleFactory);
+         frameworkImpl.setBundleResolver(bundleResolver);
+         frameworkImpl.setBundleRegistry(bundleRegistry);
+         frameworkImpl.setBundlePersistentStorage(bundlePersistentStorage);
+         frameworkImpl.setServiceRegistry(serviceRegistry);
+         frameworkImpl.setBundleEventManager(bundleEventManager);
+         frameworkImpl.setFrameworkEventManager(frameworkEventManager);
+         frameworkImpl.setServiceEventManager(serviceEventManager);
+         framework = frameworkImpl;
       }
       return framework;
    }

Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java	2009-08-19 19:56:30 UTC (rev 92585)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java	2009-08-19 20:15:29 UTC (rev 92586)
@@ -44,7 +44,6 @@
  */
 public class FrameworkFactoryImpl implements FrameworkFactory
 {
-   private static final String BEAN_FRAMEWORK_BOOTSTRAP = "jboss.osgi:service=FrameworkBootstrap";
    // Provide logging
    final Logger log = Logger.getLogger(FrameworkFactoryImpl.class);
 
@@ -70,9 +69,9 @@
          throw new IllegalStateException("Cannot bootstrap MC server", ex);
       }
 
-      ControllerContext context = server.getKernel().getController().getInstalledContext(BEAN_FRAMEWORK_BOOTSTRAP);
+      ControllerContext context = server.getKernel().getController().getInstalledContext(FrameworkBootstrap.BEAN_FRAMEWORK_BOOTSTRAP);
       if (context == null)
-         throw new IllegalStateException("Cannot obtain: " + BEAN_FRAMEWORK_BOOTSTRAP);
+         throw new IllegalStateException("Cannot obtain: " + FrameworkBootstrap.BEAN_FRAMEWORK_BOOTSTRAP);
       
       FrameworkBootstrap frameworkBootstrap =  (FrameworkBootstrap)context.getTarget();
       return frameworkBootstrap.getFramework();

Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java	2009-08-19 19:56:30 UTC (rev 92585)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java	2009-08-19 20:15:29 UTC (rev 92586)
@@ -75,6 +75,81 @@
          properties.putAll(props);
    }
 
+   public BundleRegistry getBundleRegistry()
+   {
+      return bundleRegistry;
+   }
+
+   public void setBundleRegistry(BundleRegistry bundleRegistry)
+   {
+      this.bundleRegistry = bundleRegistry;
+   }
+
+   public BundleFactory getBundleFactory()
+   {
+      return bundleFactory;
+   }
+
+   public void setBundleFactory(BundleFactory bundleFactory)
+   {
+      this.bundleFactory = bundleFactory;
+   }
+
+   public BundleResolver getBundleResolver()
+   {
+      return bundleResolver;
+   }
+
+   public void setBundleResolver(BundleResolver bundleResolver)
+   {
+      this.bundleResolver = bundleResolver;
+   }
+
+   public BundleEventManager getBundleEventManager()
+   {
+      return bundleEventManager;
+   }
+
+   public void setBundleEventManager(BundleEventManager bundleEventManager)
+   {
+      this.bundleEventManager = bundleEventManager;
+   }
+
+   public BundlePersistentStorage getBundlePersistentStorage()
+   {
+      return bundlePersistentStorage;
+   }
+
+   public void setBundlePersistentStorage(BundlePersistentStorage bundlePersistentStorage)
+   {
+      this.bundlePersistentStorage = bundlePersistentStorage;
+   }
+
+   public ServiceEventManager getServiceEventManager()
+   {
+      return serviceEventManager;
+   }
+
+   public void setServiceEventManager(ServiceEventManager serviceEventManager)
+   {
+      this.serviceEventManager = serviceEventManager;
+   }
+
+   public ServiceRegistry getServiceRegistry()
+   {
+      return serviceRegistry;
+   }
+
+   public void setServiceRegistry(ServiceRegistry serviceRegistry)
+   {
+      this.serviceRegistry = serviceRegistry;
+   }
+
+   public void setFrameworkEventManager(FrameworkEventManager frameworkEventManager)
+   {
+      this.frameworkEventManager = frameworkEventManager;
+   }
+
    /**
     * Returns the Framework unique identifier. This Framework is assigned the unique identifier zero (0) since this Framework is also a System Bundle.
     */
@@ -308,41 +383,6 @@
       return new FrameworkEvent(FrameworkEvent.STOPPED, this, null);
    }
 
-   public BundleFactory getBundleFactory()
-   {
-      return bundleFactory;
-   }
-
-   public BundleRegistry getBundleRegistry()
-   {
-      return bundleRegistry;
-   }
-
-   public BundleResolver getBundleResolver()
-   {
-      return bundleResolver;
-   }
-
-   public BundlePersistentStorage getBundlePersistentStorage()
-   {
-      return bundlePersistentStorage;
-   }
-
-   public ServiceRegistry getServiceRegistry()
-   {
-      return serviceRegistry;
-   }
-
-   public BundleEventManager getBundleEventManager()
-   {
-      return bundleEventManager;
-   }
-
-   public ServiceEventManager getServiceEventManager()
-   {
-      return serviceEventManager;
-   }
-
    public FrameworkEventManager getFrameworkEventManager()
    {
       return frameworkEventManager;




More information about the jboss-cvs-commits mailing list