SpringX 1.2.0 released!
SpringX on Google Code
springx-1.2.0-all.zip
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.
Change log
1. 更改了 1.1 版之前一个不合理设计。
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);
2. 简化 AOP AutoProxyCreator 配置
增加了一个 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>