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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 8 08:12:24 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-10-08 08:12:23 -0400 (Thu, 08 Oct 2009)
New Revision: 94516

Modified:
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
   projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderFactory.java
Log:
Handle Bundle-ClassPath

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml	2009-10-08 12:10:43 UTC (rev 94515)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/pom.xml	2009-10-08 12:12:23 UTC (rev 94516)
@@ -55,7 +55,7 @@
     <version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
     <version.jboss.osgi.jmx>1.0.1</version.jboss.osgi.jmx>
     <version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
-    <version.jboss.osgi.runtime.deployers>1.0.1</version.jboss.osgi.runtime.deployers>
+    <version.jboss.osgi.runtime.deployers>1.0.2-SNAPSHOT</version.jboss.osgi.runtime.deployers>
     <version.jboss.osgi.spi>1.0.2-SNAPSHOT</version.jboss.osgi.spi>
     <version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
     <version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>

Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderFactory.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderFactory.java	2009-10-08 12:10:43 UTC (rev 94515)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderFactory.java	2009-10-08 12:12:23 UTC (rev 94516)
@@ -23,8 +23,6 @@
 
 // $Id$
 
-import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.jboss.classloader.spi.ClassLoaderPolicy;
@@ -82,43 +80,11 @@
 
          private VirtualFile[] getClassLoaderPolicyRoots(OSGiBundleState bundleState, VFSDeploymentUnit vfsUnit)
          {
-            VirtualFile root = vfsUnit.getRoot();
-            
-            // If there is no Bundle-ClassPath in the manifest, simply use the root
-            List<String> bundleClassPath = bundleState.getOSGiMetaData().getBundleClassPath();
-            if (bundleClassPath == null)
-            {
-               return new VirtualFile[] { root };
-            }
-            
-            log.debug("Bundle-ClassPath: " + bundleClassPath);
-            
-            // Add a vfs root for every Bundle-ClassPath element
-            List<VirtualFile> rootsList = new ArrayList<VirtualFile>();
-            for (String path : bundleClassPath)
-            {
-               if (path.equals("."))
-               {
-                  rootsList.add(root);
-               }
-               else
-               {
-                  try
-                  {
-                     VirtualFile child = root.getChild(path);
-                     rootsList.add(child);
-                  }
-                  catch (IOException ex)
-                  {
-                     throw new IllegalArgumentException("Cannot find class path '" + path + "' in: " + root);
-                  }
-               }
-            }
-            
-            VirtualFile[] rootsArray = new VirtualFile[rootsList.size()];
-            rootsList.toArray(rootsArray);
-            
-            return rootsArray;
+            // The classpath is initialised by the bundle structure deployer
+            List<VirtualFile> classPaths = vfsUnit.getClassPath();
+            VirtualFile[] policyRoots = new VirtualFile[classPaths.size()];
+            classPaths.toArray(policyRoots);
+            return policyRoots;
          }
       });
       return vfsModule.registerClassLoaderPolicy(system);




More information about the jboss-cvs-commits mailing list