[jboss-cvs] JBossAS SVN: r92784 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk: src/main/java/org/jboss/osgi/plugins/deployers/bundle and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 25 05:42:21 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-08-25 05:42:20 -0400 (Tue, 25 Aug 2009)
New Revision: 92784

Added:
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java
Removed:
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleClassLoadingDeployer.java
Modified:
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/bootstrap/bootstrap.xml
Log:
Update to classloading-2.0.7-SNAPSHOT

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml	2009-08-25 09:35:37 UTC (rev 92783)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml	2009-08-25 09:42:20 UTC (rev 92784)
@@ -1,3 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+  <!-- ====================================================================== -->
+  <!--                                                                        -->
+  <!--  JBoss, the OpenSource J2EE webOS                                      -->
+  <!--                                                                        -->
+  <!--  Distributable under LGPL license.                                     -->
+  <!--  See terms of license at http://www.gnu.org.                           -->
+  <!--                                                                        -->
+  <!-- ====================================================================== -->
+
+  <!-- $Id$ -->
+  
+  <!-- 
+     Set these VM properties in your IDE debugger 
+    
+    -Dlog4j.output.dir=${workspace_loc:jboss-osgi-runtime-microcontainer/target}
+  -->
+  
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
@@ -16,12 +35,13 @@
   <properties>
     <version.apache.felix.log>1.1.0-SNAPSHOT</version.apache.felix.log>
     <version.jboss.aop>2.1.0.CR3</version.jboss.aop>
+    <version.jboss.classloading>2.0.7-SNAPSHOT</version.jboss.classloading>
     <version.jboss.deployers>2.0.8.GA</version.jboss.deployers>
     <version.jboss.logging.log4j>2.1.0.GA</version.jboss.logging.log4j>
     <version.jboss.osgi.common>1.0.1-SNAPSHOT</version.jboss.osgi.common>
     <version.jboss.osgi.runtime.deployers>1.0.1-SNAPSHOT</version.jboss.osgi.runtime.deployers>
     <version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
-    <version.jboss.microcontainer>2.0.6.GA</version.jboss.microcontainer>
+    <version.jboss.microcontainer>2.0.7.GA</version.jboss.microcontainer>
     <version.jboss.test>1.1.4.GA</version.jboss.test>
     <version.osgi>r4v42-20090728</version.osgi>
   </properties>
@@ -32,26 +52,6 @@
       <artifactId>bnd</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.jboss.microcontainer</groupId>
-      <artifactId>jboss-kernel</artifactId>
-      <version>${version.jboss.microcontainer}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.deployers</groupId>
-      <artifactId>jboss-deployers-impl</artifactId>
-      <version>${version.jboss.deployers}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.deployers</groupId>
-      <artifactId>jboss-deployers-vfs-spi</artifactId>
-      <version>${version.jboss.deployers}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.deployers</groupId>
-      <artifactId>jboss-deployers-vfs</artifactId>
-      <version>${version.jboss.deployers}</version>
-    </dependency>
-    <dependency>
       <groupId>org.jboss.aop</groupId>
       <artifactId>jboss-aop</artifactId>
       <version>${version.jboss.aop}</version>
@@ -95,6 +95,31 @@
       </exclusions>
     </dependency>
     <dependency>
