[jboss-osgi-commits] JBoss-OSGI SVN: r87438 - in projects/jboss-osgi/trunk: testsuite/functional and 1 other directory.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Thu Apr 16 11:38:42 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-04-16 11:38:41 -0400 (Thu, 16 Apr 2009)
New Revision: 87438

Modified:
   projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
   projects/jboss-osgi/trunk/testsuite/functional/pom.xml
Log:
[JBOSGI-37] Done - BundleStructureDeployer

Modified: projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java	2009-04-16 15:35:41 UTC (rev 87437)
+++ projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java	2009-04-16 15:38:41 UTC (rev 87438)
@@ -24,13 +24,17 @@
 // $Id$
 
 import java.io.IOException;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
 
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.structure.ContextInfo;
 import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
 import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.virtual.VFSUtils;
 import org.jboss.virtual.VirtualFile;
 import org.jboss.virtual.plugins.context.jar.JarUtils;
+import org.osgi.framework.Constants;
 
 /**
  * Determine the structure of a Bundle deployment.
@@ -65,15 +69,19 @@
       {
          boolean trace = log.isTraceEnabled();
 
-         // Ignore child archives
-         if (file != root && JarUtils.isArchive(file.getName()) == true)
-         {
-            if (trace)
-               log.trace("... no - ignoring child archive");
-            
+         // This file is not for me, because I'm only interested 
+         // in root deployments that contan a MANIFEST.MF
+         Manifest manifest = VFSUtils.getManifest(file);
+         if (file != root || manifest == null)
             return false;
-         }
-
+         
+         // This file is also not for me, because I need to see Bundle-SymbolicName
+         Attributes attribs = manifest.getMainAttributes();
+         String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+         if (symbolicName == null)
+            return false;
+         
+         // This code is taken from the JARStructure
          if (isLeaf(file) == false)
          {
             // For non top level directories that don't look like jars
@@ -138,9 +146,8 @@
 
             // The classpath is the root
             addClassPath(structureContext, file, true, true, context);
-
-            // We try all the children as potential subdeployments
-            addAllChildren(structureContext);
+            
+            // Note, we do not try children as potential subdeployments
          }
          return valid;
       }

Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-04-16 15:35:41 UTC (rev 87437)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-04-16 15:38:41 UTC (rev 87438)
@@ -328,7 +328,6 @@
             <configuration>
               <!-- argLine>${surefire.security.args}</argLine -->
               <excludes>
-                <exclude>org/jboss/test/osgi/jbosgi37/*RemoteTestCase.java</exclude>
                 <!-- https://issues.apache.org/jira/browse/FELIX-1040 -->
                 <exclude>org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java</exclude>
               </excludes>




More information about the jboss-osgi-commits mailing list