[jboss-cvs] JBossAS SVN: r87307 - in projects/aop/trunk: aop/src/main/java/org/jboss/aop/instrument and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 14 15:48:45 EDT 2009


Author: kabir.khan at jboss.com
Date: 2009-04-14 15:48:45 -0400 (Tue, 14 Apr 2009)
New Revision: 87307

Added:
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalAspectFactory.java
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalFactoryAspect.java
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalAspectFactory.java
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalFactoryAspect.java
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/POJOWithAspectFactory.java
Modified:
   projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/AspectFactoryDelegator.java
   projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/GenericAspectFactory.java
   projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/JoinPointGenerator.java
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/FoundInvoker.java
   projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/NotFoundInvoker.java
   projects/aop/trunk/asintegration-mc/src/test/resources/org/jboss/test/aop/classpool/jbosscl/weaving/test/WeavingTestCase-aop.xml
Log:
[JBAOP-707] Test AspectFactories

Modified: projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/AspectFactoryDelegator.java
===================================================================
--- projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/AspectFactoryDelegator.java	2009-04-14 19:17:00 UTC (rev 87306)
+++ projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/AspectFactoryDelegator.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -60,13 +60,29 @@
       this.element = element;
    }
 
-   public synchronized AspectFactory getFactory()
+   private synchronized AspectFactory getFactory(Advisor advisor)
    {
       if (factory == null)
       {
+         ClassLoader cl = null;
          try
          {
+            if (advisor != null)
+            {
+               //Get the correct classloader based on the class of the advisor
+               Class<?> clazz = advisor.getClazz();
+               cl = SecurityActions.getClassLoader((clazz != null) ? clazz: advisor.getClass());
+            }
+            if (cl != null)
+            {
+               pushScopedClassLoader(cl);
+            }
             Class<?> clazz = super.loadClass(factoryClass);
+            
+            if (clazz == null)
+            {
+               return null;
+            }
             factory = (AspectFactory) clazz.newInstance();
             if (XmlLoadable.class.isAssignableFrom(factory.getClass()))
             {
@@ -92,38 +108,65 @@
          {
             throw new RuntimeException(e);
          }
+         finally
+         {
+            if (cl != null)
+            {
+               popScopedClassLoader();
+            }
+         }
       }
       return factory;
    }
 
    public Object createPerVM()
    {
-      Object aspect = getFactory().createPerVM();
-      return aspect;
+      AspectFactory factory = getFactory(null);
+      if (factory != null)
+      {
+         return factory.createPerVM();
+      }
+      return null;
    }
 
    public Object createPerClass(Advisor advisor)
    {
-      Object aspect = getFactory().createPerClass(advisor);
-      return aspect;
+      AspectFactory factory = getFactory(advisor);
+      if (factory != null)
+      {
+         return factory.createPerClass(advisor);
+      }
+      return null;
    }
 
    public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
    {
-      Object aspect = getFactory().createPerInstance(advisor, instanceAdvisor);
-      return aspect;
+      AspectFactory factory = getFactory(advisor);
+      if (factory != null)
+      {
+         return factory.createPerInstance(advisor, instanceAdvisor);
+      }
+      return null;
    }
 
    public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
    {
-      Object aspect = getFactory().createPerJoinpoint(advisor, jp);
-      return aspect;
+      AspectFactory factory = getFactory(advisor);
+      if (factory != null)
+      {
+         return factory.createPerJoinpoint(advisor, jp);
+      }
+      return null;
    }
 
    public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
    {
-      Object aspect = getFactory().createPerJoinpoint(advisor, instanceAdvisor, jp);
-      return aspect;
+      AspectFactory factory = getFactory(advisor);
+      if (factory != null)
+      {
+         return factory.createPerJoinpoint(advisor, instanceAdvisor, jp);
+      }
+      return null;
    }
 
 }

Modified: projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/GenericAspectFactory.java
===================================================================
--- projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/GenericAspectFactory.java	2009-04-14 19:17:00 UTC (rev 87306)
+++ projects/aop/trunk/aop/src/main/java/org/jboss/aop/advice/GenericAspectFactory.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -114,9 +114,9 @@
    
    private Class<?> getClazz(Advisor advisor)
    {
+      ClassLoader cl = null;
       try
       {
-         ClassLoader cl = null;
          if (advisor != null)
          {
             //Get the correct classloader based on the class of the advisor
@@ -135,7 +135,10 @@
       }
       finally
       {
-         popScopedClassLoader();
+         if (cl != null)
+         {
+            popScopedClassLoader();
+         }
       }
    }
 

Modified: projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/JoinPointGenerator.java
===================================================================
--- projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/JoinPointGenerator.java	2009-04-14 19:17:00 UTC (rev 87306)
+++ projects/aop/trunk/aop/src/main/java/org/jboss/aop/instrument/JoinPointGenerator.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -1400,6 +1400,10 @@
             {
                aspectClass = aspectInstance.getClass();
             }
+            else
+            {
+               
+            }
          }
          else
          {

Added: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalAspectFactory.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalAspectFactory.java	                        (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalAspectFactory.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactoryWithClassLoaderSupport;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ExternalAspectFactory extends AspectFactoryWithClassLoaderSupport
+{
+
+   public Object createPerClass(Advisor advisor)
+   {
+      return new ExternalFactoryAspect("efac");
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      return new ExternalFactoryAspect("efai");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      return new ExternalFactoryAspect("efaj");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      return new ExternalFactoryAspect("efacj");
+   }
+
+   public Object createPerVM()
+   {
+      return new ExternalFactoryAspect("efav");
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+}

Added: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalFactoryAspect.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalFactoryAspect.java	                        (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/aspects/ExternalFactoryAspect.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.interceptions.Interceptions;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ExternalFactoryAspect
+{
+   private String str;
+   
+   public ExternalFactoryAspect(String s)
+   {
+      str = s;
+   }
+   
+   public Object advice(Invocation invocation) throws Throwable
+   {
+      try
+      {
+         Interceptions.append("(" + str + ")");
+         return invocation.invokeNext();
+      }
+      finally
+      {
+         Interceptions.append("{" + str + "}");
+      }
+   }
+
+}

Modified: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/FoundInvoker.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/FoundInvoker.java	2009-04-14 19:17:00 UTC (rev 87306)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/FoundInvoker.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -51,6 +51,7 @@
       testAnnotationOverride();
       testInterceptor();
       testAspect();
+      testAspectFactory();
       if (testLightweight)
       {
          testLightweightAspect();
@@ -121,6 +122,17 @@
       Interceptions.assertEquals("(eav)(eaj)(eai)(eacj)(eac)(iav)(iaj)(iai)(iacj)(iac)XXX{iac}{iacj}{iai}{iaj}{iav}{eac}{eacj}{eai}{eaj}{eav}");
    }
    
+   private static void testAspectFactory()
+   {
+      Interceptions.clear();
+      POJOWithAspectFactory pojo = new POJOWithAspectFactory();
+      Assert.assertTrue(pojo instanceof Advised);
+      
+      String rtn = pojo.method("XXX");
+      Assert.assertEquals("XXX", rtn);
+      Interceptions.assertEquals("(efav)(efacj)(efai)(efaj)(efac)(ifav)(ifacj)(ifai)(ifaj)(ifac)XXX{ifac}{ifaj}{ifai}{ifacj}{ifav}{efac}{efaj}{efai}{efacj}{efav}");
+   }
+   
    private static void testLightweightAspect()
    {
       Interceptions.clear();

Added: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalAspectFactory.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalAspectFactory.java	                        (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalAspectFactory.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactoryWithClassLoaderSupport;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InternalAspectFactory extends AspectFactoryWithClassLoaderSupport
+{
+
+   public Object createPerClass(Advisor advisor)
+   {
+      return new InternalFactoryAspect("ifac");
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      return new InternalFactoryAspect("ifai");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      return new InternalFactoryAspect("ifaj");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      return new InternalFactoryAspect("ifacj");
+   }
+
+   public Object createPerVM()
+   {
+      return new InternalFactoryAspect("ifav");
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+}

Added: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalFactoryAspect.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalFactoryAspect.java	                        (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/InternalFactoryAspect.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.interceptions.Interceptions;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InternalFactoryAspect
+{
+   private String str;
+   
+   public InternalFactoryAspect(String s)
+   {
+      str = s;
+   }
+   
+   public Object advice(Invocation invocation) throws Throwable
+   {
+      try
+      {
+         Interceptions.append("(" + str + ")");
+         return invocation.invokeNext();
+      }
+      finally
+      {
+         Interceptions.append("{" + str + "}");
+      }
+   }
+
+}

Modified: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/NotFoundInvoker.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/NotFoundInvoker.java	2009-04-14 19:17:00 UTC (rev 87306)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/NotFoundInvoker.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -47,6 +47,7 @@
       testAnnotationOverride();
       testInterceptor();
       testAspect();
+      testAspectFactory();
       if (testLightweight)
       {
          testLightweightAspect();
@@ -150,7 +151,21 @@
       Interceptions.assertEquals("(iav)(iaj)(iai)(iacj)(iac)XXX{iac}{iacj}{iai}{iaj}{iav}");
       System.out.println("---> testAspect passed");
    }
+
+   private static void testAspectFactory()
+   {
+      Interceptions.clear();
+      System.out.println("---> testAspectFactory");
+      POJOWithAspectFactory pojo = new POJOWithAspectFactory();
+      Assert.assertTrue(pojo instanceof Advised);
+      
+      String rtn = pojo.method("XXX");
+      Assert.assertEquals("XXX", rtn);
+      Interceptions.assertEquals("(ifav)(ifacj)(ifai)(ifaj)(ifac)XXX{ifac}{ifaj}{ifai}{ifacj}{ifav}");
+      System.out.println("---> testAspectFactory passed");
+   }
    
+
    private static void testLightweightAspect()
    {
       Interceptions.clear();

Added: projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/POJOWithAspectFactory.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/POJOWithAspectFactory.java	                        (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/test/java/org/jboss/test/aop/classpool/jbosscl/weaving/support/excluded/target/POJOWithAspectFactory.java	2009-04-14 19:48:45 UTC (rev 87307)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target;
+
+import org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.interceptions.Interceptions;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJOWithAspectFactory
+{
+   public String method(String arg)
+   {
+      Interceptions.append(arg);
+      return arg;
+   }
+}

Modified: projects/aop/trunk/asintegration-mc/src/test/resources/org/jboss/test/aop/classpool/jbosscl/weaving/test/WeavingTestCase-aop.xml
===================================================================
--- projects/aop/trunk/asintegration-mc/src/test/resources/org/jboss/test/aop/classpool/jbosscl/weaving/test/WeavingTestCase-aop.xml	2009-04-14 19:17:00 UTC (rev 87306)
+++ projects/aop/trunk/asintegration-mc/src/test/resources/org/jboss/test/aop/classpool/jbosscl/weaving/test/WeavingTestCase-aop.xml	2009-04-14 19:48:45 UTC (rev 87307)
@@ -35,7 +35,19 @@
    <aspect class="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalLightweightAspectPerInstance" scope="PER_INSTANCE"/>
    <aspect class="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalLightweightAspectPerClassJoinpoint" scope="PER_CLASS_JOINPOINT"/>
    <aspect class="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalLightweightAspectPerClass" scope="PER_CLASS"/>
+   
+   <aspect name="externalFactoryPerVm" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalAspectFactory" scope="PER_VM"/>
+   <aspect name="externalFactoryPerJoinpoint" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalAspectFactory" scope="PER_JOINPOINT"/>
+   <aspect name="externalFactoryPerInstance" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalAspectFactory" scope="PER_INSTANCE"/>
+   <aspect name="externalFactoryPerClassJoinpoint" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalAspectFactory" scope="PER_CLASS_JOINPOINT"/>
+   <aspect name="externalFactoryPerClass" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalAspectFactory" scope="PER_CLASS"/>
 
+   <aspect name="internalFactoryPerVm" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalAspectFactory" scope="PER_VM"/>
+   <aspect name="internalFactoryPerJoinpoint" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalAspectFactory" scope="PER_JOINPOINT"/>
+   <aspect name="internalFactoryPerInstance" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalAspectFactory" scope="PER_INSTANCE"/>
+   <aspect name="internalFactoryPerClassJoinpoint" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalAspectFactory" scope="PER_CLASS_JOINPOINT"/>
+   <aspect name="internalFactoryPerClass" factory="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalAspectFactory" scope="PER_CLASS"/>
+
    
    <!--  TODO all scopes -->
 
@@ -89,6 +101,20 @@
       <advice name="invoke" aspect="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.InternalAspectPerClass"/>
    </bind>
    
+   <bind pointcut="execution(* org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.POJOWithAspectFactory->method(java.lang.String))">
+      <advice name="advice" aspect="externalFactoryPerVm"/>
+      <advice name="advice" aspect="externalFactoryPerJoinpoint"/>
+      <advice name="advice" aspect="externalFactoryPerInstance"/>
+      <advice name="advice" aspect="externalFactoryPerClassJoinpoint"/>
+      <advice name="advice" aspect="externalFactoryPerClass"/>
+      <advice name="advice" aspect="internalFactoryPerVm"/>
+      <advice name="advice" aspect="internalFactoryPerJoinpoint"/>
+      <advice name="advice" aspect="internalFactoryPerInstance"/>
+      <advice name="advice" aspect="internalFactoryPerClassJoinpoint"/>
+      <advice name="advice" aspect="internalFactoryPerClass"/>
+   </bind>
+   
+   
    <bind pointcut="execution(* org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.target.POJOWithLightweightAspect->method(java.lang.String))">
       <before name="before" aspect="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalLightweightAspectPerVm"/>
       <after name="after" aspect="org.jboss.test.aop.classpool.jbosscl.weaving.support.excluded.aspects.ExternalLightweightAspectPerVm"/>




More information about the jboss-cvs-commits mailing list