+      <groupId>org.jboss.cl</groupId>
+      <artifactId>jboss-classloading-vfs</artifactId>
+      <version>${version.jboss.classloading}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.deployers</groupId>
+      <artifactId>jboss-deployers-impl</artifactId>
+      <version>${version.jboss.deployers}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.deployers</groupId>
+      <artifactId>jboss-deployers-vfs-spi</artifactId>
+      <version>${version.jboss.deployers}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.deployers</groupId>
+      <artifactId>jboss-deployers-vfs</artifactId>
+      <version>${version.jboss.deployers}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <version>${version.jboss.microcontainer}</version>
+    </dependency>
+    <dependency>
       <groupId>org.jboss.osgi</groupId>
       <artifactId>jboss-osgi-spi</artifactId>
       <version>${version.jboss.osgi.spi}</version>

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleClassLoadingDeployer.java	2009-08-25 09:35:37 UTC (rev 92783)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleClassLoadingDeployer.java	2009-08-25 09:42:20 UTC (rev 92784)
@@ -1,138 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file 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.deployers.bundle;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.classloading.plugins.metadata.ModuleCapability;
-import org.jboss.classloading.plugins.metadata.PackageCapability;
-import org.jboss.classloading.plugins.metadata.PackageRequirement;
-import org.jboss.classloading.spi.metadata.Capability;
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.osgi.plugins.facade.api.SystemPackagesPlugin;
-import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
-import org.jboss.osgi.spi.metadata.OSGiMetaData;
-import org.jboss.osgi.spi.metadata.PackageAttribute;
-import org.jboss.osgi.spi.metadata.Parameter;
-import org.osgi.framework.Constants;
-
-/**
- * OSGiBundleClassLoadingDeployer.
- * <p>
- * 
- * This deployer maps osgi metadata into our classloading metadata.
- * 
- * [TODO] versions and attributes [TODO] require-bundle, dynamic-imports, etc.
- * 
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class OSGiBundleClassLoadingDeployer extends AbstractSimpleRealDeployer<OSGiMetaData>
-{
-   /** The bundle manager */
-   private OSGiBundleManager bundleManager;
-   
-   /**
-    * Create a new OSGiBundleClassLoadingDeployer.
-    * 
-    * @param bundleManager the bundleManager
-    * @throws IllegalArgumentException for a null bundle manager
-    */
-   public OSGiBundleClassLoadingDeployer(OSGiBundleManager bundleManager)
-   {
-      super(OSGiMetaData.class);
-      this.bundleManager = bundleManager;
-      
-      if (bundleManager == null)
-         throw new IllegalArgumentException("Null bundle manager");
-      
-      setTopLevelOnly(true);
-      setOutput(ClassLoadingMetaData.class);
-      setStage(DeploymentStages.POST_PARSE);
-   }
-
-   @Override
-   public void deploy(DeploymentUnit unit, OSGiMetaData metadata) throws DeploymentException
-   {
-      if (unit.isAttachmentPresent(ClassLoadingMetaData.class))
-         return;
-
-      ClassLoadingMetaData classLoadingMetaData = new ClassLoadingMetaData();
-      classLoadingMetaData.setName(metadata.getBundleSymbolicName());
-      classLoadingMetaData.setVersion(metadata.getBundleVersion());
-
-      Capability capability = new ModuleCapability(metadata.getBundleSymbolicName(), metadata.getBundleVersion());
-      classLoadingMetaData.getCapabilities().addCapability(capability);
-
-      ArrayList<String> exportedNames = new ArrayList<String>();
-      
-      List<PackageAttribute> exported = metadata.getExportPackages();
-      if (exported != null)
-      {
-         for (PackageAttribute packageAttribute : exported)
-         {
-            String packageName = packageAttribute.getPackageInfo().getName();
-            capability = new PackageCapability(packageName);
-            classLoadingMetaData.getCapabilities().addCapability(capability);
-            exportedNames.add(packageName);
-         }
-      }
-
-      List<PackageAttribute> imported = metadata.getImportPackages();
-      if (imported != null)
-      {
-         SystemPackagesPlugin syspackPlugin = bundleManager.getPlugin(SystemPackagesPlugin.class);
-         for (PackageAttribute packageAttribute : imported)
-         {
-            String packageName = packageAttribute.getPackageInfo().getName();
-            
-            // [TODO] Import package requirements should probably resolve against export capabilities
-            boolean isExportPackage = exportedNames.contains(packageName);
-            
-            // [TODO] Should system packages be added as capabilities?
-            boolean isSystemPackage = syspackPlugin.isSystemPackage(packageName);
-            
-            // [TODO] add exported package requirements
-            if (isSystemPackage == false && isExportPackage == false)
-            {
-               // [TODO] add version ranges
-               PackageRequirement requirement = new PackageRequirement(packageName);
-
-               Parameter resolution = packageAttribute.getParameter(Constants.RESOLUTION_DIRECTIVE);
-               if (resolution != null && Constants.RESOLUTION_OPTIONAL.equals(resolution.getValue()))
-                  requirement.setOptional(true);
-               
-               // [TODO] add optional package requirements
-               if (requirement.isOptional() == false)
-                  classLoadingMetaData.getRequirements().addRequirement(requirement);
-            }
-         }
-      }
-
-      unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData);
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java (from rev 92782, projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleClassLoadingDeployer.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java	2009-08-25 09:42:20 UTC (rev 92784)
@@ -0,0 +1,138 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.classloading;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.classloading.plugins.metadata.ModuleCapability;
+import org.jboss.classloading.plugins.metadata.PackageCapability;
+import org.jboss.classloading.plugins.metadata.PackageRequirement;
+import org.jboss.classloading.spi.metadata.Capability;
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.plugins.facade.api.SystemPackagesPlugin;
+import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
+import org.jboss.osgi.spi.metadata.OSGiMetaData;
+import org.jboss.osgi.spi.metadata.PackageAttribute;
+import org.jboss.osgi.spi.metadata.Parameter;
+import org.osgi.framework.Constants;
+
+/**
+ * OSGiBundleClassLoadingDeployer.
+ * <p>
+ * 
+ * This deployer maps osgi metadata into our classloading metadata.
+ * 
+ * [TODO] versions and attributes [TODO] require-bundle, dynamic-imports, etc.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class OSGiBundleClassLoadingDeployer extends AbstractSimpleRealDeployer<OSGiMetaData>
+{
+   /** The bundle manager */
+   private OSGiBundleManager bundleManager;
+   
+   /**
+    * Create a new OSGiBundleClassLoadingDeployer.
+    * 
+    * @param bundleManager the bundleManager
+    * @throws IllegalArgumentException for a null bundle manager
+    */
+   public OSGiBundleClassLoadingDeployer(OSGiBundleManager bundleManager)
+   {
+      super(OSGiMetaData.class);
+      this.bundleManager = bundleManager;
+      
+      if (bundleManager == null)
+         throw new IllegalArgumentException("Null bundle manager");
+      
+      setTopLevelOnly(true);
+      setOutput(ClassLoadingMetaData.class);
+      setStage(DeploymentStages.POST_PARSE);
+   }
+
+   @Override
+   public void deploy(DeploymentUnit unit, OSGiMetaData metadata) throws DeploymentException
+   {
+      if (unit.isAttachmentPresent(ClassLoadingMetaData.class))
+         return;
+
+      ClassLoadingMetaData classLoadingMetaData = new ClassLoadingMetaData();
+      classLoadingMetaData.setName(metadata.getBundleSymbolicName());
+      classLoadingMetaData.setVersion(metadata.getBundleVersion());
+
+      Capability capability = new ModuleCapability(metadata.getBundleSymbolicName(), metadata.getBundleVersion());
+      classLoadingMetaData.getCapabilities().addCapability(capability);
+
+      ArrayList<String> exportedNames = new ArrayList<String>();
+      
+      List<PackageAttribute> exported = metadata.getExportPackages();
+      if (exported != null)
+      {
+         for (PackageAttribute packageAttribute : exported)
+         {
+            String packageName = packageAttribute.getPackageInfo().getName();
+            capability = new PackageCapability(packageName);
+            classLoadingMetaData.getCapabilities().addCapability(capability);
+            exportedNames.add(packageName);
+         }
+      }
+
+      List<PackageAttribute> imported = metadata.getImportPackages();
+      if (imported != null)
+      {
+         SystemPackagesPlugin syspackPlugin = bundleManager.getPlugin(SystemPackagesPlugin.class);
+         for (PackageAttribute packageAttribute : imported)
+         {
+            String packageName = packageAttribute.getPackageInfo().getName();
+            
+            // [TODO] Import package requirements should probably resolve against export capabilities
+            boolean isExportPackage = exportedNames.contains(packageName);
+            
+            // [TODO] Should system packages be added as capabilities?
+            boolean isSystemPackage = syspackPlugin.isSystemPackage(packageName);
+            
+            // [TODO] add exported package requirements
+            if (isSystemPackage == false && isExportPackage == false)
+            {
+               // [TODO] add version ranges
+               PackageRequirement requirement = new PackageRequirement(packageName);
+
+               Parameter resolution = packageAttribute.getParameter(Constants.RESOLUTION_DIRECTIVE);
+               if (resolution != null && Constants.RESOLUTION_OPTIONAL.equals(resolution.getValue()))
+                  requirement.setOptional(true);
+               
+               // [TODO] add optional package requirements
+               if (requirement.isOptional() == false)
+                  classLoadingMetaData.getRequirements().addRequirement(requirement);
+            }
+         }
+      }
+
+      unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData);
+   }
+}

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/bootstrap/bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/bootstrap/bootstrap.xml	2009-08-25 09:35:37 UTC (rev 92783)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/bootstrap/bootstrap.xml	2009-08-25 09:42:20 UTC (rev 92784)
@@ -87,7 +87,7 @@
   <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleStateDeployer">
     <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
   </bean>
-  <bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleClassLoadingDeployer" >
+  <bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.plugins.facade.classloading.OSGiBundleClassLoadingDeployer" >
     <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
   </bean>
   <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />




More information about the jboss-cvs-commits mailing list