[jboss-cvs] JBossAS SVN: r67270 - in projects/microcontainer/trunk/aop-mc-int/src: resources/tests/org/jboss/test/microcontainer/beans2/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 19 16:53:08 EST 2007
Author: kabir.khan at jboss.com
Date: 2007-11-19 16:53:07 -0500 (Mon, 19 Nov 2007)
New Revision: 67270
Modified:
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml
Log:
InterceptorEntry for a StackEntry should not have the AspectBinding injected
Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java 2007-11-19 21:53:07 UTC (rev 67270)
@@ -36,6 +36,7 @@
Aspect aspect;
String aspectMethod;
InterceptorFactory interceptorFactory;
+ boolean forStack;
public Aspect getAspect(Aspect aspect)
{
@@ -47,6 +48,11 @@
this.aspect = aspect;
}
+ public void setForStack(boolean forStack)
+ {
+ this.forStack = forStack;
+ }
+
public String getAspectMethod()
{
return aspectMethod;
@@ -73,7 +79,7 @@
{
throw new IllegalArgumentException("Null manager");
}
- if (aspectBinding == null)
+ if (aspectBinding == null && !forStack)
{
throw new IllegalArgumentException("Null aspect binding");
}
@@ -85,13 +91,19 @@
new ScopedInterceptorFactory(aspect.getDefinition()) : new AdviceFactory(aspect.getDefinition(), aspectMethod);
manager.addInterceptorFactory(name, interceptorFactory);
- aspect.addAspectBinding(aspectBinding);
+ if (aspectBinding != null)
+ {
+ aspect.addAspectBinding(aspectBinding);
+ }
}
public void stop()
{
manager.removeInterceptorFactory(name);
- aspect.removeAspectBinding(aspectBinding);
+ if (aspectBinding != null)
+ {
+ aspect.removeAspectBinding(aspectBinding);
+ }
interceptorFactory = null;
}
Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java 2007-11-19 21:53:07 UTC (rev 67270)
@@ -70,13 +70,15 @@
this.advices = advices;
}
- public List<InterceptorEntry> getClonedAdvices()
+ public List<InterceptorEntry> getClonedAdvices(AspectBinding binding)
{
List<InterceptorEntry> entries = new ArrayList<InterceptorEntry>();
for (InterceptorEntry entry : advices)
{
- entries.add((InterceptorEntry)entry.clone());
+ InterceptorEntry cloned = (InterceptorEntry)entry.clone();
+ cloned.setAspectBinding(binding);
+ entries.add(cloned);
}
return entries;
Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java 2007-11-19 21:53:07 UTC (rev 67270)
@@ -66,7 +66,7 @@
{
throw new IllegalArgumentException("Null stack");
}
- advices = stack.getClonedAdvices();
+ advices = stack.getClonedAdvices(aspectBinding);
if (advices == null)
{
throw new IllegalArgumentException("Null advices");
Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml 2007-11-19 21:53:07 UTC (rev 67270)
@@ -45,13 +45,13 @@
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
<bean name="TestStackA$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
</list>
</property>
@@ -65,12 +65,12 @@
<bean name="TestStackB$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/></property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
<bean name="TestStackB$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
</list>
</property>
Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml 2007-11-19 21:53:07 UTC (rev 67270)
@@ -30,13 +30,13 @@
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
<bean name="TestStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
</list>
</property>
Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml 2007-11-19 21:53:07 UTC (rev 67270)
@@ -58,13 +58,13 @@
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
<bean name="AspectStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
</list>
</property>
@@ -78,12 +78,12 @@
<bean name="InterceptorStack$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency"/></property>
- <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
<bean name="InterceptorStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
- <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
</list>
</property>
Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml 2007-11-19 21:24:20 UTC (rev 67269)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml 2007-11-19 21:53:07 UTC (rev 67270)
@@ -36,12 +36,12 @@
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
<property name="aspectMethod">advice</property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
<bean name="TestStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
<property name="manager"><inject bean="AspectManager"/></property>
<property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
- <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ <property name="forStack">true</property>
</bean>
</list>
</property>
More information about the jboss-cvs-commits
mailing list