applicationContext.xml

来源:互联网 发布:unity3d导出fbx插件 编辑:程序博客网 时间:2024/05/19 06:38
<pre name="code" class="html"><?xml version="1.0" encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xmlns:cache="http://www.springframework.org/schema/cache"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.2.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsdhttp://www.springframework.org/schema/cache     http://www.springframework.org/schema/cache/spring-cache-3.2.xsdhttp://www.springframework.org/schema/context      http://www.springframework.org/schema/context/spring-context-3.2.xsd"><!-- 加载jdbc配置文件 --><bean id="configBean" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list><value>classpath:jdbc.properties</value><value>classpath:sysConfig.properties</value></list></property>    </bean><!-- 数据源 --><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"><!-- 驱动 --><property name="driverClassName" value="${driverClassName}"/><!-- URL --><property name="url" value="${url}"/><!-- 用户名 --><property name="username" value="${username}"/><!-- 密码 --><property name="password" value="${password}"/><!-- 连接池的初始大小 --><property name="initialSize" value="${initialSize}" /><!-- 最大连接数 --><property name="maxActive" value="${maxActive}" /><!-- 最大空闲连接数 --><property name="maxIdle" value="${maxIdle}" /><!-- 最小空闲连接数 --><property name="minIdle" value="${minIdle}" /><!-- 超时等待时间(以毫秒为单位) --><property name="maxWait" value="${maxWait}" /><!-- 在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位.  -->          <property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}" />          <!-- 检查空闲连接的时间间隔 -->          <property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}" /> </bean><!-- 扫描包,controller不扫描 --><context:component-scan base-package="com.dg11185.ipost"><context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/></context:component-scan><!-- 缓存配置 --><aop:aspectj-autoproxy proxy-target-class="true"/>  <cache:annotation-driven cache-manager="cacheManager"/><bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"><property name="configLocation" value="classpath:ehcache.xml"></property></bean><bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"><property name="cacheManager" ref="cacheManagerFactory"></property></bean><!-- 事务 --><!-- 事务配置 --><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name="dataSource" ref="dataSource"/></bean><tx:advice id="tx" transaction-manager="transactionManager"><tx:attributes><tx:method name="add*" propagation="REQUIRED" /><tx:method name="insert*" propagation="REQUIRED" /><tx:method name="save*" propagation="REQUIRED" /><tx:method name="delete*" propagation="REQUIRED" /><tx:method name="remove*" propagation="REQUIRED" /><tx:method name="update*" propagation="REQUIRED" /><tx:method name="get*" propagation="NOT_SUPPORTED"/><tx:method name="load*" propagation="NOT_SUPPORTED"/><tx:method name="find*" propagation="NOT_SUPPORTED" /><tx:method name="*" propagation="NOT_SUPPORTED"/></tx:attributes></tx:advice><aop:config><aop:pointcut id="pt" expression="execution(* com.dg11185.ipost.service..*.*(..))"/><aop:advisor advice-ref="tx" pointcut-ref="pt"/></aop:config> <!-- 邮件发送 -->  <bean id="sender" class="org.springframework.mail.javamail.JavaMailSenderImpl"><property name="host" value="smtp.exmail.qq.com"></property><property name="javaMailProperties"><props><prop key="mail.smtp.auth">true</prop><prop key="mail.smtp.timeout">25000</prop></props></property><property name="username" value="${business_mail_username}"></property><property name="password" value="${business_mail_pwd}"></property></bean> <!-- 图片上传 --><bean id="stageImage" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">            <property name="serviceUrl" value="rmi://${stageUrl}:1200/imageService" />           <property name="serviceInterface" value="com.dg11185.ipost.common.StageImage" />        <property name="lookupStubOnStartup" value="false"/>           <property name="refreshStubOnConnectFailure" value="true"/>          <property name="cacheStub" value="false"/>       </bean></beans>
jdbc.properties
username=ipostpassword=ipostdriverClassName=oracle.jdbc.driver.OracleDriverurl=jdbc\:oracle\:thin\:@10.196.128.156\:1521\:orclinitialSize=10maxIdle=10minIdle=5maxActive=20maxWait=10000timeBetweenEvictionRunsMillis=180000minEvictableIdleTimeMillis=180000


	
				
		
原创粉丝点击