[jboss-cvs] JBossAS SVN: r59342 - in projects/osgi/trunk: core core/src/main/org/jboss/osgi/core core/src/main/org/jboss/osgi/core/kernel core/src/main/org/jboss/osgi/core/util deployment deployment/src/main/org/jboss/osgi/deployment deployment/src/main/org/jboss/osgi/deployment/activator

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 4 06:24:12 EST 2007


Author: alesj
Date: 2007-01-04 06:24:03 -0500 (Thu, 04 Jan 2007)
New Revision: 59342

Added:
   projects/osgi/trunk/core/src/main/org/jboss/osgi/core/kernel/
   projects/osgi/trunk/core/src/main/org/jboss/osgi/core/kernel/BundleBootstrap.java
   projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/
   projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/BundleConstants.java
   projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/OsgiPlatformUtil.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/AbstractKernelDeploymentSupport.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/BundleListener.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentConfigurator.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentCreator.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentDestroyer.java
Modified:
   projects/osgi/trunk/core/core.iml
   projects/osgi/trunk/deployment/deployment.iml
Log:
initial code - it will eventually be removed

Modified: projects/osgi/trunk/core/core.iml
===================================================================
--- projects/osgi/trunk/core/core.iml	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/core/core.iml	2007-01-04 11:24:03 UTC (rev 59342)
@@ -28,9 +28,44 @@
           <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-microcontainer-src.zip!/" />
+        </SOURCES>
       </library>
     </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-dependency.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-dependency-src.zip!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-container-src.zip!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Added: projects/osgi/trunk/core/src/main/org/jboss/osgi/core/kernel/BundleBootstrap.java
===================================================================
--- projects/osgi/trunk/core/src/main/org/jboss/osgi/core/kernel/BundleBootstrap.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/core/src/main/org/jboss/osgi/core/kernel/BundleBootstrap.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,182 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.core.kernel;
+
+import java.net.URL;
+import java.util.Enumeration;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.osgi.core.util.BundleConstants;
+import org.osgi.framework.BundleContext;
+
+/**
+ * TODO - wrong, we need hooks into OSGi framework
+ * to integrate our deployers with their deployment
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BundleBootstrap extends BasicBootstrap
+{
+   /**
+    * The kernel deployer used to load the server deployers
+    */
+   protected BasicXMLDeployer kernelDeployer;
+
+   /**
+    * The controller
+    */
+   protected KernelController controller;
+
+   /**
+    * Bundle context
+    */
+   protected BundleContext bundleContext;
+
+   /**
+    * Using BundleContext header props
+    *
+    * @param bundleContext
+    */
+   public BundleBootstrap(BundleContext bundleContext)
+   {
+      this.bundleContext = bundleContext;
+   }
+
+   @Override
+   public void bootstrap() throws Throwable
+   {
+      // Bootstrap the core kernel
+      super.bootstrap();
+
+      kernelDeployer = new BasicXMLDeployer(getKernel());
+
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+      String bootstrapResName = bundleContext.getProperty(BundleConstants.BUNDLE_BEANS);
+      if (bootstrapResName == null)
+         bootstrapResName = BundleConstants.BOOTSTRAP_XML_NAME;
+
+      log.debug("Scanning for bootstrap resources: " + bootstrapResName);
+      Enumeration<URL> descriptors = cl.getResources(bootstrapResName);
+      while (descriptors.hasMoreElements())
+      {
+         URL url = descriptors.nextElement();
+         log.debug("Found: " + url);
+         deploy(url);
+      }
+
+      String metaInfBootstrapResName = "META-INF/" + bootstrapResName;
+      log.debug("Scanning for bootstrap resources: " + metaInfBootstrapResName);
+      descriptors = cl.getResources(metaInfBootstrapResName);
+      while (descriptors.hasMoreElements())
+      {
+         URL url = descriptors.nextElement();
+         log.debug("Found: " + url);
+         deploy(url);
+      }
+
+      Kernel kernel = getKernel();
+      controller = kernel.getController();
+   }
+
+   /**
+    * Get a bean
+    *
+    * @param <T>          the expected type
+    * @param name         the bean name
+    * @param expectedType the expected type
+    * @return the bean
+    * @throws IllegalStateException if the bean is not installed or has the wrong type
+    */
+   public <T> T getBean(Object name, Class<T> expectedType)
+   {
+      return getBean(name, expectedType, true);
+   }
+
+   /**
+    * Get a bean
+    *
+    * @param <T>                    the expected type
+    * @param name                   the bean name
+    * @param expectedType           the expected type
+    * @param exceptionOnNullTarget  od we throw on null context or target
+    * @return the bean
+    * @throws IllegalStateException if the bean is not installed or has the wrong type
+    */
+   public <T> T getBean(Object name, Class<T> expectedType, boolean exceptionOnNullTarget)
+   {
+      ControllerContext context = controller.getInstalledContext(name);
+      if (context == null && exceptionOnNullTarget)
+         throw new IllegalStateException("Context not installed: " + name);
+      Object result = context != null ? context.getTarget() : null;
+      if (result == null)
+      {
+         if (exceptionOnNullTarget)
+            throw new IllegalStateException("No target for " + name);
+         else
+            return null;
+      }
+      if (expectedType.isInstance(result) == false)
+         throw new IllegalStateException(name + " expected " + expectedType.getName() + " was " + result.getClass().getName());
+      return expectedType.cast(result);
+   }
+
+   /**
+    * Bootstrap deployment of the
+    *
+    * @param url the deployment url
+    * @throws Throwable for any error
+    */
+   protected void deploy(URL url) throws Throwable
+   {
+      log.debug("Deploying bootstrap config: " + url);
+      kernelDeployer.deploy(url);
+   }
+
+   /**
+    * Undeploy a url
+    *
+    * @param url the deployment url
+    */
+   protected void undeploy(URL url)
+   {
+      try
+      {
+         log.debug("Undeploying bootstrap config: " + url);
+         kernelDeployer.undeploy(url);
+      }
+      catch (Throwable t)
+      {
+         log.warn("Error during undeployment: " + url, t);
+      }
+   }
+
+   public void shutdown()
+   {
+      kernelDeployer.shutdown();
+   }
+
+}

