<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:oscache="http://www.springmodules.org/schema/oscache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springmodules.org/schema/oscachehttp://www.springmodules.org/schema/cache/springmodules-oscache.xsd">
<!-- pushmarketing.txt URL config -->
<bean id="xInitializing" class="com.lenovo.lps.psb.pushmarketing.common.Initializing"><property name="keyFile" value="YmpweHQudHh0" /></bean>
<!-- 该 BeanPostProcessor 将自动对标注 @Autowired 的 Bean 进行注入 -->
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
<!-- JDBC参数配置 -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="true">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>/WEB-INF/pushmarketing.properties</value>
<value>/WEB-INF/jdbc.properties</value><!--
<value>${jboss.server.config.url}pushmarketing_web/pushmarketing.properties</value>
<value>${jboss.server.config.url}pushmarketing_web/jdbc.properties</value>
--></list>
</property>
</bean>
<!-- DBCP数据源配置
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClass}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="initialSize" value="5" />
<property name="maxActive" value="10" />
<property name="minIdle" value="10" />
<property name="maxIdle" value="10" />
</bean>
-->
<!-- C3P0数据源配置 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClass}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="autoCommitOnClose" value="${jdbc.autoCommitOnClose}" />
<property name="checkoutTimeout" value="${cpool.checkoutTimeout}" />
<property name="initialPoolSize" value="${cpool.minPoolSize}" />
<property name="minPoolSize" value="${cpool.minPoolSize}" />
<property name="maxPoolSize" value="${cpool.maxPoolSize}" />
<property name="maxIdleTime" value="${cpool.maxIdleTime}" />
<property name="acquireIncrement" value="${cpool.acquireIncrement}" />
<property name="maxIdleTimeExcessConnections" value="${cpool.maxIdleTimeExcessConnections}" />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<!-- 配置Hibernate拦截器,自动填充数据的插入、更新时间 -->
<property name="entityInterceptor" ref="entityInterceptor" />
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<value>
<!-- 设置数据库方言 -->
hibernate.dialect=${hibernate.dialect}
<!-- 设置自动创建|更新|验证数据库表结构 -->
hibernate.hbm2ddl.auto=update
<!-- 输出SQL语句到控制台 -->
hibernate.show_sql=${hibernate.show_sql}
<!-- 格式化输出到控制台的SQL语句 -->
hibernate.format_sql=${hibernate.format_sql}
<!-- 是否开启二级缓存 -->
hibernate.cache.use_second_level_cache=false
<!-- 配置二级缓存产品 -->
hibernate.cache.provider_class=org.hibernate.cache.OSCacheProvider
<!-- 是否开启查询缓存 -->
hibernate.cache.use_query_cache=false
<!-- 数据库批量查询数 -->
hibernate.jdbc.fetch_size=50
<!-- 数据库批量更新数 -->
hibernate.jdbc.batch_size=30
</value>
</property>
<property name="annotatedClasses">
<list>
<value>com.lenovo.lps.psb.pushmarketing.entity.TestDevice</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.Area</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.LogConfig</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.Log</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.Admin</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.Role</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.Resource</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.DeviceInfoVO</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.DeviceDimenInfo</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.PushTaskInfo</value>
<value>com.lenovo.lps.psb.pushmarketing.entity.PushTaskFeedback</value>
</list>
</property>
</bean>
<!-- 缓存配置 -->
<oscache:config configLocation="classpath:oscache.properties" id="cacheProvider" />
<oscache:annotations providerId="cacheProvider">
<oscache:caching id="caching" cronExpression="0 1 * * *" refreshPeriod="86400" />
<oscache:flushing id="flushing" />
</oscache:annotations>
<bean id="cacheManager" class="org.springmodules.cache.provider.oscache.OsCacheManagerFactoryBean">
<property name="configLocation" value="classpath:oscache.properties" />
</bean>
<!-- 设置需要进行Spring注解扫描的类包 -->
<context:component-scan base-package="com.lenovo.lps.psb.pushmarketing." />
<!-- 使用AspectJ方式配置AOP -->
<aop:aspectj-autoproxy proxy-target-class="true" />
<aop:config proxy-target-class="true" />
<!-- 使用注解方式定义事务 -->
<tx:annotation-driven proxy-target-class="true" transaction-manager="transactionManager" />
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 配置事务传播特性 -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="get*" read-only="true" />
<tx:method name="load*" read-only="true" />
<tx:method name="find*" read-only="true" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
<!-- 配置哪些类的哪些方法参与事务 -->
<aop:config>
<aop:advisor pointcut="execution(* com.lenovo.lps.psb.pushmarketing.service..*.*(..))" advice-ref="transactionAdvice" />
</aop:config>
<!-- 配置freemarkerManager -->
<bean id="freemarkerManager" class="org.apache.struts2.views.freemarker.FreemarkerManager" />
<!-- 配置JCaptcha验证码功能 -->
<bean id="captchaService" class="com.octo.captcha.service.image.DefaultManageableImageCaptchaService">
<property name="captchaEngine">
<bean class="com.lenovo.lps.psb.pushmarketing.common.JCaptchaEngine" />
</property>
<!-- 验证码过期时间 -->
<property name="minGuarantedStorageDelayInSeconds" value="600" />
</bean>
<!-- 重建索引配置
<bean id="indexBuilder" class="com.lenovo.lps.psb.pushmarketing.common.CompassIndexBuilder">
<property name="compassGps" ref="compassGps" />
<property name="lazyTime" value="30" />
</bean>
-->
<!-- SMTP邮件服务配置 -->
<bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.timeout">25000</prop>
<!-- SSL连接配置 -->
<!--
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.smtp.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
-->
</props>
</property>
</bean>
<!-- SMTP邮件异步发送 -->
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<!-- 核心线程数 -->
<property name="corePoolSize" value="10" />
<!-- 最大线程数 -->
<property name="maxPoolSize" value="50" />
<!-- 最大队列数 -->
<property name="queueCapacity" value="10000" />
<!-- 线程池维护线程所允许的空闲时间 -->
<property name="keepAliveSeconds" value="60" />
</bean>
<!--mq配置定时器任务的调度器
<bean id="dealAuctionTimerFactory" class="org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean">
<property name="scheduledExecutorTasks">
<list>
<ref local="dealAuctionTaskInfo" />
</list>
</property>
</bean>
<bean id="dealAuctionTaskInfo" class="org.springframework.scheduling.concurrent.ScheduledExecutorTask">
<property name="delay">
<value>${Auction.TaskDelay}</value>
</property>
<property name="period">
<value>${Auction.TaskPeriod}</value>
</property>
<property name="runnable">
<ref local="dealAuctionWorker" />
</property>
</bean>
<bean id="dealAuctionWorker" class="com.lenovo.lps.psb.pushmarketing.action.shop.DealAuctionWorkerAction" >
</bean>
-->
<!-- PB缓存 -->
<bean id="deviceStateCache" class="com.lenovo.lps.psb.pb.cache.DeviceStateCache">
<property name="baseCache" ref="psbMemCachedClient" />
<property name="psbCachePreFix" value="PSB." />
<property name="devStateCachePre" value="devInfo_" />
<property name="ttl" value="86400000" />
</bean>
<bean id="pushCntCache" class="com.lenovo.lps.psb.pb.cache.PushCntCache">
<property name="baseCache" ref="psbMemCachedClient" />
<property name="psbCachePreFix" value="PSB." />
<property name="pushcntCachePre" value="pushcnt_sidmsgs" />
</bean>
<bean id="psbMemCachedClient" class="com.lenovo.lps.psb.pb.cache.PSBMemCachedClient">
<constructor-arg>
<value>psb</value>
</constructor-arg>
</bean>
<bean id="memcache" class="com.danga.MemCached.SockIOPool"
factory-method="getInstance" init-method="initialize" destroy-method="shutDown">
<constructor-arg>
<value>psb</value>
</constructor-arg>
<property name="servers">
<list>
<value>${lps.psb.pb.memcached.server1}</value>
<value>${lps.psb.pb.memcached.server2}</value>
</list>
</property>
<property name="initConn">
<value>4</value>
</property>
<property name="minConn">
<value>8</value>
</property>
<property name="maxConn">
<value>20</value>
</property>
<property name="maintSleep">
<value>20</value>
</property>
<property name="nagle">
<value>false</value>
</property>
</bean>
<bean id="jCaptchaFilter" class="com.lenovo.lps.psb.pushmarketing.common.JCaptchaFilter">
<property name="captchaService" ref="captchaService" />
</bean>
<bean id="adminLoginJCaptchaFilter" class="com.lenovo.lps.psb.pushmarketing.common.AdminLoginJCaptchaFilter">
<property name="captchaService" ref="captchaService" />
</bean>
<!--
<bean id="logDao" class="com.lenovo.lps.psb.pushmarketing.dao.impl.LogDaoImpl">
</bean>
<bean id="logService" class="com.lenovo.lps.psb.pushmarketing.service.impl.LogServiceImpl">
</bean>
<bean id="adminService" class="com.lenovo.lps.psb.pushmarketing.service.impl.AdminServiceImpl">
</bean>
<bean id="logConfigService" class="com.lenovo.lps.psb.pushmarketing.service.impl.LogConfigServiceImpl">
</bean>
<bean id="logConfigDao" class="com.lenovo.lps.psb.pushmarketing.dao.impl.LogConfigDaoImpl">
</bean>
-->
<!--
<bean id="systemConfigUtil" class="com.lenovo.lps.psb.pushmarketing.util.SystemConfigUtil" scope="singleton">
<property name="classPath" value="${lps.psb.pm.classPath}" />
</bean>
-->
</beans>
相关推荐
ApplicationContext.xml 配置详解 ApplicationContext.xml 是 Spring 框架中用于配置应用程序的核心配置文件。通过该文件,可以定义 Bean、数据源、Session 工厂、 Hibernate 配置等相关信息,从而实现应用程序的...
ApplicationContext.xml详解 ApplicationContext.xml是Spring框架中的核心配置文件,它是Spring的IOC(Inverse of Control,控制反转)容器的核心组件。该文件用于定义和配置Spring应用程序中的各种Bean,对于...
在Java Web开发中,`struts.xml`, `applicationContext.xml` 和 `web.xml` 是三个至关重要的配置文件,它们各自负责不同的职责,并协同工作来构建一个完整的应用框架。以下是关于这三个配置文件的详细说明。 首先,...
在IT行业中,尤其是在Java Web开发领域,`applicationContext.xml`、`db.properties`、`log4j.properties`以及`spring-mvc.xml`等文件是非常关键的配置文件,它们各自负责不同的功能,对于一个完整的应用程序来说不...
这个压缩包“spring3.0 + Quartz1.52 + applicationContext.xml”显然是一个关于如何在Spring 3.0环境中集成Quartz 1.52版本的示例或教程资源。 首先,`applicationContext.xml`是Spring框架的核心配置文件,它定义...
### SSH框架applicationContext.xml头部文件知识点解析 #### 一、SSH框架简介 SSH框架是Struts+Spring+Hibernate三个开源框架的组合,是中国开发者对这三个框架整合应用的一种简称。其中Struts负责MVC(Model-View-...
在Spring框架中,`applicationContext.xml`是应用上下文的核心配置文件,用于定义bean的创建、依赖关系以及各种服务的配置。这篇博文“Spring 2.5 - applicationContext.xml提示信息的配置”主要探讨了如何在Spring ...
《ApplicationContext.xml——Spring框架的核心配置文件详解》 在Java开发领域,Spring框架是不可或缺的一部分,它以其强大的依赖注入(Dependency Injection,简称DI)和面向切面编程(Aspect-Oriented ...
在SSH的applicationContext.xml 中如何配制配制事务
### Spring的applicationContext.xml文件详解 #### 一、引言 在Java开发领域,Spring框架因其强大的功能和灵活的设计而受到广泛欢迎。其中,`applicationContext.xml`是Spring框架的核心配置文件之一,它用于管理...
spring+jpa的applicationContext.xml配置
3. **applicationContext.xml**:这是Spring的上下文配置文件,主要管理服务层(Service)和数据访问层(DAO)的Bean。包括Bean的定义、依赖注入(DI)、事务管理、AOP(面向切面编程)等配置。 - Bean定义:使用`...
这是一些配置文件,可以作为参考,个人感觉很方便的学习方法