标签:turn eth red target config execution ring method poi
public class TestBeanChild { int b = 1; public TestBean createDefault() { return new TestBeanDefault(); } }
class TestBeanDefault extends TestBean{ int b=2; }
包外面不能访问类TestBeanDefault
public abstract class TestBean { private int a =0; public void doBean(){ System.out.println("1321"); } }
<bean id="a" class="com.yundaex.wms.config.TestBeanChild" /> <bean id="b" class="com.yundaex.wms.config.TestBeanChild" factory-bean="a" factory-method="createDefault" /> <aop:config proxy-target-class="true"> <aop:aspect ref="ifmAspect"> <aop:pointcut id="ifmAspectPointcut" expression="execution( * com.yundaex.wms.config.TestBean.*(..)) "/> <aop:around method="aroundMethod" pointcut-ref="ifmAspectPointcut"/> </aop:aspect> </aop:config>
@Autowired private TestBean dd;
dd为父类实例其实是子类的cglib的代理对象
不可见类有抽象父类,spring配置子类bean,注入父类,aop就可以切父类的方法
标签:turn eth red target config execution ring method poi
原文地址:http://www.cnblogs.com/tonggc1668/p/7498075.html