Upgrade to Tomcat 8.5.11

This commit is contained in:
Brian Clozel
2017-01-20 09:55:33 +01:00
parent 78a23be9bc
commit 35b67a54d2
930 changed files with 32832 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="afterAdviceBindingTests" ref="testAspect">
<aop:after method="oneIntArg" pointcut="execution(* setAge(int)) and args(age)"/>
<aop:after method="oneObjectArg" pointcut="execution(* getAge()) and this(bean)"/>
<aop:after method="oneObjectArg" pointcut="execution(* getDoctor()) and target(bean)"/>
<aop:after method="oneIntAndOneObject"
pointcut="execution(* setAge(..)) and args(age) and this(bean)" arg-names="age,bean"/>
<aop:after method="needsJoinPoint" pointcut="execution(* getAge())"/>
<aop:after method="needsJoinPointStaticPart" pointcut="execution(* getAge())"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.AdviceBindingTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="afterReturningAdviceBindingTests" ref="testAspect">
<aop:after-returning method="oneIntArg" pointcut="execution(* setAge(int)) and args(age)"/>
<aop:after-returning method="oneObjectArg" pointcut="execution(* getAge()) and this(bean)"/>
<aop:after-returning method="oneIntAndOneObject"
pointcut="execution(* setAge(..)) and args(age) and this(bean)" arg-names="age,bean"/>
<aop:after-returning method="needsJoinPoint" pointcut="execution(* getAge())"/>
<aop:after-returning method="needsJoinPointStaticPart" pointcut="execution(* getAge())"/>
<!-- additional tests using the returning attribute -->
<aop:after-returning method="oneString" returning="name" pointcut="execution(* getName())"/>
<aop:after-returning method="oneObjectArg" returning="bean" pointcut="execution(* returnsThis())"/>
<aop:after-returning method="oneTestBeanArg" returning="bean" pointcut="execution(* returnsThis())"/>
<aop:after-returning method="testBeanArrayArg" returning="beans"
pointcut="execution(org.springframework.tests.sample.beans.ITestBean[] *(..))"/>
<aop:after-returning method="oneString" returning="name" pointcut="execution(* getSpouse())"/>
<aop:after-returning method="objectMatchNoArgs" returning="java.lang.Object"
pointcut="execution(* returnsThis())"/>
<aop:after-returning method="stringMatchNoArgs" returning="java.lang.String"
pointcut="execution(* getSpouse())"/>
<aop:after-returning method="oneInt" returning="result" pointcut="execution(* haveBirthday())"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="afterThrowingAdviceBindingTests" ref="testAspect">
<aop:after-throwing
method="noArgs"
pointcut="execution(* exceptional(..))"
/>
<aop:after-throwing
method="oneThrowable"
throwing="t"
pointcut="execution(* exceptional(..))"
/>
<aop:after-throwing
method="oneRuntimeException"
throwing="ex"
pointcut="execution(* exceptional(..))"
/>
<aop:after-throwing
method="noArgsOnThrowableMatch"
throwing="java.lang.Throwable"
pointcut="execution(* exceptional(..))"
/>
<aop:after-throwing
method="noArgsOnRuntimeExceptionMatch"
throwing="java.lang.RuntimeException"
pointcut="execution(* exceptional(..))"
/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.AfterThrowingAdviceBindingTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="beforeAdviceBindingTests" ref="testAspect">
<aop:around method="oneIntArg" pointcut="execution(* setAge(int)) and args(age)" />
<aop:around method="oneObjectArg" pointcut="execution(* getAge()) and target(bean)"/>
<aop:around method="oneIntAndOneObject"
pointcut="execution(* setAge(..)) and args(age) and this(bean)" arg-names="thisJoinPoint,age,bean"/>
<aop:around method="justJoinPoint" pointcut="execution(* getAge())"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.AroundAdviceBindingTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="beforeAdviceBindingTests" ref="testAspect">
<aop:around method="oneIntArg" pointcut="execution(* setAge(int)) and args(age)" />
<aop:around method="oneObjectArg" pointcut="execution(* getAge()) and target(bean)"/>
<aop:around method="oneIntAndOneObject"
pointcut="execution(* setAge(..)) and args(age) and this(bean)" arg-names="thisJoinPoint,age,bean"/>
<aop:around method="justJoinPoint" pointcut="execution(* getAge())"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.AroundAdviceBindingTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="spouse" ref="testBean2"/>
</bean>
<bean id="testBean2" class="org.springframework.tests.sample.beans.TestBean" autowire-candidate="false">
<property name="spouse" ref="testBean"/>
</bean>
</beans>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:advisor id="lowPrecedenceAdvisor"
advice-ref="lowPrecedenceSpringAdvice"
pointcut="execution(* getAge(..))"
order="900"/>
<aop:advisor id="highPrecedenceAdvisor"
advice-ref="highPrecedenceSpringAdvice"
pointcut="execution(* getAge(..))"
order="90"/>
<aop:aspect ref="lowPrecedenceAspect" order="1000">
<aop:before
method="beforeAdviceOne"
pointcut="execution(* getAge())"/>
<aop:before
method="beforeAdviceTwo"
pointcut="execution(* getAge())"/>
<aop:around
method="aroundAdviceOne"
pointcut="execution(* getAge())"/>
<aop:around
method="aroundAdviceTwo"
pointcut="execution(* getAge())"/>
<aop:after-returning
method="afterAdviceOne"
pointcut="execution(* getAge())"/>
<aop:after-returning
method="afterAdviceTwo"
pointcut="execution(* getAge())"/>
</aop:aspect>
<aop:aspect ref="highPrecedenceAspect">
<aop:before
method="beforeAdviceOne"
pointcut="execution(* getAge())"/>
<aop:before
method="beforeAdviceTwo"
pointcut="execution(* getAge())"/>
<aop:around
method="aroundAdviceOne"
pointcut="execution(* getAge())"/>
<aop:around
method="aroundAdviceTwo"
pointcut="execution(* getAge())"/>
<aop:after-returning
method="afterAdviceOne"
pointcut="execution(* getAge())"/>
<aop:after-returning
method="afterAdviceTwo"
pointcut="execution(* getAge())"/>
</aop:aspect>
</aop:config>
<bean id="highPrecedenceSpringAdvice" class="org.springframework.aop.aspectj.SimpleSpringBeforeAdvice"/>
<bean id="lowPrecedenceSpringAdvice" class="org.springframework.aop.aspectj.SimpleSpringBeforeAdvice"/>
<bean id="highPrecedenceAspect" class="org.springframework.aop.aspectj.PrecedenceTestAspect">
<property name="order" value="10"/>
</bean>
<bean id="lowPrecedenceAspect" class="org.springframework.aop.aspectj.PrecedenceTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="advisor" class="org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor">
<property name="expression"
value="execution(org.springframework.tests.sample.beans.ITestBean[] org.springframework.tests.sample.beans.ITestBean.*(..))"/>
<property name="advice" ref="interceptor"/>
</bean>
<bean id="interceptor" class="org.springframework.aop.aspectj.CallCountingInterceptor"/>
</beans>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="testBean1" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="testBean2" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="testBean3" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="counterAspect" class="org.springframework.aop.aspectj.CounterAspect"/>
</beans>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="beanNameMatchingTest" ref="counterAspect">
<aop:pointcut id="bean1Operation" expression="execution(* set*(..)) and bean(myBean) and !bean(foo)"/>
<aop:before pointcut-ref="bean1Operation" method="increment()"/>
<aop:pointcut id="nestedBeanOperation" expression="execution(* getCompany(..)) and bean(testBean*)"/>
<aop:before pointcut-ref="nestedBeanOperation" method="increment()"/>
<aop:pointcut id="factoryBean1Operation" expression="bean(testFactoryBean1)"/>
<aop:before pointcut-ref="factoryBean1Operation" method="increment()"/>
<aop:pointcut id="factoryBean2Operation" expression="bean(&amp;testFactoryBean2)"/>
<aop:before pointcut-ref="factoryBean2Operation" method="increment()"/>
</aop:aspect>
</aop:config>
<bean id="tb1" name="testBean1" class="org.springframework.tests.sample.beans.TestBean">
<qualifier value="myBean"/>
</bean>
<bean id="tb2" name="testBean2" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="testBeanContainingNestedBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="doctor">
<bean class="org.springframework.tests.sample.beans.NestedTestBean"/>
</property>
</bean>
<bean id="testFactoryBean1" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="myKey" value="myValue"/>
</map>
</property>
</bean>
<bean id="testFactoryBean2" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="myKey" value="myValue"/>
</map>
</property>
</bean>
<bean id="counterAspect" class="org.springframework.aop.aspectj.Counter"/>
<aop:config>
<aop:advisor pointcut="bean(*This) and !bean(dont*)" advice-ref="testInterceptor"/>
</aop:config>
<bean id="interceptThis" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="dontInterceptThis" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="testInterceptor" class="org.springframework.aop.aspectj.BeanNamePointcutTests$TestInterceptor"/>
</beans>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="beforeAdviceBindingTests" ref="testAspect">
<aop:before method="oneIntArg" pointcut="execution(* setAge(int)) and args(age)"/>
<aop:before method="oneObjectArg" pointcut="execution(* getAge()) and this(bean)"/>
<aop:before method="oneIntAndOneObject"
pointcut="execution(* setAge(..)) and args(age) and target(bean)" arg-names="age,bean"/>
<aop:before method="needsJoinPoint" pointcut="execution(* getAge())"/>
<aop:before method="needsJoinPointStaticPart" pointcut="execution(* getAge())"/>
</aop:aspect>
<!-- variation with external pointcut reference -->
<aop:aspect ref="authenticationLogger">
<aop:pointcut id="authenticationMethodWithString"
expression="execution(boolean *..SecurityManager.authenticate(..)) and args(username,java.lang.String)"/>
<aop:before pointcut-ref="authenticationMethodWithString"
method="logAuthenticationAttempt(java.lang.String)"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.AdviceBindingTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="authenticationLogger" class="org.springframework.aop.aspectj.AuthenticationLogger"/>
</beans>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="topsyTurvyAspect" class="org.springframework.aop.aspectj.TopsyTurvyAspect"/>
<bean id="topsyTurvyTarget" class="org.springframework.aop.aspectj.TopsyTurvyTargetImpl"/>
<aop:config>
<aop:aspect id="myAspect" ref="topsyTurvyAspect">
<aop:before pointcut-ref="pc1"
method="before"/>
<aop:declare-parents
types-matching="*..TopsyTurvyTarget+"
implement-interface="java.io.Serializable"
default-impl="org.springframework.aop.aspectj.DeclarationOrderIndependenceTests$SerializableMixin"/>
<aop:after-returning pointcut-ref="pc2" method="afterReturning"/>
<aop:pointcut id="pc1" expression="execution(* *..do*(..))"/>
<aop:around pointcut-ref="pc2"
method="around"/>
<aop:pointcut id="pc2" expression="execution(* *..TopsyTurvyTarget+.get*(..))"/>
<aop:declare-parents
types-matching="*..TopsyTurvyTarget+"
implement-interface="org.springframework.beans.factory.BeanNameAware"
default-impl="org.springframework.aop.aspectj.DeclarationOrderIndependenceTests$BeanNameAwareMixin"/>
</aop:aspect>
</aop:config>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<aop:config>
<aop:aspect id="testAspect">
<aop:declare-parents
types-matching="org.springframework.aop.aspectj.NoMethodsBean+"
implement-interface="org.springframework.aop.aspectj.ICounter"
delegate-ref="counter"
/>
</aop:aspect>
</aop:config>
<bean id="noMethodsBean" class="org.springframework.aop.aspectj.NoMethodsBeanImpl"/>
<bean id="counter" class="org.springframework.aop.aspectj.Counter"/>
</beans>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="beforeAdviceBindingTests" ref="introduction">
<aop:declare-parents
types-matching="org.springframework.tests.sample.beans..*"
implement-interface="test.mixin.Lockable"
default-impl="test.mixin.DefaultLockable"
/>
<aop:before
method="checkNotLocked"
pointcut="execution(* set*(*)) and this(mixin)"
arg-names="mixin"
/>
</aop:aspect>
</aop:config>
<bean id="introduction" class="org.springframework.aop.aspectj.NonAnnotatedMakeLockable"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="aTestBean"/>
</bean>
<aop:aspectj-autoproxy proxy-target-class="true">
<aop:include name="counterAtAspectJAspect"/>
</aop:aspectj-autoproxy>
<bean id="counterAtAspectJAspect"
class="org.springframework.aop.aspectj.ImplicitJPArgumentMatchingAtAspectJTests$CounterAtAspectJAspect"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config proxy-target-class="true">
<aop:aspect ref="counterAspect">
<aop:pointcut id="anyOperation"
expression="execution(* org.springframework.tests.sample.beans.TestBean.*(..)) and this(bean) and args(argument)"/>
<aop:around pointcut-ref="anyOperation" method="increment" arg-names="bean,argument"/>
</aop:aspect>
</aop:config>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="aTestBean"/>
</bean>
<bean id="counterAspect"
class="org.springframework.aop.aspectj.ImplicitJPArgumentMatchingTests$CounterAspect"/>
</beans>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="ambiguousAdviceTest" ref="testAspect">
<aop:pointcut id="setter" expression="execution(* setName(..)) and args(name)"/>
<aop:before pointcut-ref="setter" method="myBeforeAdvice"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.OverloadedAdviceTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="overloadedAdviceTest" ref="testAspect">
<aop:pointcut id="setter" expression="execution(* setName(..)) and args(name)"/>
<aop:before pointcut-ref="setter" method="myBeforeAdvice(java.lang.String)"/>
<aop:before pointcut-ref="setter" method="myBeforeAdvice(int)"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.OverloadedAdviceTestAspect"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="aspectOne" ref="firstTestAspect">
<aop:around pointcut="execution(* setName(..)) and args(value)" method="capitalize"/>
<aop:around pointcut="execution(* setAge(..))" method="doubleOrQuits"/>
<aop:around pointcut="execution(* setMyFloat(..)) and args(value)" method="addOne"/>
<aop:before pointcut="execution(* setMyFloat(..)) and args(arg)" method="captureFloatArgument"/>
<aop:around pointcut="execution(* setSex(..)) and args(value)" method="capitalize"/>
</aop:aspect>
<aop:aspect id="aspectTwo" ref="secondTestAspect">
<aop:before pointcut="execution(* setSex(..)) and args(arg)" method="captureStringArgument"/>
<aop:around pointcut="execution(* setSex(..)) and args(arg)" method="captureStringArgumentInAround"/>
</aop:aspect>
</aop:config>
<bean id="testBean" class="org.springframework.aop.aspectj.SimpleBeanImpl"/>
<bean id="firstTestAspect" class="org.springframework.aop.aspectj.ProceedTestingAspect">
<property name="order" value="1"/>
</bean>
<bean id="secondTestAspect" class="org.springframework.aop.aspectj.ProceedTestingAspect">
<property name="order" value="2"/>
</bean>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect ref="monitoringAspect">
<aop:before method="before" pointcut="execution(* increment*())" />
<aop:around method="around" pointcut="execution(* increment*())" />
</aop:aspect>
</aop:config>
<bean id="monitoringAspect" class="org.springframework.aop.aspectj.JoinPointMonitorAspect">
<property name="counter" ref="counter"/>
</bean>
<bean id="counter" class="org.springframework.aop.aspectj.Counter"/>
</beans>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="counter" class="org.springframework.aop.aspectj.Counter"/>
<aop:aspectj-autoproxy/>
<bean id="monitoringAspect" class="org.springframework.aop.aspectj.JoinPointMonitorAtAspectJAspect">
<property name="counter" ref="counter" />
</bean>
</beans>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="monitoringAspect"
class="org.springframework.aop.aspectj.JoinPointMonitorAtAspectJAspect">
<property name="counter" ref="counter" />
</bean>
<bean id="counter" class="org.springframework.aop.aspectj.Counter"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="counter" class="org.springframework.aop.aspectj.Counter"/>
<aop:config>
<aop:aspect ref="monitoringAspect">
<aop:before method="before" pointcut="execution(* increment*())" />
<aop:around method="around" pointcut="execution(* increment*())" />
</aop:aspect>
</aop:config>
<bean id="monitoringAspect" class="org.springframework.aop.aspectj.JoinPointMonitorAspect" lazy-init="true">
<property name="counter" ref="counter"/>
</bean>
</beans>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="beforeAdviceBindingTests" ref="testAspect">
<aop:pointcut id="foo" expression="execution(* foo(..)) and args(x)"/>
<aop:before pointcut-ref="foo" method="doBefore(int)"/>
<aop:before pointcut-ref="foo" method="doBefore(java.lang.String)"/>
</aop:aspect>
</aop:config>
<bean id="toBeAdvised" class="org.springframework.aop.aspectj.ToBeAdvised"/>
<bean id="testAspect" class="org.springframework.aop.aspectj.MyAspect"/>
</beans>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="thisMatcher" ref="testAspect">
<aop:before pointcut="execution(* *(..)) and this(java.io.Serializable)" method="toString"/>
</aop:aspect>
<aop:aspect id="targetMatcher" ref="testAspect">
<aop:before pointcut="execution(* *(..)) and target(java.io.Serializable)" method="toString"/>
</aop:aspect>
<aop:aspect id="argsMatcher" ref="testAspect">
<aop:before pointcut="execution(* bar(..)) and args(java.io.Serializable)" method="toString"/>
</aop:aspect>
</aop:config>
<!-- should not be proxied -->
<bean id="testClassA" class="org.springframework.aop.aspectj.SubtypeMatchingTestClassA"/>
<!-- should be proxied -->
<bean id="testClassB" class="org.springframework.aop.aspectj.SubtypeMatchingTestClassB"/>
<!-- should be proxied -->
<bean id="testClassC" class="org.springframework.aop.aspectj.SubtypeMatchingTestClassC"/>
<bean id="testAspect" class="java.lang.Object"/>
</beans>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:advisor pointcut="target(org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestImpl1)"
advice-ref="testInterceptor"/>
<aop:aspect ref="testAspectForTestImpl1">
<aop:before pointcut="target(org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestImpl1)"
method="increment"/>
</aop:aspect>
<aop:aspect ref="testAspectForAbstractTestImpl">
<aop:before pointcut="target(org.springframework.aop.aspectj.TargetPointcutSelectionTests$AbstractTestImpl)"
method="increment"/>
</aop:aspect>
</aop:config>
<bean id="testImpl1" class="org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestImpl1"/>
<bean id="testImpl2" class="org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestImpl2"/>
<bean id="testAspectForTestImpl1" class="org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestAspect"/>
<bean id="testAspectForAbstractTestImpl" class="org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestAspect"/>
<bean id="testInterceptor" class="org.springframework.aop.aspectj.TargetPointcutSelectionTests$TestInterceptor"/>
</beans>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy proxy-target-class="false"/>
<bean id="counter"
class="org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests$Counter" />
<bean id="testBean" class="org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests$TestImpl" />
<bean id="testAnnotatedClassBean" class="org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests$AnnotatedClassTestImpl" />
<bean id="testAnnotatedMethodBean" class="org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests$AnnotatedMethodTestImpl" />
</beans>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect ref="thisAsClassCounter">
<aop:before method="increment"
pointcut="this(org.springframework.aop.aspectj.TestImpl)" />
</aop:aspect>
<aop:aspect ref="thisAsInterfaceCounter">
<aop:before method="increment"
pointcut="this(org.springframework.aop.aspectj.TestInterface)" />
</aop:aspect>
<aop:aspect ref="targetAsClassCounter">
<aop:before method="increment"
pointcut="target(org.springframework.aop.aspectj.TestImpl)" />
</aop:aspect>
<aop:aspect ref="targetAsInterfaceCounter">
<aop:before method="increment"
pointcut="target(org.springframework.aop.aspectj.TestInterface)" />
</aop:aspect>
<aop:aspect ref="thisAsClassAndTargetAsClassCounter">
<aop:before method="increment"
pointcut="this(org.springframework.aop.aspectj.TestImpl) and target(org.springframework.aop.aspectj.TestImpl)" />
</aop:aspect>
<aop:aspect ref="thisAsInterfaceAndTargetAsInterfaceCounter">
<aop:before method="increment"
pointcut="this(org.springframework.aop.aspectj.TestInterface) and target(org.springframework.aop.aspectj.TestInterface)" />
</aop:aspect>
<aop:aspect ref="thisAsInterfaceAndTargetAsClassCounter">
<aop:before method="increment"
pointcut="this(org.springframework.aop.aspectj.TestInterface) and target(org.springframework.aop.aspectj.TestImpl)" />
</aop:aspect>
</aop:config>
<bean id="thisAsClassCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="thisAsInterfaceCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="targetAsClassCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="targetAsInterfaceCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="thisAsClassAndTargetAsClassCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="thisAsInterfaceAndTargetAsInterfaceCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="thisAsInterfaceAndTargetAsClassCounter" class="org.springframework.aop.aspectj.Counter" />
<bean id="testBean" class="org.springframework.aop.aspectj.TestImpl" />
</beans>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="annotationBindingAspect" ref="testAspect">
<aop:around pointcut="@annotation(testAnnotation)" method="doWithAnnotation"/>
</aop:aspect>
</aop:config>
<bean id="testAspect" class="org.springframework.aop.aspectj.autoproxy.AnnotationBindingTestAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.autoproxy.AnnotatedTestBeanImpl"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:advisor advice-ref="testInterceptor" pointcut-ref="myPointcut"/>
</aop:config>
<bean id="testInterceptor" class="org.springframework.aop.aspectj.autoproxy.TestMethodInterceptor"/>
<bean id="myPointcut" class="org.springframework.aop.support.annotation.AnnotationMatchingPointcut" factory-method="forMethodAnnotation">
<constructor-arg value="org.springframework.aop.aspectj.autoproxy.TestAnnotation"/>
</bean>
<bean id="testAspect" class="org.springframework.aop.aspectj.autoproxy.AnnotationBindingTestAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.autoproxy.AnnotatedTestBeanImpl"/>
</beans>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect ref="interfaceExtendingAspect">
<aop:pointcut id="anyOperation"
expression="execution(* *(..))"/>
<aop:around pointcut-ref="anyOperation" method="increment"/>
</aop:aspect>
</aop:config>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean" />
<bean id="interfaceExtendingAspect"
class="org.springframework.aop.aspectj.autoproxy.InterfaceExtendingAspect"/>
</beans>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator">
<property name="customTargetSourceCreators">
<bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator"/>
</property>
</bean>
<bean class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue">
<property name="multiple" value="2"/>
</bean>
<bean id="adrianParent" abstract="true">
<property name="name" value="adrian"/>
</bean>
<!-- parent="adrianParent" -->
<bean id="adrian" class="org.springframework.aop.aspectj.autoproxy.LazyTestBean" lazy-init="true">
<property name="age" value="34"/>
<property name="name" value="adrian"/>
</bean>
</beans>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!--
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" />
-->
<aop:aspectj-autoproxy/>
<bean class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue">
<property name="multiple" value="2"/>
</bean>
<bean class="org.springframework.aop.aspectj.autoproxy.DummyAspect"/>
<bean class="org.springframework.aop.aspectj.autoproxy.DummyAspectWithParameter"/>
<bean id="adrianParent" abstract="true">
<property name="name" value="adrian"/>
</bean>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" parent="adrianParent">
<property name="age" value="34"/>
</bean>
<bean id="adrian2Parent" class="org.springframework.tests.sample.beans.TestBean" abstract="true">
<property name="name" value="adrian"/>
</bean>
<bean id="factoryBean" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="adrian"/>
<property name="targetMethod" value="toString"/>
</bean>
</beans>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/>
<bean id="aspect" class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue">
<property name="multiple" value="3"/>
</bean>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Adrian"/>
<property name="age" value="34"/>
</bean>
<bean id="adrian2" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="Adrian"/>
<property name="age" value="34"/>
</bean>
<bean id="i21" class="org.springframework.tests.sample.beans.NestedTestBean" scope="prototype">
<property name="company" value="i21"/>
</bean>
<bean id="advisor" class="org.springframework.aop.aspectj.autoproxy.TestBeanAdvisor"/>
</beans>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
default-lazy-init="true">
<aop:aspectj-autoproxy/>
<bean class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue">
<property name="multiple" value="2"/>
</bean>
<bean id="factoryBean" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="adrian"/>
<property name="targetMethod" value="toString"/>
</bean>
<bean id="adrianParent" abstract="true">
<property name="name" value="adrian"/>
</bean>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" parent="adrianParent">
<property name="age" value="34"/>
</bean>
<bean id="adrian2Parent" class="org.springframework.aop.aspectj.autoproxy.DummyFactoryBean" abstract="true"/>
</beans>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<!--
<bean
class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" />
-->
<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>
</beans>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!--
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" />
-->
<aop:aspectj-autoproxy/>
<bean class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue">
<property name="multiple" value="2"/>
</bean>
<bean class="org.springframework.aop.aspectj.autoproxy.IncreaseReturnValue"/>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
</beans>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/>
<bean class="test.aspect.PerTargetAspect"
scope="prototype">
<property name="order" value="5"/>
</bean>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
<bean id="juergen" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="juergen"/>
<property name="age" value="30"/>
</bean>
</beans>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/>
<bean class="test.aspect.PerThisAspect" scope="prototype"/>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
</beans>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
<aop:aspectj-autoproxy proxy-target-class="true"/>
<bean id="retryAspect" class="org.springframework.aop.aspectj.autoproxy.RetryAspect"/>
<bean id="unreliableBean" class="org.springframework.aop.aspectj.autoproxy.UnreliableBean"/>
</beans>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/>
<bean id="aspect" class="test.aspect.TwoAdviceAspect"/>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
</beans>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/>
<bean id="aspect" class="test.aspect.TwoAdviceAspect"
scope="prototype"/>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
</beans>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy>
<aop:include name="aspectOne"/>
</aop:aspectj-autoproxy>
<bean id="aspectOne" class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue" >
<property name="multiple" value="2" />
</bean>
<bean id="aspectTwo"
class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue" >
<property name="multiple" value="2" />
</bean>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="adrian" />
<property name="age" value="34" />
</bean>
</beans>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/>
<bean id="aspect" class="org.springframework.aop.aspectj.autoproxy.AdviceUsingThisJoinPoint"/>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
</beans>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="aspect" class="org.springframework.aop.aspectj.autoproxy.ExceptionHandlingAspect"/>
</beans>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="testAspect" class="org.springframework.aop.aspectj.autoproxy.AtAspectJAnnotationBindingTestAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.autoproxy.AnnotatedTestBeanImpl"/>
<bean id="arrayFactoryBean" class="org.springframework.aop.aspectj.autoproxy.ResourceArrayFactoryBean"/>
</beans>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!--
<bean
class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" />
-->
<aop:aspectj-autoproxy/>
<bean
class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue" >
<property name="multiple" value="2" />
</bean>
<bean
class="org.springframework.aop.aspectj.autoproxy.benchmark.TraceAspect" >
</bean>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="adrian" />
<property name="age" value="34" />
</bean>
</beans>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!--
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" />
-->
<aop:aspectj-autoproxy>
<!-- Explicit testing the whitespace body variant here -->
</aop:aspectj-autoproxy>
<bean class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor" >
<property name="advice" ref="multiplyReturnValueInterceptor" />
<property name="mappedName" value="getAge" />
</bean>
<bean id="multiplyReturnValueInterceptor"
class="org.springframework.aop.aspectj.autoproxy.benchmark.MultiplyReturnValueInterceptor" >
<property name="multiple" value="2" />
</bean>
<bean class="org.springframework.aop.aspectj.autoproxy.benchmark.TraceBeforeAdvice"
factory-method="advisor" />
<bean class="org.springframework.aop.aspectj.autoproxy.benchmark.TraceAfterReturningAdvice"
factory-method="advisor" />
<bean class="org.springframework.aop.aspectj.autoproxy.benchmark.TraceAspect"/>
<bean id="adrian" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="adrian"/>
<property name="age" value="34"/>
</bean>
</beans>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="service" class="org.springframework.aop.aspectj.autoproxy.spr3064.ServiceImpl"/>
<bean id="transactionInterceptor" class="org.springframework.aop.aspectj.autoproxy.spr3064.TransactionInterceptor"/>
</beans>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="counterAspect" class="org.springframework.aop.aspectj.generic.CounterAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.generic.GenericReturnTypeVariationClass"/>
</beans>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy proxy-target-class="true"/>
<bean id="counterAspect" class="org.springframework.aop.aspectj.generic.GenericCounterAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.generic.DerivedStringParameterizedClass"/>
</beans>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy proxy-target-class="false"/>
<bean id="counterAspect" class="org.springframework.aop.aspectj.generic.GenericCounterAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.generic.DerivedStringParameterizedClass"/>
</beans>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:aspectj-autoproxy/>
<bean id="counterAspect" class="org.springframework.aop.aspectj.generic.GenericParameterMatchingTests$CounterAspect"/>
<bean id="testBean" class="org.springframework.aop.aspectj.generic.GenericParameterMatchingTests$GenericImpl"/>
</beans>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:pointcut id="pc" expression="execution(* getAge())"/>
<aop:before pointcut-ref="pc" method="myBeforeAdvice" returning="age" />
</aop:aspect>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:pointcut id="pc" expression="execution(* getAge())"/>
<aop:before pointcut-ref="pc" method="myBeforeAdvice" />
<aop:after pointcut-ref="pc" method="myAfterAdvice" />
<aop:after-returning pointcut-ref="pc" method="myAfterReturningAdvice" returning="age"/>
<aop:after-throwing pointcut-ref="pc" method="myAfterThrowingAdvice" throwing="ex"/>
<aop:around pointcut-ref="pc" method="myAroundAdvice"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:before pointcut="execution(* setAge(..)) and args(age) and this(bean)"
method="mySetAgeAdvice" arg-names="age bean"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:before pointcut="execution(* setAge(..)) and args(age) and this(bean)"
method="mySetAgeAdvice" arg-names="age,bean"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<aop:config proxy-target-class="true" expose-proxy="true">
<aop:pointcut id="getNameCalls" expression="execution(* getName(..)) and within(*..ITestBean+)"/>
<aop:advisor id="getAgeAdvisor" pointcut="execution(* *..ITestBean.getAge(..))" advice-ref="getAgeCounter"/>
<aop:advisor id="getNameAdvisor" pointcut-ref="getNameCalls" advice-ref="getNameCounter"/>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:pointcut id="setCalls" expression="execution(* *..ITestBean.set*(..))"/>
<aop:before pointcut="execution(* *..ITestBean.set*(..))" method="myBeforeAdvice"/>
<aop:after pointcut-ref="setCalls" method="myAfterAdvice"/>
<aop:around pointcut-ref="setCalls" method="myAroundAdvice"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:after pointcut="execution(int getAge(..))" method="myAfterAdvice" returning="age"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:after-returning pointcut="execution(int getAge(..))" method="myAfterReturningAdvice" returning="age"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:pointcut id="getNameCalls" expression="execution(* getName(..)) and within(*..ITestBean+)"/>
<aop:advisor id="getAgeAdvisor" pointcut="execution(* *..ITestBean.getAge(..))" advice-ref="getAgeCounter"/>
<aop:advisor id="getNameAdvisor" pointcut-ref="getNameCalls" advice-ref="getNameCounter"/>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:pointcut id="setCalls" expression="execution(* *..ITestBean.set*(..))"/>
<aop:before pointcut="execution(* *..ITestBean.set*(..))" method="myBeforeAdvice"/>
<aop:after pointcut-ref="setCalls" method="myAfterAdvice"/>
<aop:around pointcut-ref="setCalls" method="myAroundAdvice"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:after pointcut="execution(int getAge(..))" method="myAfterAdvice" throwing="ex"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<aop:config>
<aop:aspect id="countAgeCalls" ref="countingAdvice">
<aop:after-throwing pointcut="execution(int getAge(..))" method="myAfterThrowingAdvice" throwing="ex"/>
</aop:aspect>
</aop:config>
<bean id="getNameCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="getAgeCounter" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
</beans>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="service" class="org.springframework.tests.sample.beans.TestBean" scope="prototype"/>
<bean id="serviceDependent1" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg ref="service"/>
</bean>
<bean id="serviceDependent2" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg ref="service"/>
</bean>
<bean id="nullInstance" class="org.springframework.tests.sample.beans.FactoryMethods" factory-method="nullInstance"/>
<bean id="serviceInterceptor" class="org.springframework.aop.interceptor.DebugInterceptor"/>
<aop:config proxy-target-class="false">
<aop:pointcut id="servicePointcut" expression="target(org.springframework.tests.sample.beans.ITestBean)"/>
<aop:advisor advice-ref="serviceInterceptor" pointcut-ref="servicePointcut"/>
</aop:config>
</beans>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="testBean" class="org.springframework.aop.framework.CglibTestBean">
<property name="name" value="Rob Harrop"/>
<lookup-method name="getName" bean="fixedName"/>
</bean>
<bean id="fixedName" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:component-scan base-package="org.springframework.aop.framework" />
<aop:config>
<aop:advisor advice-ref="debugInterceptor" pointcut="bean(classWithComplexConstructor)" />
</aop:config>
<bean id="debugInterceptor"
class="org.springframework.aop.interceptor.DebugInterceptor" />
</beans>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="debugInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="testBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<!-- Target is autowired, so can check type of parent without a guard -->
<property name="target">
<bean class="org.springframework.tests.sample.beans.TestBean" autowire="byType"/>
</property>
<property name="interceptorNames" value="debugInterceptor"/>
</bean>
</beans>