Added: projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/BundleConstants.java
===================================================================
--- projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/BundleConstants.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/BundleConstants.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.core.util;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public final class BundleConstants
+{
+
+   /**
+    * The bundle beans property key
+    */
+   public static final String BUNDLE_BEANS = "Bundle-Beans";
+
+   /**
+    * The bootstrap file
+    */
+   public static final String BOOTSTRAP_XML_NAME = "bundle-beans.xml";
+
+   /**
+    * The bundle threads size prop key
+    */
+   public static final String BUNDLE_THREADS_KEY = "Bundle-Threads-Size";
+
+   /**
+    * The bundle threads size
+    */
+   public static final int DEFAULT_BUNDLE_THREADS_SIZE = 5;
+
+}

Added: projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/OsgiPlatformUtil.java
===================================================================
--- projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/OsgiPlatformUtil.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/core/src/main/org/jboss/osgi/core/util/OsgiPlatformUtil.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.core.util;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+/**
+ * We still need to differentiate OSGi platforms,
+ * to work aorund certain limitations, bugs, ...
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public final class OsgiPlatformUtil
+{
+
+   private static Set<String> EQUINOX;
+   private static Set<String> FELIX;
+   private static Set<String> KNOPFLERFISH;
+
+   static
+   {
+      EQUINOX = new TreeSet<String>(Arrays.asList("Eclipse", "eclipse", "Equinox", "equinox"));
+      FELIX = new TreeSet<String>(Arrays.asList("Apache Software Foundation", "Felix", "felix"));
+      KNOPFLERFISH = new TreeSet<String>(Arrays.asList("Knopflerfish", "knopflerfish"));
+      // todo read from properties to maybe add some more
+   }
+
+   private static boolean canMatchVendor(BundleContext context, Set<String> strings)
+   {
+      String vendor = context.getProperty(Constants.FRAMEWORK_VENDOR);
+      if (vendor != null)
+      {
+         for (String string : strings)
+         {
+            if (string.contains(vendor))
+            {
+               return true;
+            }
+         }
+      }
+      return false;
+   }
+
+   public static boolean isEquinox(BundleContext context)
+   {
+      return canMatchVendor(context, EQUINOX);
+   }
+
+   public static boolean isFelix(BundleContext context)
+   {
+      return canMatchVendor(context, FELIX);
+   }
+
+   public static boolean isKnopflerfish(BundleContext context)
+   {
+      return canMatchVendor(context, KNOPFLERFISH);
+   }
+
+   public static boolean isMatchingPlatform(BundleContext context, String vendorProperty)
+   {
+      return canMatchVendor(context, Collections.singleton(vendorProperty));
+   }
+
+}

Modified: projects/osgi/trunk/deployment/deployment.iml
===================================================================
--- projects/osgi/trunk/deployment/deployment.iml	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/deployment/deployment.iml	2007-01-04 11:24:03 UTC (rev 59342)
@@ -12,6 +12,17 @@
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="core" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-deployers.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../thirdparty/jboss/microcontainer/lib/jboss-deployers-src.zip!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/AbstractKernelDeploymentSupport.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/AbstractKernelDeploymentSupport.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/AbstractKernelDeploymentSupport.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployment.activator;
+
+import java.util.Map;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractKernelDeploymentSupport implements Runnable
+{
+
+   protected Bundle bundle;
+   protected Map managedBudles;
+   protected Map initializingBundles;
+
+   protected Long bundleId;
+
+   public AbstractKernelDeploymentSupport(Bundle bundle, Map managedBudles, Map initializingBundles)
+   {
+      this.bundle = bundle;
+      this.managedBudles = managedBudles;
+      this.initializingBundles = initializingBundles;
+      this.bundleId = bundle.getBundleId();
+   }
+
+}

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/BundleListener.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/BundleListener.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/BundleListener.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,162 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployment.activator;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.core.kernel.BundleBootstrap;
+import org.jboss.osgi.core.util.BundleConstants;
+import org.osgi.framework.*;
+
+/**
+ * TODO - wrong, we need hooks into OSGi framework
+ * to integrate our deployers with their deployment
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BundleListener implements BundleActivator, SynchronousBundleListener
+{
+   private static Logger log = Logger.getLogger(BundleListener.class);
+
+   private Long bundleId;
+   // current bundle deployment additional info
+   private BundleBootstrap bundleBootstrap;
+   private ExecutorService executorService;
+
+   private Map managedBundles;
+   private Map initializingBundles;
+
+   public BundleListener()
+   {
+   }
+
+   public void start(BundleContext context) throws Exception
+   {
+      bundleId = context.getBundle().getBundleId();
+      if (log.isTraceEnabled())
+      {
+         log.trace("Starting bundle with id: " + bundleId);
+         log.trace("Initializing BundleBootstrap ...");
+      }
+      // current bundle bootstrap
+      bundleBootstrap = new BundleBootstrap(context);
+      // executor service
+      String threadsSize = context.getProperty(BundleConstants.BUNDLE_THREADS_KEY);
+      int defaultSize = BundleConstants.DEFAULT_BUNDLE_THREADS_SIZE;
+      if (threadsSize != null)
+      {
+         defaultSize = Integer.parseInt(threadsSize);
+      }
+      executorService = createExecutorService(defaultSize);
+   }
+
+   public void stop(BundleContext context) throws Exception
+   {
+      bundleId = null;
+      if (log.isTraceEnabled())
+      {
+         log.trace("Shutting down ExecutorService and BundleBootstrap ...");
+      }
+      try
+      {
+         executorService.shutdown();
+      }
+      catch (Exception ignored)
+      {
+         //ignored
+      }
+      executorService = null;
+      if (bundleBootstrap != null)
+      {
+         try
+         {
+            bundleBootstrap.shutdown();
+         }
+         finally
+         {
+            bundleBootstrap = null;
+         }
+      }
+   }
+
+   /**
+    * Watch for bundles - start, stop, resolved, unresolved.
+    * Limit the runtime work here since this is synchronous.
+    *
+    * @param event
+    */
+   public void bundleChanged(BundleEvent event)
+   {
+      if (event.getBundle().getBundleId() == bundleId)
+      {
+         return;
+      }
+
+      switch (event.getType())
+      {
+         case BundleEvent.RESOLVED:
+            break;
+         case BundleEvent.STARTED:
+            startKernelDeployment(event.getBundle());
+            break;
+         case BundleEvent.STOPPING:
+            stopKernelDeployment(event.getBundle());
+            break;
+         case BundleEvent.UNRESOLVED:
+            break;
+      }
+   }
+
+   private void startKernelDeployment(Bundle bundle)
+   {
+      KernelDeploymentCreator creator = new KernelDeploymentCreator(bundle, managedBundles, initializingBundles);
+      executorService.submit(creator);
+   }
+
+   private void stopKernelDeployment(Bundle bundle)
+   {
+      KernelDeploymentDestroyer destroyer = new KernelDeploymentDestroyer(bundle, managedBundles, initializingBundles);
+      destroyer.run();
+   }
+
+   protected ExecutorService createExecutorService(int defaultSize)
+   {
+      ExecutorService executorService = bundleBootstrap.getBean("ExecutorService", ExecutorService.class, false);
+      if (executorService != null)
+      {
+         if (log.isTraceEnabled())
+         {
+            log.trace("Found ExecutorService in bundle beans: " + executorService);
+         }
+         return executorService;
+      }
+      if (log.isTraceEnabled())
+      {
+         log.trace("No ExecutorService found in bundle beans, creating default.");
+      }
+      return Executors.newFixedThreadPool(defaultSize);
+   }
+
+}

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentConfigurator.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentConfigurator.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentConfigurator.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployment.activator;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class KernelDeploymentConfigurator
+{
+
+   private Bundle bundle;
+
+   public KernelDeploymentConfigurator(Bundle bundle)
+   {
+      this.bundle = bundle;
+      configure();
+   }
+
+   private void configure()
+   {
+
+   }
+
+}

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentCreator.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentCreator.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentCreator.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployment.activator;
+
+import java.util.Map;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class KernelDeploymentCreator extends AbstractKernelDeploymentSupport
+{
+
+   public KernelDeploymentCreator(Bundle bundle, Map managedBudles, Map initializingBundles)
+   {
+      super(bundle, managedBudles, initializingBundles);
+   }
+
+   public void run()
+   {
+      KernelDeploymentConfigurator configurator = new KernelDeploymentConfigurator(bundle);
+      
+   }
+
+}

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentDestroyer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentDestroyer.java	2007-01-04 11:23:13 UTC (rev 59341)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployment/activator/KernelDeploymentDestroyer.java	2007-01-04 11:24:03 UTC (rev 59342)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployment.activator;
+
+import java.util.Map;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class KernelDeploymentDestroyer extends AbstractKernelDeploymentSupport
+{
+
+   public KernelDeploymentDestroyer(Bundle bundle, Map managedBudles, Map initializingBundles)
+   {
+      super(bundle, managedBudles, initializingBundles);
+   }
+
+   public void run()
+   {
+   }
+
+}




More information about the jboss-cvs-commits mailing list