introducing common.beans.* packaging and externals; experimenting with sharing SideEffectBean

This commit is contained in:
Chris Beams 2008-12-17 23:36:40 +00:00
parent 2be8114c63
commit 08eeb52e57
12 changed files with 21 additions and 15 deletions

View File

@ -24,7 +24,6 @@ import org.junit.Test;
import org.springframework.aop.framework.Advised; import org.springframework.aop.framework.Advised;
import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.interceptor.SerializableNopInterceptor; import org.springframework.aop.interceptor.SerializableNopInterceptor;
import org.springframework.aop.interceptor.SideEffectBean;
import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.beans.Person; import org.springframework.beans.Person;
import org.springframework.beans.SerializablePerson; import org.springframework.beans.SerializablePerson;
@ -32,6 +31,8 @@ import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.util.SerializationTestUtils; import org.springframework.util.SerializationTestUtils;
import common.beans.core.SideEffectBean;
/** /**
* @author Rod Johnson * @author Rod Johnson
* @author Chris Beams * @author Chris Beams

View File

@ -20,11 +20,12 @@ import static org.junit.Assert.assertEquals;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.aop.interceptor.SideEffectBean;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import common.beans.core.SideEffectBean;
/** /**
* @author Rod Johnson * @author Rod Johnson
* @author Chris Beams * @author Chris Beams

View File

@ -20,11 +20,12 @@ import static org.junit.Assert.*;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.aop.interceptor.SideEffectBean;
import org.springframework.beans.ITestBean; import org.springframework.beans.ITestBean;
import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import common.beans.core.SideEffectBean;
/** /**
* @author Rod Johnson * @author Rod Johnson
* @author Chris Beams * @author Chris Beams

View File

@ -4,11 +4,11 @@
<beans> <beans>
<!-- Simple target --> <!-- Simple target -->
<bean id="target1" class="org.springframework.aop.interceptor.SideEffectBean"> <bean id="target1" class="common.beans.core.SideEffectBean">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>
<bean id="target2" class="org.springframework.aop.interceptor.SideEffectBean" scope="singleton"> <bean id="target2" class="common.beans.core.SideEffectBean" scope="singleton">
<property name="count"><value>20</value></property> <property name="count"><value>20</value></property>
</bean> </bean>

View File

@ -4,11 +4,11 @@
<beans> <beans>
<!-- Simple target --> <!-- Simple target -->
<bean id="test" class="org.springframework.aop.interceptor.SideEffectBean"> <bean id="test" class="common.beans.core.SideEffectBean">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>
<bean id="prototypeTest" class="org.springframework.aop.interceptor.SideEffectBean" scope="prototype"> <bean id="prototypeTest" class="common.beans.core.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>

View File

@ -3,7 +3,7 @@
<beans> <beans>
<bean id="prototypeTest" class="org.springframework.aop.interceptor.SideEffectBean" scope="prototype"> <bean id="prototypeTest" class="common.beans.core.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>

View File

@ -67,13 +67,14 @@ import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.ConstructorDependenciesBean; import org.springframework.beans.factory.xml.ConstructorDependenciesBean;
import org.springframework.beans.factory.xml.DependenciesBean; import org.springframework.beans.factory.xml.DependenciesBean;
import org.springframework.beans.factory.xml.SideEffectBean;
import org.springframework.beans.propertyeditors.CustomNumberEditor; import org.springframework.beans.propertyeditors.CustomNumberEditor;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource; import org.springframework.core.io.UrlResource;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import common.beans.core.SideEffectBean;
/** /**
* Tests properties population and autowire behavior. * Tests properties population and autowire behavior.
* *

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.aop.interceptor; package common.beans.core;
/** /**
* Bean that changes state on a business invocation, so that * Bean that changes state on a business invocation, so that

View File

@ -37,7 +37,6 @@ import org.springframework.aop.IntroductionAdvisor;
import org.springframework.aop.IntroductionInterceptor; import org.springframework.aop.IntroductionInterceptor;
import org.springframework.aop.interceptor.DebugInterceptor; import org.springframework.aop.interceptor.DebugInterceptor;
import org.springframework.aop.interceptor.NopInterceptor; import org.springframework.aop.interceptor.NopInterceptor;
import org.springframework.aop.interceptor.SideEffectBean;
import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.AopUtils;
import org.springframework.aop.support.DefaultIntroductionAdvisor; import org.springframework.aop.support.DefaultIntroductionAdvisor;
import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.DefaultPointcutAdvisor;
@ -57,6 +56,8 @@ import org.springframework.context.TestListener;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.util.SerializationTestUtils; import org.springframework.util.SerializationTestUtils;
import common.beans.core.SideEffectBean;
/** /**
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -7,11 +7,11 @@
<beans> <beans>
<!-- Simple target --> <!-- Simple target -->
<bean id="test" class="org.springframework.aop.interceptor.SideEffectBean"> <bean id="test" class="common.beans.core.SideEffectBean">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>
<bean id="prototypeTarget" class="org.springframework.aop.interceptor.SideEffectBean" scope="prototype"> <bean id="prototypeTarget" class="common.beans.core.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>

View File

@ -25,7 +25,6 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.aop.framework.Advised; import org.springframework.aop.framework.Advised;
import org.springframework.aop.interceptor.SideEffectBean;
import org.springframework.beans.Person; import org.springframework.beans.Person;
import org.springframework.beans.SerializablePerson; import org.springframework.beans.SerializablePerson;
import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory;
@ -33,6 +32,8 @@ import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.util.SerializationTestUtils; import org.springframework.util.SerializationTestUtils;
import common.beans.core.SideEffectBean;
/** /**
* Tests for pooling invoker interceptor. * Tests for pooling invoker interceptor.
* TODO: need to make these tests stronger: it's hard to * TODO: need to make these tests stronger: it's hard to

View File

@ -3,7 +3,7 @@
<beans> <beans>
<bean id="prototypeTest" class="org.springframework.aop.interceptor.SideEffectBean" scope="prototype"> <bean id="prototypeTest" class="common.beans.core.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property> <property name="count"><value>10</value></property>
</bean> </bean>