View File

@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- Simple target -->
<bean id="test" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>custom</value></property>
<property name="age"><value>666</value></property>
</bean>
<bean id="debugInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="test1" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="target"><ref bean="test"/></property>
<property name="interceptorNames"><value>debugInterceptor</value></property>
</bean>
<!--
Check that invoker is automatically added to wrap target.
Non pointcut bean name should be wrapped in invoker.
-->
<bean id="autoInvoker" class="org.springframework.aop.framework.ProxyFactoryBean">
<!--
Aspect interfaces don't need to be included here.
They may, for example, be added by global interceptors.
-->
<property name="interfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<!--
Note that "test" is a target. An InvokerInterceptor
will be added automatically.
-->
<property name="interceptorNames"><value>global*,test</value></property>
</bean>
<bean id="prototype" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interfaces">
<value>
org.springframework.tests.sample.beans.ITestBean
</value>
</property>
<property name="singleton"><value>false</value></property>
<property name="interceptorNames"><value>test</value></property>
</bean>
<bean id="test2" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>
org.springframework.tests.sample.beans.ITestBean
</value>
</property>
<property name="singleton"><value>false</value></property>
<property name="targetName"><value>test</value></property>
</bean>
<bean id="test3" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="autodetectInterfaces"><value>true</value></property>
<property name="target"><ref bean="test"/></property>
<property name="interceptorNames"><value>debugInterceptor</value></property>
</bean>
<bean id="test4" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="autodetectInterfaces"><value>true</value></property>
<property name="singleton"><value>false</value></property>
<property name="targetName"><value>test</value></property>
</bean>
<bean id="testCircle1" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="autodetectInterfaces"><value>true</value></property>
<property name="targetName"><value>testCircleTarget1</value></property>
</bean>
<bean id="testCircleTarget1" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>custom</value></property>
<property name="age"><value>666</value></property>
<property name="spouse"><ref bean="testCircle2"/></property>
</bean>
<bean id="testCircle2" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="autodetectInterfaces"><value>true</value></property>
<property name="targetName"><value>testCircleTarget2</value></property>
</bean>
<bean id="testCircleTarget2" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>custom</value></property>
<property name="age"><value>666</value></property>
<property name="spouse"><ref bean="testCircle1"/></property>
</bean>
<bean id="pointcuts" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="interceptorNames"><value>pointcutForVoid</value></property>
<property name="targetName"><value>test</value></property>
</bean>
<bean id="pointcutForVoid" class="org.springframework.aop.framework.ProxyFactoryBeanTests$PointcutForVoid"/>
<!--
Invalid test for global pointcuts.
Must have target because there are no interceptors.
-->
<!--
<bean id="noInterceptorNamesWithoutTarget"
class="org.springframework.aop.framework.ProxyFactoryBean"
>
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
</bean>
<bean id="noInterceptorNamesWithTarget"
class="org.springframework.aop.framework.ProxyFactoryBean"
>
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="target"><ref bean="test"/></property>
</bean>
-->
<bean id="validGlobals" scope="singleton" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.context.ApplicationListener</value></property>
<property name="interceptorNames"><value>debugInterceptor,global*,target2</value></property>
</bean>
<!--
Global debug interceptor
-->
<bean id="global_debug" class="org.springframework.aop.interceptor.DebugInterceptor"/>
<!--
Will add aspect interface to all beans exposing globals
-->
<bean id="global_aspectInterface" class="org.springframework.aop.framework.ProxyFactoryBeanTests$GlobalIntroductionAdvice"/>
<bean id="prototypeLockMixinAdvisor" class="test.mixin.LockMixinAdvisor" scope="prototype"/>
<bean id="prototypeTestBean" class="org.springframework.tests.sample.beans.TestBean" scope="prototype"/>
<bean id="prototypeTestBeanProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="singleton"><value>false</value></property>
<property name="interceptorNames">
<list>
<value>prototypeLockMixinAdvisor</value>
<value>prototypeTestBean</value>
</list>
</property>
</bean>
<bean id="prototypeLockMixinInterceptor" class="test.mixin.LockMixin" scope="prototype"/>
<bean id="prototypeTestBeanProxySingletonTarget" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interfaces">
<list>
<value>org.springframework.tests.sample.beans.ITestBean</value>
<value>test.mixin.Lockable</value>
</list>
</property>
<property name="singleton"><value>false</value></property>
<property name="target"><ref bean="prototypeTestBean"/></property>
<property name="interceptorNames">
<list>
<value>prototypeLockMixinInterceptor</value>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Tests for misconfiguring the proxy factory bean using a target source in the
interceptor list as well as set by the targetSource property
-->
<beans>
<bean id="eveTargetSource" class="org.springframework.aop.target.SingletonTargetSource">
<constructor-arg>
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Eve</value></property>
</bean>
</constructor-arg>
</bean>
<bean id="adam" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Adam</value></property>
</bean>
<bean id="adamTargetSource" class="org.springframework.aop.target.SingletonTargetSource">
<constructor-arg>
<ref bean="adam"/>
</constructor-arg>
</bean>
<bean id="countingBeforeAdvice"
class="org.springframework.tests.aop.advice.CountingBeforeAdvice"
/>
<bean id="doubleTarget"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<!-- this is the one used and NOT the one set by targetSource -->
<property name="interceptorNames"><value>countingBeforeAdvice,adamTargetSource</value></property>
<property name="targetSource"><ref bean="eveTargetSource"/></property>
</bean>
<!-- but this is also possible -->
<bean id="arbitraryTarget"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<!-- this is the one used and NOT the one set by targetSource -->
<property name="interceptorNames"><value>adam</value></property>
<property name="targetSource"><ref bean="eveTargetSource"/></property>
</bean>
</beans>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- Simple target -->
<bean id="test" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>custom</value></property>
<property name="age"><value>666</value></property>
</bean>
<bean id="debugInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor">
</bean>
<bean id="frozen"
class="org.springframework.aop.framework.ProxyFactoryBean"
>
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="target"><ref bean="test"/></property>
<property name="interceptorNames"><value>debugInterceptor</value></property>
<property name="frozen"><value>true</value></property>
<property name="optimize"><value>true</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Test that inner bean for target means that we can use
autowire without ambiguity from target and proxy.
$Id: innerBeanTarget.xml,v 1.4 2006/08/20 19:08:40 jhoeller Exp $
-->
<beans>
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor">
</bean>
<bean id="testBean"
class="org.springframework.aop.framework.ProxyFactoryBean"
>
<property name="target">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>innerBeanTarget</value></property>
</bean>
</property>
<property name="interceptorNames">
<value>nopInterceptor</value>
</property>
</bean>
<!--
Autowire would fail if distinct target and proxy:
we expect just to have proxy
-->
<bean id="autowireCheck"
class="org.springframework.aop.framework.ProxyFactoryBeanTests$DependsOnITestBean"
autowire="constructor" />
</beans>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- Same effect as noInterceptor names: also invalid -->
<bean id="emptyInterceptorNames" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="interceptorNames"><value></value></property>
</bean>
<!--
Invalid test for global pointcuts.
Must have target after *.
-->
<bean id="globalsWithoutTarget" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="interceptorNames"><value>global*</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Tests for misconfiguring the proxy factory bean using a target source in the
interceptor list as well as set by the targetSource property
-->
<beans>
<bean id="adam" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Adam</value></property>
</bean>
<bean id="countingBeforeAdvice"
class="org.springframework.tests.aop.advice.CountingBeforeAdvice"
/>
<!--
An error, as the target source or non-advice object
must be last
-->
<bean id="targetSourceNotLast"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<!-- this is the one used and NOT the one set by targetSource -->
<property name="interceptorNames"><value>adam,countingBeforeAdvice</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Tests for independent prototype behavior.
-->
<beans>
<!-- Simple target -->
<bean id="test" class="org.springframework.tests.sample.beans.SideEffectBean">
<property name="count"><value>10</value></property>
</bean>
<bean id="prototypeTarget" class="org.springframework.tests.sample.beans.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property>
</bean>
<bean id="debugInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="singleton" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>debugInterceptor,test</value></property>
</bean>
<bean id="prototype" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>debugInterceptor,prototypeTarget</value></property>
<property name="singleton"><value>false</value></property>
</bean>
<bean id="cglibPrototype"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>debugInterceptor,prototypeTarget</value></property>
<property name="singleton"><value>false</value></property>
<!-- Force the use of CGLIB -->
<property name="proxyTargetClass"><value>true</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Tests for independent prototype behaviour.
-->
<beans>
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="serializableNopInterceptor" class="org.springframework.tests.aop.interceptor.SerializableNopInterceptor"/>
<bean id="serializableSingleton" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>serializableNopInterceptor</value></property>
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.Person</value></property>
<property name="target">
<bean class="org.springframework.tests.sample.beans.SerializablePerson">
<property name="name"><value>serializableSingleton</value></property>
</bean>
</property>
</bean>
<bean id="prototypeTarget" class="org.springframework.tests.sample.beans.SerializablePerson">
<property name="name"><value>serializablePrototype</value></property>
</bean>
<bean id="serializablePrototype" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>serializableNopInterceptor,prototypeTarget</value></property>
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.Person</value></property>
<property name="singleton"><value>false</value></property>
</bean>
<bean id="interceptorNotSerializableSingleton" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>nopInterceptor</value></property>
<property name="target">
<bean class="org.springframework.tests.sample.beans.SerializablePerson"/>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Tests for independent prototype behaviour.
-->
<beans>
<!-- Simple target -->
<bean id="target" class="org.springframework.tests.sample.beans.TestBean">
<!-- initial value :-) -->
<property name="name"><value>Adam</value></property>
</bean>
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor">
</bean>
<bean id="countingBeforeAdvice"
class="org.springframework.tests.aop.advice.CountingBeforeAdvice"
/>
<!--
Note that there's normally no reason to create objects of this type
in a BeanFactory. If for some strange reason you want to, use Type 3 IoC.
-->
<bean id="targetSource" class="org.springframework.aop.target.SingletonTargetSource">
<constructor-arg><ref bean="target"/></constructor-arg>
</bean>
<bean id="directTarget"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames" value="countingBeforeAdvice,nopInterceptor,target"/>
<property name="proxyTargetClass" value="true"/>
</bean>
<bean id="viaTargetSource"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames"><value>nopInterceptor,targetSource</value></property>
<property name="proxyTargetClass" value="true"/>
</bean>
<bean id ="unsupportedInterceptor"
class="org.springframework.aop.framework.UnsupportedInterceptor"
/>
<!--
No target or target source, just the interceptor
-->
<bean id="noTarget"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="interceptorNames"><value>nopInterceptor,unsupportedInterceptor</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Tests for throws advice.
$Id: throwsAdvice.xml,v 1.6 2006/08/20 19:08:40 jhoeller Exp $
-->
<beans>
<!-- Simple target -->
<bean id="target" class="org.springframework.aop.framework.Echo"/>
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="countingBeforeAdvice" class="org.springframework.tests.aop.advice.CountingBeforeAdvice" />
<bean id="throwsAdvice" class="org.springframework.tests.aop.advice.MyThrowsHandler"/>
<bean id="throwsAdvised" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames">
<value>countingBeforeAdvice,nopInterceptor,throwsAdvice,target</value>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="testBeanTarget" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="simpleBeforeAdvice" class="org.springframework.aop.framework.adapter.SimpleBeforeAdviceImpl"/>
<bean id="simpleBeforeAdviceAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
<constructor-arg><ref bean="simpleBeforeAdvice"/></constructor-arg>
</bean>
<bean id="testBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="interceptorNames"><value>simpleBeforeAdviceAdvisor,testBeanTarget</value></property>
</bean>
<bean id="testAdvisorAdapter" class="org.springframework.aop.framework.adapter.SimpleBeforeAdviceAdapter"/>
<bean id="adapterRegistrationManager" class="org.springframework.aop.framework.adapter.AdvisorAdapterRegistrationManager"/>
</beans>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="testBeanTarget" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="simpleBeforeAdvice" class="org.springframework.aop.framework.adapter.SimpleBeforeAdviceImpl"/>
<bean id="simpleBeforeAdviceAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
<constructor-arg><ref bean="simpleBeforeAdvice"/></constructor-arg>
</bean>
<bean id="testBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
<property name="interceptorNames"><value>simpleBeforeAdviceAdvisor,testBeanTarget</value></property>
</bean>
<bean id="testAdvisorAdapter" class="org.springframework.aop.framework.adapter.SimpleBeforeAdviceAdapter"/>
</beans>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Shows common interceptor along with advisor.
-->
<beans>
<description>
Matches all Advisors in the factory: we don't use a prefix
</description>
<bean id="aapc" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
<!-- This common interceptor will be applied always, before custom lockable advisor -->
<property name="interceptorNames">
<value>nopInterceptor</value>
</property>
</bean>
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="pointcutAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
<property name="pointcut">
<bean class="org.springframework.aop.support.NameMatchMethodPointcut">
<property name="mappedName" value="doSomething"/>
</bean>
</property>
<property name="advice">
<bean class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
</property>
</bean>
<!-- Stateful mixin. Will apply to all objects. Note that singleton property is false. -->
<bean id="lockableAdvisor" class="test.mixin.LockMixinAdvisor" scope="prototype"/>
<bean id="test1" class="org.springframework.tests.sample.beans.TestBean">
<property name="age" value="4"/>
</bean>
<bean id="test2" class="org.springframework.tests.sample.beans.TestBean">
<property name="age" value="4"/>
</bean>
<bean id="packageVisibleMethod" class="org.springframework.aop.framework.autoproxy.PackageVisibleMethod"/>
</beans>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="autoproxy" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
<property name="customTargetSourceCreators">
<list>
<bean class="org.springframework.aop.framework.autoproxy.SelectivePrototypeTargetSourceCreator"/>
<bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator"/>
</list>
</property>
</bean>
<bean id="test" scope="prototype" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
<bean id="prototypeTest" class="org.springframework.tests.sample.beans.CountingTestBean">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
<bean id="lazyInitTest" class="org.springframework.tests.sample.beans.CountingTestBean" lazy-init="true">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
<bean id="wife" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Kerry</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="optimizedTestBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Optimized"/>
</bean>
<bean id="countingAdvice" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="advisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice" ref="countingAdvice"/>
<property name="patterns">
<list>
<value>.*beans.I?TestBean.*</value>
</list>
</property>
</bean>
<bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
<property name="optimize" value="true"/>
</bean>
</beans>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="aapc" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
<property name="customTargetSourceCreators">
<list>
<ref bean="aapc.quickTargetSourceCreator"/>
</list>
</property>
</bean>
<bean id="aapc.quickTargetSourceCreator"
class="org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator"/>
<bean id="test" scope="prototype" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
<bean id="wife" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Kerry</value></property>
</bean>
<!-- Prefix means it will be pooled -->
<bean id=":test" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
<!-- Prefix means it will be thread local -->
<bean name="%test" scope="prototype" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
<!-- Prefix means it will be a prototype target source -->
<bean name="!test" scope="prototype" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Rod</value></property>
<property name="spouse"><ref bean="wife"/></property>
</bean>
</beans>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames" value="*"/>
<property name="proxyTargetClass" value="true"/>
<property name="interceptorNames" value="checker"/>
</bean>
<bean id="checker" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<bean class="org.springframework.aop.framework.autoproxy.NullChecker"/>
</property>
<property name="patterns">
<bean class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<value>.*\.set[a-zA-Z]*(.*)</value>
</list>
</property>
</bean>
</property>
</bean>
<bean id="bean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="frozenProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames" value="frozenBean"/>
<property name="frozen" value="true"/>
<property name="interceptorNames" value="nopInterceptor"/>
</bean>
<bean id="_jdkBeanNameProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<description>
Automatically proxies using JDK dynamic proxies
</description>
<property name="beanNames"><value>jdk*,onlyJdk,doubleJdk</value></property>
<property name="interceptorNames">
<list>
<value>nopInterceptor</value>
</list>
</property>
</bean>
<bean id="doubleJdkBeanNameProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames" value="doubleJdk"/>
<property name="interceptorNames" value="nopInterceptor"/>
</bean>
<bean id="_cglibBeanNameProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<value>
cglib*
</value>
</property>
<property name="proxyTargetClass">
<description>Use the inherited ProxyConfig property to force CGLIB proxying</description>
<value>true</value>
</property>
<property name="interceptorNames">
<description>Interceptors and Advisors to apply automatically</description>
<list>
<value>nopInterceptor</value>
<value>countingBeforeAdvice</value>
</list>
</property>
</bean>
<bean id="introductionBeanNameProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<description>
Illustrates a JDK introduction
</description>
<property name="beanNames"><value>*introductionUsingJdk</value></property>
<property name="interceptorNames">
<list>
<value>introductionNopInterceptor</value>
<value>timestampIntroduction</value>
<value>lockableAdvisor</value>
</list>
</property>
</bean>
<bean id="timestampIntroduction" class="org.springframework.tests.aop.advice.TimestampIntroductionAdvisor"/>
<!--
Stateful mixin. Note that singleton property is false.
-->
<bean id="lockableAdvisor" class="test.mixin.LockMixinAdvisor"
scope="prototype"/>
<bean id="countingBeforeAdvice" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="introductionNopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
<bean id="introductionUsingJdk" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>introductionUsingJdk</value></property>
</bean>
<bean id="second-introductionUsingJdk" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>second-introductionUsingJdk</value></property>
</bean>
<!--
Lazy only because it breaks other tests until this test is fixed
-->
<bean id="factory-introductionUsingJdk" class="org.springframework.aop.framework.autoproxy.CreatesTestBean"
lazy-init="true">
</bean>
<bean id="jdk1" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>jdk1</value></property>
</bean>
<bean id="frozen" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="frozenBean"/>
</bean>
<alias name="frozen" alias="frozenBean"/>
<bean id="cglib1" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>cglib1</value></property>
</bean>
<bean id="onlyJdk" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>onlyJdk</value></property>
</bean>
<bean id="doubleJdk" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>doubleJdk</value></property>
</bean>
<bean id="noproxy" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>noproxy</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="scopedList" class="java.util.ArrayList" scope="request">
<aop:scoped-proxy/>
</bean>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="friends" ref="scopedList"/>
</bean>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="singletonMap" class="java.util.Collections" factory-method="singletonMap" scope="prototype">
<aop:scoped-proxy/>
<constructor-arg value="test"/>
<constructor-arg value="1234"/>
</bean>
<bean id="synchronizedMap" class="java.util.Collections" factory-method="synchronizedMap" scope="singleton">
<constructor-arg ref="singletonParams"/>
</bean>
<bean id="simpleMap" class="java.util.HashMap" scope="prototype">
<aop:scoped-proxy/>
</bean>
</beans>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean" scope="request">
<aop:scoped-proxy proxy-target-class="false"/>
<property name="age" value="99"/>
</bean>
<bean class="org.springframework.beans.factory.config.PropertyOverrideConfigurer">
<property name="properties">
<map>
<entry key="testBean.sex" value="male"/>
</map>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="testBeanTarget" class="org.springframework.tests.sample.beans.TestBean" scope="request"/>
<bean id="testBean" class="org.springframework.aop.scope.ScopedProxyFactoryBean">
<property name="targetBeanName" value="testBeanTarget"/>
<property name="proxyTargetClass" value="false"/>
</bean>
</beans>