自己项目中的proxool和applicationContext.xml写的
2016-09-21 14:51
295 查看
1.proxool.properties
2.applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd"
default-lazy-init="true">
<description>Spring公共配置 </description>
<context:annotation-config />
<!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 不扫描controller -->
<context:component-scan base-package="com.clearpro">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type="annotation"
expression="org.springframework.web.bind.annotation.ControllerAdvice" />
</context:component-scan>
<!-- 属性文件加载配置 -->
<bean id="propertyConfigurer"
class="com.clearpro.common.property.ExtendedPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<!-- <value>classpath:application.properties</value> -->
<value>classpath:proxool.properties</value>
</list>
</property>
</bean>
<!-- hibernate jpa适配器配置 -->
<bean id="hibernateJpaVendorAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform">
<bean factory-method="getDialect"
class="com.clearpro.common.persistence.Hibernates">
<constructor-arg ref="proxoolDataSource" />
</bean>
</property>
</bean>
<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
<property name="dataSource" ref="proxoolDataSource" />
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" />
<property name="packagesToScan" value="com.clearpro.entity" />
<property name="jpaProperties">
<props>
<!-- 命名规则 My_NAME->MyName -->
<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
<prop key="hibernate.show_sql">true</prop>
<!-- <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory -->
<!-- </prop> -->
<!-- <prop key="net.sf.ehcache.configurationResourceName">ehcache-hibernate-local.xml</prop> -->
</props>
</property>
</bean>
<!-- Spring Data Jpa配置 -->
<jpa:repositories base-package="com.clearpro"
transaction-manager-ref="transactionManager"
entity-manager-factory-ref="entityManagerFactory" />
<!-- Jpa 事务配置 -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- 使用annotation定义事务 -->
<!-- <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> -->
<!-- JSR303 Validator定义 -->
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
<!-- 数据源配置, 使用Tomcat JDBC连接池 -->
<!-- <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="maxActive" value="${jdbc.pool.maxActive}" />
<property name="maxIdle" value="${jdbc.pool.maxIdle}" />
<property name="minIdle" value="0" />
<property name="defaultAutoCommit" value="false" />
</bean> -->
<bean id="proxoolDataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource">
<property name="driver" value="${jdbc.driver}" />
<property name="driverUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- 测试的SQL执行语句 -->
<!-- <property name="houseKeepingTestSql" value="${proxool.houseKeepingTestSql}"/> -->
<!-- 最少保持的空闲连接数 (默认2个) -->
<property name="prototypeCount" value="${proxool.prototypeCount}"/>
<!-- proxool自动侦察各个连接状态的时间间隔(毫秒),侦察到空闲的连接就马上回收,超时的销毁 默认30秒) -->
<property name="houseKeepingSleepTime" value="${proxool.hourseKeepingSleepTime}"/>
<!-- 最大活动时间(超过此时间线程将被kill,默认为5分钟) -->
<property name="maximumActiveTime" value="${proxool.maximumActiveTime}"/>
<!-- 连接最长时间(默认为4个小时) -->
<property name="maximumConnectionLifetime" value="${proxool.maximumConnectionLifetime}"/>
<!-- 最小连接数 (默认2个) -->
<property name="minimumConnectionCount" value="${proxool.minimumConnectionCount}"/>
<!-- 最大连接数 (默认5个) -->
<property name="maximumConnectionCount" value="${proxool.maximumConnectionCount}"/>
<!--
<property name="statistics" value="${proxool.statistics}"/>-->
<!-- 别名 -->
<property name="alias" value="${proxool.alias}"/>
<!-- -->
<property name="simultaneousBuildThrottle" value="${proxool.simultaneous-build-throttle}"/>
</bean>
<!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="proxoolDataSource"/>
</bean> -->
<!-- SpringMVC上传文件时,需配置MultipartResolver处理器 -->
<bean id="multipartResolver" class="com.clearpro.common.web.CustomMultipartResolver">
<!-- 指定所上传文件的总大小不能超过800KB......注意maxUploadSize属性的限制不是针对单个文件,而是所有文件的容量之和 -->
<property name="maxUploadSize" value="1000000000" />
</bean>
</beans>
jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://192.168.1.116:3306/clearpro jdbc.username=root jdbc.password=123456 proxool.prototypeCount=2 proxool.hourseKeepingSleepTime=30 proxool.maximumActiveTime=30 proxool.maximumConnectionLifetime=3000 proxool.minimumConnectionCount=2 proxool.maximumConnectionCount=40 proxool.alias=clearpro proxool.simultaneous-build-throttle=20 default.domain = http://oa.hechuanggroup.com #default new user password user.pwd = hcxy123456 user.pwd.sms = \u60A8\u5DF2\u91CD\u7F6E\u4E86\u5408\u521B\u5185\u7F51\u529E\u516C\u7CFB\u7EDF\u5E10\u53F7,\u65B0\u5BC6\u7801\u4E3A{\u5B57\u7B26}.\u3010\u5408\u521B\u5174\u4E1A\u3011 #system upload #resource = D:/resource/ resource = /home/oa/resource/ #mail setting mail.enable = true mail.domain = hechuanggroup.com mail.imap = 192.168.0.31 mail.smtp =192.168.0.31 #mail.attachmentdir = D:/users/ mail.attachmentdir = /home/oa/temp/ mail.maxfilesize = 10485760 #solr config solr_server = http://127.0.0.1:8983/solr #search highlight show pre_tag = <font color="red"> post_tag = </font> #search highlight show private_root = /home/oa/document/private/ public_root = /home/oa/document/public/ pdf2swf_path = /home/oa/tools/swftools/bin/pdf2swf OpenOffice_port = 8100 pdf_language = /home/oa/tools/xpdf-chinese-simplified # 7niu 7niu.accesskey = dnNGXbFGN3-a3ckP8g7KrEt2o8XD833WswMjaevO 7niu.secretkey = h1N4PPnPe03lR8tsff3DhwLN673xRidhOJa50caa 7niu.bucket = lvtutu 7niu.host = http://7xlvx5.com1.z0.glb.clouddn.com
2.applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd"
default-lazy-init="true">
<description>Spring公共配置 </description>
<context:annotation-config />
<!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 不扫描controller -->
<context:component-scan base-package="com.clearpro">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type="annotation"
expression="org.springframework.web.bind.annotation.ControllerAdvice" />
</context:component-scan>
<!-- 属性文件加载配置 -->
<bean id="propertyConfigurer"
class="com.clearpro.common.property.ExtendedPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<!-- <value>classpath:application.properties</value> -->
<value>classpath:proxool.properties</value>
</list>
</property>
</bean>
<!-- hibernate jpa适配器配置 -->
<bean id="hibernateJpaVendorAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform">
<bean factory-method="getDialect"
class="com.clearpro.common.persistence.Hibernates">
<constructor-arg ref="proxoolDataSource" />
</bean>
</property>
</bean>
<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
<property name="dataSource" ref="proxoolDataSource" />
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" />
<property name="packagesToScan" value="com.clearpro.entity" />
<property name="jpaProperties">
<props>
<!-- 命名规则 My_NAME->MyName -->
<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
<prop key="hibernate.show_sql">true</prop>
<!-- <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory -->
<!-- </prop> -->
<!-- <prop key="net.sf.ehcache.configurationResourceName">ehcache-hibernate-local.xml</prop> -->
</props>
</property>
</bean>
<!-- Spring Data Jpa配置 -->
<jpa:repositories base-package="com.clearpro"
transaction-manager-ref="transactionManager"
entity-manager-factory-ref="entityManagerFactory" />
<!-- Jpa 事务配置 -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- 使用annotation定义事务 -->
<!-- <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> -->
<!-- JSR303 Validator定义 -->
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
<!-- 数据源配置, 使用Tomcat JDBC连接池 -->
<!-- <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="maxActive" value="${jdbc.pool.maxActive}" />
<property name="maxIdle" value="${jdbc.pool.maxIdle}" />
<property name="minIdle" value="0" />
<property name="defaultAutoCommit" value="false" />
</bean> -->
<bean id="proxoolDataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource">
<property name="driver" value="${jdbc.driver}" />
<property name="driverUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- 测试的SQL执行语句 -->
<!-- <property name="houseKeepingTestSql" value="${proxool.houseKeepingTestSql}"/> -->
<!-- 最少保持的空闲连接数 (默认2个) -->
<property name="prototypeCount" value="${proxool.prototypeCount}"/>
<!-- proxool自动侦察各个连接状态的时间间隔(毫秒),侦察到空闲的连接就马上回收,超时的销毁 默认30秒) -->
<property name="houseKeepingSleepTime" value="${proxool.hourseKeepingSleepTime}"/>
<!-- 最大活动时间(超过此时间线程将被kill,默认为5分钟) -->
<property name="maximumActiveTime" value="${proxool.maximumActiveTime}"/>
<!-- 连接最长时间(默认为4个小时) -->
<property name="maximumConnectionLifetime" value="${proxool.maximumConnectionLifetime}"/>
<!-- 最小连接数 (默认2个) -->
<property name="minimumConnectionCount" value="${proxool.minimumConnectionCount}"/>
<!-- 最大连接数 (默认5个) -->
<property name="maximumConnectionCount" value="${proxool.maximumConnectionCount}"/>
<!--
<property name="statistics" value="${proxool.statistics}"/>-->
<!-- 别名 -->
<property name="alias" value="${proxool.alias}"/>
<!-- -->
<property name="simultaneousBuildThrottle" value="${proxool.simultaneous-build-throttle}"/>
</bean>
<!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="proxoolDataSource"/>
</bean> -->
<!-- SpringMVC上传文件时,需配置MultipartResolver处理器 -->
<bean id="multipartResolver" class="com.clearpro.common.web.CustomMultipartResolver">
<!-- 指定所上传文件的总大小不能超过800KB......注意maxUploadSize属性的限制不是针对单个文件,而是所有文件的容量之和 -->
<property name="maxUploadSize" value="1000000000" />
</bean>
</beans>
相关文章推荐
- 自己的maven项目jar包发布到nexus修改maven/settings.xml
- 浅谈使用xml作为配置文件初始化自己的项目
- iOS 根据自己项目 说说对xml解析的理解
- Maven项目中如何在官网查找自己所需要jar包(或pom.xml)
- 自己正在做电信的互联星空项目,里面用到的xml
- 最近做复旦国际交流学院的一个项目时,使用到了Access,自己写了一个AccessHelper
- 自己写通过repeater嵌套写的一个rss集合器(xml)
- CSDB Blog快速备份程序-备份你自己的Blog 基于xml(转)
- CQ管理-不能登入自己未负责的项目
- 自己都没想到的事情,在SourceForge.net的开源项目竟然通过审核了
- Css-Xml-Xhtml | 为自己的访问者提供一个打印机友好的Web页面
- 修改CSDN Blog的“聚合 | xml”链接为自己烧的feed
- 我想自己做项目
- 终于在visual studio.net 2005 找到了创建 XML Web services 的项目的方法
- [自己项目中的]表单定制的限制
- 经过一个项目原型的制做终于对xml有了比较深的了解。现在开始看CA了
- HTML格式的语法高亮类库代码,内置对C, C++, VBScript, JScript, xml的支持,可扩展,自己添加语法定义。
- 团队自己的开源项目
- 有关jsp+struts+hibernate+MSSQLServer项目中Tomcat5的server.xml配置
- 有关jsp+struts+hibernate+MSSQLServer项目中Tomcat5的server.xml配置