[jboss-cvs] JBossAS SVN: r82279 - in projects/microcontainer/trunk/aop-mc-int/src: test/java/org/jboss/test/microcontainer/beans and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 15 09:34:51 EST 2008


Author: kabir.khan at jboss.com
Date: 2008-12-15 09:34:50 -0500 (Mon, 15 Dec 2008)
New Revision: 82279

Added:
   projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java
   projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
   projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml
Modified:
   projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Aspect.java
   projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DelegatingBeanAspectFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
Log:
[JBMICROCONT-402] Enable injection of beans into AspectFactories

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Aspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Aspect.java	2008-12-15 13:46:09 UTC (rev 82278)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Aspect.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -258,7 +258,7 @@
       if (adviceBean != null && advice != null)
       {
          definition.setDeployed(true);
-         GenericBeanAspectFactory factory = (GenericBeanAspectFactory)definition.getFactory();
+         BeanFactoryAwareAspectFactory factory = (BeanFactoryAwareAspectFactory)definition.getFactory();
          factory.setBeanFactory(advice);
       }
       

Added: projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,34 @@
+/*
+* 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.aop.microcontainer.beans;
+
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface BeanFactoryAwareAspectFactory
+{
+   void setBeanFactory(BeanFactory factory);
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DelegatingBeanAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DelegatingBeanAspectFactory.java	2008-12-15 13:46:09 UTC (rev 82278)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DelegatingBeanAspectFactory.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -42,7 +42,7 @@
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public class DelegatingBeanAspectFactory implements AspectFactory, KernelControllerContextAware
+public class DelegatingBeanAspectFactory implements AspectFactory, KernelControllerContextAware, BeanFactoryAwareAspectFactory
 {
    private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class); 
 
@@ -72,7 +72,7 @@
       this.context = null;
    }
    
-   public void setBeanFactory(GenericBeanFactory factory)
+   public void setBeanFactory(BeanFactory factory)
    {
       this.factory = factory;
    }

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java	2008-12-15 13:46:09 UTC (rev 82278)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -43,7 +43,7 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class GenericBeanAspectFactory extends GenericAspectFactory implements KernelControllerContextAware
+public class GenericBeanAspectFactory extends GenericAspectFactory implements KernelControllerContextAware, BeanFactoryAwareAspectFactory
 {
    private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class); 
 

Added: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,78 @@
+/*
+* 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.microcontainer.beans;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactoryWithDependency implements AspectFactory
+{
+   private POJO pojo;
+   
+   public Object createPerClass(Advisor advisor)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerVM()
+   {
+      return new DependencyFactoryAspect(pojo);
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public POJO getPojo()
+   {
+      return pojo;
+   }
+
+   public void setPojo(POJO pojo)
+   {
+      this.pojo = pojo;
+   }
+
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,46 @@
+/*
+* 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.microcontainer.beans;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DependencyFactoryAspect
+{
+   public POJO pojo;
+   public static POJO invoked;
+   
+   public DependencyFactoryAspect(POJO pojo)
+   {
+      this.pojo = pojo;
+   }
+   
+   public Object advice(MethodInvocation inv) throws Throwable
+   {
+      invoked = this.pojo;
+      return inv.invokeNext();
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,43 @@
+/*
+* 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.microcontainer.beans.test;
+
+import junit.framework.Test;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactoryWithDependencyAopTestCase extends AspectFactoryWithDependencyTest
+{
+   public static Test suite()
+   {
+      return suite(AspectFactoryWithDependencyAopTestCase.class);
+   }
+   
+   public AspectFactoryWithDependencyAopTestCase(String test)
+   {
+      super(test);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.microcontainer.beans.test;
+
+import junit.framework.Test;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactoryWithDependencyBeansTestCase extends AspectFactoryWithDependencyTest
+{
+   public static Test suite()
+   {
+      return suite(AspectFactoryWithDependencyBeansTestCase.class);
+   }
+   
+   public AspectFactoryWithDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,43 @@
+/*
+* 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.microcontainer.beans.test;
+
+import junit.framework.Test;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactoryWithDependencyDeploymentTestCase extends AspectFactoryWithDependencyTest
+{
+   public static Test suite()
+   {
+      return suite(AspectFactoryWithDependencyDeploymentTestCase.class);
+   }
+   
+   public AspectFactoryWithDependencyDeploymentTestCase(String test)
+   {
+      super(test);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,52 @@
+/*
+* 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.microcontainer.beans.test;
+
+import org.jboss.test.aop.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans.DependencyFactoryAspect;
+import org.jboss.test.microcontainer.beans.POJO;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactoryWithDependencyTest extends AOPMicrocontainerTest
+{
+
+   public AspectFactoryWithDependencyTest(String name)
+   {
+      super(name);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      DependencyFactoryAspect.invoked = null;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      POJO dep = (POJO)getBean("Dependency");
+      assertSame(dep, DependencyFactoryAspect.invoked);
+   }
+   
+
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+   <aspect factory="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
+      <property name="pojo"><inject bean="Dependency"/></property>
+   </aspect>
+
+   <bind pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
+      <advice aspect="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" name="advice"/>
+   </bind>
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</aop>

Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" class="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
+      <property name="pojo"><inject bean="Dependency"/></property>
+      <install bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" method="install">
+         <parameter><this/></parameter>
+      </install>
+      <uninstall bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" method="uninstall"/>
+   </beanfactory>
+
+   <bean name="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" class="org.jboss.aop.microcontainer.beans.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="name">org.jboss.test.microcontainer.beans.TestAspectWithDependency</property>
+      <property name="factory">true</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+         	<inject bean="TestAspectBinding$1"/>
+         </list>
+   	</property>
+   </bean>
+   <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans.InterceptorEntry">
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency"/></property>
+      <property name="aspectMethod">advice</property>
+      <property name="binding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+   </bean>
+
+
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml	2008-12-15 14:34:50 UTC (rev 82279)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+   <aspect xmlns="urn:jboss:aop-beans:1.0" factory="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
+      <property name="pojo"><inject bean="Dependency"/></property>
+   </aspect>
+
+   <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
+      <advice aspect="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" name="advice"/>
+   </bind>
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+   
+</deployment>




More information about the jboss-cvs-commits mailing list