SpringX 1.2.0 released!

[b]SpringX 1.2.0 released! [/b]

[url=http://code.google.com/p/bamboo-spring-ext/]SpringX on Google Code[/url]
[url=http://bamboo-spring-ext.googlecode.com/files/springx-1.2.0-all.zip]springx-1.2.0-all.zip[/url]

[b]Framework Aim:

* Eliminate business bean XML config.
* Eliminate business bean Java annotation.
* Easier than <context:component-scan/>, because of no annotation need.
* Integrate legacy application written in Java without any new development.

Feature List:

* . Dinamyical Bean Register and autowire; (v1.0.0)
* . Strong type bean creation;
* . Compatible with spring standard usage;
* . Interface Injection, wildcard surrport. (v1.1.1)
* . Supporting delegate to existing applicationContext. (v1.2.0)
* . Much simpler AutoProxyCreator? config bean for AOP.
[/b]

[b]Change log [/b]
[b]1. 更改了 1.1 版之前一个不合理设计。[/b]
1.1.x 及之前的版本 只能使用 static 方法BeanFactory.createBean , 因为原来考虑只读取默认的一个 applicationContext.xml 文件;

现很多项目需要读取多个配置文件,或者现有系统已经有 spring applicationContext 实例封装,需要进行无缝集成。新的 BeanFactory 可以使用如下方式委托到一个已存在的 context:
   ApplicationContext applicationContext = new ClassPathXmlApplicationContext( "applicationContext.xml" );
BeanFactory beanFactory = BeanFactory.wrapApplicationContext( applicationContext );
OrderService orderService = (OrderService) beanFactory.createBean(OrderService.class);


[b]2. 简化 AOP AutoProxyCreator 配置 [/b]
增加了一个 SimpleNameMatchAutoProxyCreator.
Spring 官方 2.x 版, 需要使用 org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator, org.springframework.aop.support.NameMatchMethodPointcutAdvisor 两个类才能完成对className + methodName 的AOP 拦截配置, 例如: 以下配置对 *Service类的 create* 等方法使用 log AOP 通知器。

	<bean id="logMethodPointcutAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
<property name="mappedNames">
<list>
<value>create*</value>
<value>delete*</value>
</list>
</property>
<property name="advice">
<ref local="logAdvisor" />
</property>
</bean>

<bean id="BOAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="proxyTargetClass" value="true"></property>
<property name="beanNames">
<list>
<value>*Service</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>logMethodPointcutAdvisor</value>
</list>
</property>
</bean>



SpringX 中配置更为简单, 一个配置即能完成 className + methodName 的AOP 拦截配置:
 <bean id="ServiceSimpleNameMatchAutoProxyCreator" class="org.bamboo.springx.aop.autoproxy.SimpleNameMatchAutoProxyCreator" >
<property name="proxyTargetClass" value="true"></property>
<property name="beanNameAndMethodNames">
<list>
<value>*Service,delete*</value>
<value>*Service,find*</value>
<value>*Service,create*</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>logAdvisor</value>
</list>
</property>
</bean>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值