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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 29 11:08:16 EDT 2010


Author: kabir.khan at jboss.com
Date: 2010-06-29 11:08:16 -0400 (Tue, 29 Jun 2010)
New Revision: 106309

Added:
   projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.java
   projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.java
   projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.java
   projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackTest.java
   projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.xml
   projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.xml
   projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.xml
Modified:
   projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BindingEntry.java
   projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/InterceptorEntry.java
   projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Stack.java
   projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/StackEntry.java
Log:
[JBKERNEL-125] Handle nested stacks

Modified: projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BindingEntry.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BindingEntry.java	2010-06-29 14:09:30 UTC (rev 106308)
+++ projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BindingEntry.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -36,6 +36,7 @@
    String name = new GUID().toString();
    AspectManager manager;
    Binding binding;
+   boolean forStack;
 
    public abstract InterceptorFactory[] getInterceptorFactories();
    
@@ -62,11 +63,26 @@
    {
       this.manager = manager;
    }
-
+   
+   public void setForStack(boolean forStack)
+   {
+      this.forStack = forStack;
+   }
+   
    public String getName()
    {
       return name;
    }
-   
 
+   void validateManagerAndBinding()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("Null manager");
+      }
+      if (binding == null && !forStack)
+      {
+         throw new IllegalArgumentException("Null aspect binding");
+      }
+   }
 }

Modified: projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/InterceptorEntry.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/InterceptorEntry.java	2010-06-29 14:09:30 UTC (rev 106308)
+++ projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/InterceptorEntry.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -37,7 +37,6 @@
    Aspect aspect;
    String aspectMethod;
    InterceptorFactory interceptorFactory;
-   boolean forStack;
    AdviceType type = AdviceType.AROUND;
    
    public AdviceType getType()
@@ -60,11 +59,6 @@
       this.aspect = aspect;
    }
    
