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

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

View File

@@ -7,11 +7,11 @@
<beans>
<!-- 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>
</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>
</bean>

View File

@@ -1,40 +0,0 @@
/*
* Copyright 2002-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.interceptor;
/**
* Bean that changes state on a business invocation, so that
* we can check whether it's been invoked
* @author Rod Johnson
*/
public class SideEffectBean {
private int count;
public void setCount(int count) {
this.count = count;
}
public int getCount() {
return this.count;
}
public void doWork() {
++count;
}
}

View File

@@ -25,7 +25,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.interceptor.SideEffectBean;
import org.springframework.beans.Person;
import org.springframework.beans.SerializablePerson;
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.util.SerializationTestUtils;
import common.beans.core.SideEffectBean;
/**
* Tests for pooling invoker interceptor.
* TODO: need to make these tests stronger: it's hard to

View File

@@ -3,7 +3,7 @@
<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>
</bean>