81,092
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation">
<value>classpath:com/danlong/common/config/ehcache.xml</value>
</property>
</bean>
<bean id="methodCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager">
<ref local="cacheManager"/>
</property>
<property name="cacheName">
<value>person.danlong.METHOD_CACHE</value>
</property>
</bean>
<bean id="methodCacheInterceptor" class="com.danlong.common.interceptor.MethodCacheInterceptor">
<property name="cache">
<ref local="methodCache" />
</property>
</bean>
<bean id="methodCachePointCut" abstract="true" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref local="methodCacheInterceptor"/>
</property>
<!-- property name="pattern">
<value>.*findMenuRepository</value>
</property-->
</bean>
<!-- JNDI DataSource for J2EE environments -->
<bean id="jndiDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>java:comp/env/jdbc/oracle</value></property>
</bean>
<bean id="dataSource" class="com.danlong.common.database.DelegatedDataSource">
<property name="dataSource">
<ref local="jndiDataSource"/>
</property>
</bean>
<bean name="initialEnvironment" class="com.danlong.common.support.InitialEnvironment" parent="/myarea/userManager">
<property name="production"><value>false</value></property>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="com.danlong.common.support.HibernateHelpSessionFactoryBean"
depends-on="hibernateMappingFileSetUtil">
<property name="dataSource"><ref bean="dataSource"/></property>
<property name="mappingResources">
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject"><ref local="hibernateMappingFileSetUtil"/></property>
<property name="targetMethod"><value>getLists</value></property>
</bean>
<!--<list>
<value>com/danlong/common/vo/TbOrderStatus.hbm.xml</value>
</list> -->
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<!-- prop key="hibernate.transaction.factory_class">org.springframework.orm.hibernate.LocalTransactionManagerLookup</prop-->
<!-- prop key="hibernate.connection.provider_class">com.strongit.finance.common.database.DatasourceConnectionProvider</prop-->
<prop key="hibernate.query.substitutions">true 1,false 0</prop>
<prop key="hibernate.session_factory_name">hibernate.sessionFactory</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.jdbc.use_streams_for_binary">true</prop>
<prop key="hibernate.jdbc.fetch_size">50</prop>
<prop key="hibernate.jdbc.batch_size">25</prop>
<prop key="hibernate.max_fetch_depth">2</prop>
<prop key="hibernate.show_sql">true</prop>
<!--prop key="hibernate.hbm2ddl.auto">update</prop-->
</props>
</property>
<!-- property name="jtaTransactionManager">
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject"><ref local="transactionManager"/></property>
<property name="targetMethod"><value>getTransactionManager</value></property>
</bean>
</property-->
<property name="jndiName">
<value>jdbc/oracle</value>
</property>
</bean>
<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="optimize">
<value>true</value>
</property>
<property name="proxyTargetClass"><value>true</value></property>
<property name="interceptorNames">
<list>
<value>daoMethodCacheInterceptor</value>
<value>TransactionInterceptor</value>
</list>
</property>
</bean>
<bean id="TransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="daoMethodCacheInterceptor" class="com.danlong.common.interceptor.ThreadMethodCacheInterceptor">
</bean>
<bean id="hibernateMappingFileSetUtil" class="com.danlong.common.util.ListSetUtil">
<property name="prefix">
<value>hibernateMapping</value>
</property>
</bean>
<bean id="daoTemplate" abstract="true" class="com.danlong.common.dao.BaseDAO">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="cache">
<ref local="methodCache" />
</property>
</bean>
<bean id="common.baseDao" class="com.danlong.common.dao.BaseDAO" parent="daoTemplate"></bean>
<bean id="common.baseManager" parent="txProxyTemplate">
<property name="proxyInterfaces">
<list>
<value>com.danlong.common.service.Manager</value>
</list>
</property>
<property name="target">
<ref bean="com.danlong.common.service.imp.BaseManager"/>
</property>
</bean>
<bean id="com.danlong.common.service.imp.BaseManager" class="com.danlong.common.service.imp.BaseManager">
<property name="DAO">
<ref bean="common.baseDao"/>
</property>
</bean>
</beans>
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<value>*Manager</value>
</property>
<property name="interceptorNames">
<list>
<value>TransactionInterceptor</value>
</list>
</property>
</bean>
<bean name="/spot/spotManager" abstract="true">
<property name="spotManager">
<ref bean="spot.spotManager"/>
</property>
</bean>
<bean name="/spotContentAction" class="com.danlong.spot.action.SpotContentAction"
singleton="false" parent="/spot/spotManager">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>/spotContentAction</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>TransactionInterceptor</value>
</list>
</property>
</bean>