-   public void setForStack(boolean forStack)
-   {
-      this.forStack = forStack;
-   }
-   
    public String getAspectMethod()
    {
       return aspectMethod;
@@ -87,14 +81,7 @@
    
    public void start()
    {
-      if (manager == null)
-      {
-         throw new IllegalArgumentException("Null manager");
-      }
-      if (binding == null && !forStack)
-      {
-         throw new IllegalArgumentException("Null aspect binding");
-      }
+      validateManagerAndBinding();
       if (aspect == null)
       {
          throw new IllegalArgumentException("Null aspect");

Modified: projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Stack.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Stack.java	2010-06-29 14:09:30 UTC (rev 106308)
+++ projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Stack.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -22,6 +22,8 @@
 package org.jboss.aop.microcontainer.beans;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import org.jboss.aop.AspectManager;
@@ -40,7 +42,7 @@
    
    private String name;
    
-   private List<InterceptorEntry> advices;
+   private List<BindingEntry> advices;
 
    public AspectManager getManager()
    {
@@ -62,12 +64,12 @@
       this.name = name;
    }
 
-   public List<InterceptorEntry> getAdvices()
+   public List<BindingEntry> getAdvices()
    {
       return advices;
    }
 
-   public void setAdvices(List<InterceptorEntry> advices)
+   public void setAdvices(List<BindingEntry> advices)
    {
       this.advices = advices;
    }
@@ -76,16 +78,33 @@
    {
       List<InterceptorEntry> entries = new ArrayList<InterceptorEntry>();
  
-      for (InterceptorEntry entry : advices)
+      for (BindingEntry entry : advices)
       {
-         InterceptorEntry cloned = (InterceptorEntry)entry.clone();
-         cloned.setBinding(binding);
-         entries.add(cloned);
+         if (entry instanceof InterceptorEntry)
+         {
+            cloneAndAddEntry(entries, (InterceptorEntry)entry, binding);
+         }
+         else if (entry instanceof StackEntry)
+         {
+            List<InterceptorEntry> stackEntries = ((StackEntry)entry).getAdvices();
+            for (InterceptorEntry cur : stackEntries)
+            {
+               cloneAndAddEntry(entries, cur, binding);
+            }
+         }
+         else
+            throw new IllegalStateException("Invalid BindingEntry type " + entry); 
       }
       
       return entries;
    }
    
+   private void cloneAndAddEntry(List<InterceptorEntry> entries, InterceptorEntry entry, Binding binding)
+   {
+      InterceptorEntry cloned = (InterceptorEntry)((InterceptorEntry)entry).clone();
+      cloned.setBinding(binding);
+      entries.add(cloned);
+   }
    public void start()
    {
       if (manager == null)
@@ -102,9 +121,14 @@
       }
       
       ArrayList<InterceptorFactory> factories = new ArrayList<InterceptorFactory>();
-      for (InterceptorEntry advice : advices)
+      for (BindingEntry advice : advices)
       {
-         factories.add(advice.getInterceptorFactory());
+         if (advice instanceof InterceptorEntry)
+            factories.add(((InterceptorEntry)advice).getInterceptorFactory());
+         else if (advice instanceof StackEntry)
+            factories.addAll(Arrays.asList(((StackEntry)advice).getInterceptorFactories()));
+         else
+            throw new IllegalStateException("Invalid BindingEntry type " + advice); 
       }
       AdviceStack stack = new AdviceStack(name, factories);
       manager.addAdviceStack(stack);

Modified: projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/StackEntry.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/StackEntry.java	2010-06-29 14:09:30 UTC (rev 106308)
+++ projects/kernel/trunk/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/StackEntry.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -46,6 +46,11 @@
    {
       this.stack = stack;
    }
+   
+   public List<InterceptorEntry> getAdvices()
+   {
+      return advices;
+   }
 
    public InterceptorFactory[] getInterceptorFactories()
    {
@@ -54,14 +59,7 @@
 
    public void start()
    {
-      if (manager == null)
-      {
-         throw new IllegalArgumentException("Null manager");
-      }
-      if (binding == null)
-      {
-         throw new IllegalArgumentException("Null aspect binding");
-      }
+      validateManagerAndBinding();
       if (stack == null)
       {
          throw new IllegalArgumentException("Null stack");
@@ -79,7 +77,7 @@
       {
          entry.start();
          factories[i++] = entry.getInterceptorFactory(); 
-      }
+      }      
    }
 
    public void stop()

Added: projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.java	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,43 @@
+/*
+* 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 NestedStackAopTestCase extends NestedStackTest
+{
+   public static Test suite()
+   {
+      return suite(NestedStackAopTestCase.class);
+   }
+   
+   public NestedStackAopTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.java	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,43 @@
+/*
+* 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 NestedStackBeansTestCase extends NestedStackTest
+{
+   public static Test suite()
+   {
+      return suite(NestedStackBeansTestCase.class);
+   }
+   
+   public NestedStackBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.java	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,43 @@
+/*
+* 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 NestedStackDeploymentTestCase extends NestedStackTest
+{
+   public static Test suite()
+   {
+      return suite(NestedStackDeploymentTestCase.class);
+   }
+   
+   public NestedStackDeploymentTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackTest.java
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackTest.java	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NestedStackTest.java	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,65 @@
+/*
+* 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.aop.AspectManager;
+import org.jboss.aop.advice.AdviceStack;
+import org.jboss.test.aop.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans.POJO;
+import org.jboss.test.microcontainer.beans.SimpleFactoryAspect;
+import org.jboss.test.microcontainer.beans.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NestedStackTest extends AOPMicrocontainerTest
+{
+
+   public NestedStackTest(String name)
+   {
+      super(name);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      SimpleFactoryAspect.invoked = 0;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(SimpleFactoryAspect.invoked == 100);
+      assertTrue(TestAspect.invoked);
+      
+   }
+   
+   public void testStackExistsInManager() throws Exception
+   {
+      AspectManager manager = (AspectManager)getBean("AspectManager");
+      AdviceStack stack = manager.getAdviceStack("TestStack");
+      assertNotNull(stack);
+      assertNotNull(stack.getInterceptorFactories());
+      assertEquals(2, stack.getInterceptorFactories().size());
+   }
+
+}
\ No newline at end of file

Added: projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.xml
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.xml	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackAopTestCase.xml	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,28 @@
+<?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>
+
+   <aspect factory="org.jboss.test.microcontainer.beans.SimpleAspectFactory"/>
+   <aspect class="org.jboss.test.microcontainer.beans.TestAspect"/>
+   
+   <stack name="Nested">
+   	<advice aspect="org.jboss.test.microcontainer.beans.SimpleAspectFactory" name="advice"/>
+   </stack>
+   
+   <stack name="TestStack">
+      <stack-ref name="Nested"/>
+      <advice aspect="org.jboss.test.microcontainer.beans.TestAspect" name="advice"/>
+   </stack>
+
+	<bind pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
+		<stack-ref name="TestStack"/>
+	</bind>
+
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO">
+      <annotation>@org.jboss.aop.microcontainer.annotations.EnableAopProxy</annotation>
+   </bean>   
+</aop>

Added: projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.xml
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.xml	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackBeansTestCase.xml	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,82 @@
+<?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>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans.SimpleAspectFactory" class="org.jboss.test.microcontainer.beans.SimpleAspectFactory"/>
+
+   <bean name="org.jboss.test.microcontainer.beans.SimpleAspectFactory" class="org.jboss.aop.microcontainer.beans.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans.SimpleAspectFactory"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="factory">true</property>
+      <property name="name">org.jboss.test.microcontainer.beans.SimpleAspectFactory</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans.TestAspect" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+
+   <bean name="org.jboss.test.microcontainer.beans.TestAspect" class="org.jboss.aop.microcontainer.beans.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="name">org.jboss.test.microcontainer.beans.TestAspect</property>
+   </bean>
+
+   <bean name="Nested" class="org.jboss.aop.microcontainer.beans.Stack">
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="name">Nested</property>
+      <property name="advices">
+         <list>
+            <inject bean="Nested$1"/>
+         </list>
+      </property>
+   </bean>
+   <bean name="Nested$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.SimpleAspectFactory"/></property>
+      <property name="aspectMethod">advice</property>
+      <property name="forStack">true</property>
+   </bean>
+
+   <bean name="TestStack" class="org.jboss.aop.microcontainer.beans.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">TestStack</property>
+   	<property name="advices">
+         <list>
+            <inject bean="TestStack$1"/>
+            <inject bean="TestStack$2"/>
+         </list>
+   	</property>
+   </bean>
+   <bean name="TestStack$1" class="org.jboss.aop.microcontainer.beans.StackEntry">
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="stack"><inject bean="Nested"/></property>
+      <property name="forStack">true</property>
+   </bean>
+   <bean name="TestStack$2" class="org.jboss.aop.microcontainer.beans.InterceptorEntry">
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans.TestAspect"/></property>
+      <property name="aspectMethod">advice</property>
+      <property name="forStack">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.StackEntry">
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="stack"><inject bean="TestStack"/></property>
+      <property name="binding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+   </bean>
+
+
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO">
+      <annotation>@org.jboss.aop.microcontainer.annotations.EnableAopProxy</annotation>
+   </bean>
+</deployment>

Added: projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.xml
===================================================================
--- projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.xml	                        (rev 0)
+++ projects/kernel/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NestedStackDeploymentTestCase.xml	2010-06-29 15:08:16 UTC (rev 106309)
@@ -0,0 +1,28 @@
+<?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>
+
+   <aspect xmlns="urn:jboss:aop-beans:1.0" factory="org.jboss.test.microcontainer.beans.SimpleAspectFactory"/>
+   <aspect xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+   
+   <stack xmlns="urn:jboss:aop-beans:1.0" name="Nested">
+      <advice aspect="org.jboss.test.microcontainer.beans.SimpleAspectFactory" name="advice"/>
+   </stack>
+   
+   <stack xmlns="urn:jboss:aop-beans:1.0" name="TestStack">
+      <stack-ref name="Nested"/>
+      <advice aspect="org.jboss.test.microcontainer.beans.TestAspect" name="advice"/>
+   </stack>
+   
+	<bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
+		<stack-ref name="TestStack"/>
+	</bind>
+
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO">
+      <annotation>@org.jboss.aop.microcontainer.annotations.EnableAopProxy</annotation>
+   </bean>   
+</deployment>



More information about the jboss-cvs-commits mailing list