读书人

Spring 配备之 PropertyPlaceholderCo

发布时间: 2012-07-02 17:46:22 作者: rapoo

Spring 配置之 PropertyPlaceholderConfigurer

<!-- ============= GENERAL DEFINITIONS ============= -->

<!-- Configurer that replaces ${...} placeholders with values from a properties file -->

<!-- (in this case, JDBC-related settings for the dataSource definition below) -->

<bean id="propertyConfigurer"

value="classpath:ibatis/sql-map-config.xml" />

? ? ? ? ?<property name="dataSource" ref="dataSource"></property>

? ? </bean>

? ? <bean id="transactionManager" ref="dataSource"></property>

? ? </bean>

? ? <bean id="transactionIterceptor" ref="transactionManager"></property>

? ? ?<property name="transactionAttributes">

? ? ? <props>

? ? ? ?<prop key="insert*">PROPAGATION_REQUIRED</prop>

? ? ? ?<prop key="add*">PROPAGATION_REQUIRED</prop>

? ? ? ?<prop key="find*,get*">PROPAGATION_REQUIRED,readOnly</prop>

? ? ? ?<prop key="*">PROPAGATION_REQUIRED</prop>

? ? ? </props>

? ? ?</property>

? ? </bean>

? ? <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">

? ? ?<property name="beanNames">

? ? ? <list>

? ? ? ?<value>*Service</value>

? ? ? </list>

? ? ?</property>

? ? ?<property name="interceptorNames">

? ? ? <list>

? ? ? ?<value>transactionIterceptor</value>

? ? ? </list>

? ? ?</property>

? ? </bean>

</beans>

读书人网 >软件架构设计

热点推荐