[jboss-cvs] JBossAS SVN: r105723 - in trunk/server/src: main/java/org/jboss/web/deployers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 4 09:33:53 EDT 2010


Author: remy.maucherat at jboss.com
Date: 2010-06-04 09:33:52 -0400 (Fri, 04 Jun 2010)
New Revision: 105723

Modified:
   trunk/server/src/etc/deployers/scanning-deployers-jboss-beans.xml
   trunk/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java
   trunk/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java
Log:
- Drop ROOT.xml from the hardcoded list. Hardcoded deployment names lists are bad altogether IMO.
- Drop WARN logs (attachments are not present when using the hardcoded list, this is "normal").

Modified: trunk/server/src/etc/deployers/scanning-deployers-jboss-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/scanning-deployers-jboss-beans.xml	2010-06-04 13:17:20 UTC (rev 105722)
+++ trunk/server/src/etc/deployers/scanning-deployers-jboss-beans.xml	2010-06-04 13:33:52 UTC (rev 105723)
@@ -107,10 +107,6 @@
                   <value><null/></value>
                 </entry>
                 <entry>
-                  <key>ROOT.war</key>
-                  <value><null/></value>
-                </entry>
-                <entry>
                   <key>http-invoker.sar</key>
                   <value><null/></value>
                 </entry>

Modified: trunk/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java
===================================================================
--- trunk/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java	2010-06-04 13:17:20 UTC (rev 105722)
+++ trunk/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java	2010-06-04 13:33:52 UTC (rev 105723)
@@ -180,7 +180,6 @@
       ResourcesIndex ri = unit.getAttachment(ResourcesIndex.class);
       if (ri == null)
       {
-         log.warn("Cannot process SCI HandlesTypes, missing ResourcesIndex as attachment: " + unit.getName());
          unit.addAttachment(SCI_HANDLESTYPES_ATTACHMENT_NAME, handlesTypes);
          return;
       }

Modified: trunk/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java
===================================================================
--- trunk/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java	2010-06-04 13:17:20 UTC (rev 105722)
+++ trunk/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java	2010-06-04 13:33:52 UTC (rev 105723)
@@ -128,8 +128,6 @@
       ResourcesIndex ri = unit.getAttachment(ResourcesIndex.class);
       if (ri == null)
       {
-         log.warn("Using legacy annotation scanning, missing ResourcesIndex as attachment: " + unit.getName());
-         processMetaDataOld(unit, classpath);
          return;
       }
       AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
@@ -163,104 +161,4 @@
          unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME, Boolean.TRUE);
    }
 
-   /**
-    * Process metadata.
-    *
-    * @param unit the deployment unit
-    * @param classpath the classpath
-    * @throws Exception for any error
-    * @deprecated the new scanning should be used
-    */
-   protected void processMetaDataOld(VFSDeploymentUnit unit, List<VirtualFile> classpath) throws Exception
-   {
-      ScanningMetaData scanningMetaData = unit.getAttachment(ScanningMetaData.class);
-      Map<VirtualFile, Collection<Class<?>>> classesPerJar = new HashMap<VirtualFile, Collection<Class<?>>>();
-      int foundAnnotations = 0;
-      for (VirtualFile path : classpath)
-      {
-         if (doScan(scanningMetaData, path.getName()))
-         {
-            Collection<Class<?>> currentClasses = getClasses(unit, path);
-            classesPerJar.put(path, currentClasses);
-            foundAnnotations += currentClasses.size();
-         }
-      }
-      if (foundAnnotations > 0)
-      {
-         AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
-         processJBossWebMetaData(unit, finder, classesPerJar);
-      }
-   }
-
-   protected boolean doScan(ScanningMetaData smd, String name)
-   {
-      if (smd == null)
-         return true;
-
-      List<PathMetaData> paths = smd.getPaths();
-      if (paths == null)
-         return false;
-
-      for (PathMetaData pmd : paths)
-      {
-         if (pmd.getPathName().contains(name))
-            return true;
-      }
-      return false;
-   }
-
-   /**
-    * Get the classes we want to scan.
-    *
-    * @param unit the deployment unit
-    * @param classpath the classpath
-    * @return possible classes containing metadata annotations
-    * @throws IOException for any error
-    * @deprecated
-    */
-   protected Collection<Class<?>> getClasses(VFSDeploymentUnit unit, VirtualFile classpath) throws IOException
-   {
-      AnnotatedClassFilter classVisitor = new AnnotatedClassFilter(unit, unit.getClassLoader(), classpath, null);
-      classpath.visit(classVisitor);
-      Map<VirtualFile, Class<?>> classes = classVisitor.getAnnotatedClasses();
-      if (classes != null && classes.size() > 0)
-      {
-         if(log.isTraceEnabled())
-            log.trace("Annotated classes: " + classes);
-      }
-      else
-      {
-         classes = new HashMap<VirtualFile, Class<?>>();
-      }
-      return classes.values();
-   }
-
-   /**
-    * Process annotations.
-    *
-    * @param unit the deployment unit
-    * @param finder the annotation finder
-    * @param classes the candidate classes
-    * @deprecated
-    */
-   protected void processJBossWebMetaData(VFSDeploymentUnit unit,
-         AnnotationFinder<AnnotatedElement> finder, Map<VirtualFile, Collection<Class<?>>> classes)
-   {
-      Web30MetaDataCreator creator = new Web30MetaDataCreator(finder);
-      boolean metaData = false;
-      for (VirtualFile path : classes.keySet())
-      {
-         WebMetaData annotationMetaData = creator.create(classes.get(path));
-         log.debug("Add annotations: " + WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName());
-         if (annotationMetaData != null)
-         {
-            unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName(), annotationMetaData, WebMetaData.class);
-            metaData = true;
-         }
-      }
-      if (metaData)
-         unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME, Boolean.TRUE);
-   }
-
 }
-



More information about the jboss-cvs-commits mailing list