[jboss-cvs] JBossAS SVN: r87440 - projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 16 11:47:56 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-04-16 11:47:56 -0400 (Thu, 16 Apr 2009)
New Revision: 87440

Modified:
   projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
Log:
[JBOSGI-37] Simplify 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:46:32 UTC (rev 87439)
+++ projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java	2009-04-16 15:47:56 UTC (rev 87440)
@@ -52,9 +52,8 @@
       setRelativeOrder(9000);
    }
 
-   /**
-    * Determine the structure of a bundle deployment
-    * 
+   /*
+    * * Determine the structure of a bundle deployment
     * @param context the structure context
     * @return true when it recognised the context
     * @throws DeploymentException for an error
@@ -67,89 +66,22 @@
 
       try
       {
-         boolean trace = log.isTraceEnabled();
-
-         // This file is not for me, because I'm only interested 
-         // in root deployments that contan a MANIFEST.MF
+         // This file is not for me, because I'm only interested
+         // in root deployments that contain 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
-            // we require a META-INF otherwise each subdirectory would be a subdeployment
-            if (JarUtils.isArchive(file.getName()) == false)
-            {
-               if (structureContext.isTopLevel() == false)
-               {
-                  try
-                  {
-                     VirtualFile child = file.getChild("META-INF");
-                     if (child != null)
-                     {
-                        if (trace)
-                           log.trace("... ok - non top level directory has a META-INF subdirectory");
-                     }
-                     else
-                     {
-                        if (trace)
-                           log.trace("... no - doesn't look like a jar and no META-INF subdirectory.");
-                        
-                        return false;
-                     }
-                  }
-                  catch (IOException e)
-                  {
-                     log.warn("Exception while checking if file is a jar: " + e);
-                     return false;
-                  }
-               }
-               else if (trace)
-               {
-                  log.trace("... ok - doesn't look like a jar but it is a top level directory.");
-               }
-            }
-         }
-         else if (JarUtils.isArchive(file.getName()))
-         {
-            if (trace)
-               log.trace("... ok - its an archive or at least pretending to be.");
-         }
-         else
-         {
-            if (trace)
-               log.trace("... no - not a directory or an archive.");
-            return false;
-         }
 
-         boolean valid = true;
+         // Create a context for this jar file with META-INF as the location for metadata
+         context = createContext(structureContext, "META-INF");
 
-         if (isSupportsCandidateAnnotations())
-         {
-            StructureContext parentContext = structureContext.getParentContext();
-            if (parentContext != null && parentContext.isCandidateAnnotationScanning())
-               valid = checkCandidateAnnotations(structureContext, file);
-         }
-
-         if (valid)
-         {
-            // Create a context for this jar file with META-INF as the location for metadata
-            context = createContext(structureContext, "META-INF");
-
-            // The classpath is the root
-            addClassPath(structureContext, file, true, true, context);
-            
-            // Note, we do not try children as potential subdeployments
-         }
-         return valid;
+         return true;
       }
       catch (Exception e)
       {




More information about the jboss-cvs-commits mailing list