[jboss-cvs] JBossAS SVN: r78365 - branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 10 13:32:44 EDT 2008


Author: kabir.khan at jboss.com
Date: 2008-09-10 13:32:43 -0400 (Wed, 10 Sep 2008)
New Revision: 78365

Modified:
   branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java
Log:
[JBAOP-637] AspectAnnotationLoader should deploy named pointcuts etc. before bindings

Modified: branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java	2008-09-10 17:22:32 UTC (rev 78364)
+++ branches/Branch_AOP_1_5/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java	2008-09-10 17:32:43 UTC (rev 78365)
@@ -103,6 +103,31 @@
       return cl;
    }
 
+//   public void deployClassFile(ClassFile cf) throws Exception
+//   {
+//      if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("Looking for aspects in: " + cf.getName());
+//      AnnotationsAttribute visible = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.visibleTag);
+//      if (visible != null)
+//      {
+//         boolean deployed = deployAspect(visible, cf);
+//
+//         if (!deployed)
+//         {
+//            deployed = deployInterceptor(visible, cf);
+//         }
+//
+//         if (!deployed)
+//         {
+//            deployDynamicCFlow(visible, cf);
+//
+//            if (!deployPreparedClass(visible, cf))
+//            {
+//               deployPrecedence(visible, cf);
+//            }
+//         }
+//      }
+//   }
+
    public void deployInputStreamIterator(Iterator it) throws Exception
    {
       while (it.hasNext())
@@ -142,17 +167,6 @@
                   deployPrecedence(visible, cf);
                }
             }
-            else
-            {
-               deployPointcuts(cf);
-               deployMixins(cf);
-               deployIntroductions(cf);
-               deployTypedefs(cf);
-               deployCFlowStackDefs(cf);
-               deployPrepares(cf);
-               deployAnnotationIntroductions(cf);
-               deployDeclares(cf);
-            }
          }
       }
    }
@@ -226,6 +240,9 @@
          }
          AspectDefinition def = new AspectDefinition(cf.getName(), scope, factory);
          manager.addAspectDefinition(def);
+         
+         deployAspectOrInterceptorFields(cf);
+         
          if (!isFactory)
          {
             deployAspectMethodBindings(cf, def);
@@ -291,6 +308,8 @@
          ScopedInterceptorFactory factory = new ScopedInterceptorFactory(def);
          manager.addInterceptorFactory(factory.getName(), factory);
 
+         deployAspectOrInterceptorFields(cf);
+         
          deployInterceptorBindings(visible, cf, factory);
 
          return def;
@@ -1089,4 +1108,16 @@
       buf.append(expr.substring(lastindex));
       return buf.toString();
    }
+   
+   private void deployAspectOrInterceptorFields(ClassFile cf) throws Exception
+   {
+      deployPointcuts(cf);
+      deployMixins(cf);
+      deployIntroductions(cf);
+      deployTypedefs(cf);
+      deployCFlowStackDefs(cf);
+      deployPrepares(cf);
+      deployAnnotationIntroductions(cf);
+      deployDeclares(cf);
+   }
 }




More information about the jboss-cvs-commits mailing list