<?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:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:component-scan base-package="com.pingan.haofang.*">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:jdbc_mysql_db.properties</value>
<!-- <value>classpath*:const.properties</value> -->
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
<bean class="com.pingan.haofang.util.WebAppContextUtil"/>
<import resource="classpath*:spring-database_stats.xml"/>
<import resource="classpath*:spring-database_common.xml"/>
<import resource="classpath*:spring-database_loupan.xml"/>
<!-- 计划任务 计算版块平均价格 start-->
<!-- 要调用的工作类 -->
<bean id="refreshRedisTask" class="com.pingan.haofang.service.impl.RefreshRedisServiceImpl"></bean>
<!-- 定义调用对象和调用对象的方法 -->
<bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 调用的类 -->
<property name="targetObject">
<ref bean="refreshRedisTask"/>
</property>
<!-- 调用类中的方法 -->
<property name="targetMethod">
<value>run</value>
</property>
</bean>
<!-- 定义触发时间 -->
<bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="jobtask"/>
</property>
<!-- cron表达式 -->
<property name="cronExpression">
<value>0 30 23 * * ?</value>
<!--每个月最后一天0点开始执行
<value>0 0 0 L * ?</value>
-->
</property>
</bean>
<!-- 计划任务 计算版块平均价格 end-->
<!-- 总管理类 如果将lazy-init='true'那么容器启动就会执行调度程序, false则不会 -->
<bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="doTime"/>
</list>
</property>
</bean>
<!-- 定时器注解使用 -->
<task:annotation-driven/>
</beans>
分享到:
相关推荐
spring4的“所有jar包”+applicationContext.xml+web.xml====全套
包含applicationContext.xml、db.properties、log4j.properties、spring-mvc.xml文件,方便搭建,省去写代码。。
spring-test.jar 用在junit4以上 在类上写 @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"WIN-INF/config/applicationContext.xml" })
Spring applicationContext.xml常见部分属性的使用备注
NULL 博文链接:https://mutourenoo.iteye.com/blog/1156865
用于配置acegi的xml文件,把这个文件加入项目中,然后建立里面的数据库,引入jar包就可以实现权限的管理
详解Spring的applicationContext.xml文件代码:
spring事务与传播行为,通知,数据源,切面,,,,,,,
Jedis是Redis官方推荐的Java连接开发工具。Redis(Remote Dictionary Server ),即远程字典服务,是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API...
Spring[applicationContext.xml]灵活性代理
#资源达人分享计划# spring配置文件信息 可直接复制稍微修改 主要结合博文进行学习
15.2. Importing XML Configuration 16. Auto-configuration 16.1. Gradually Replacing Auto-configuration 16.2. Disabling Specific Auto-configuration Classes 17. Spring Beans and Dependency Injection 18. ...
spring定时任务必须的包和spring配置说明
Spring Boot技术知识点:如何读取不同路径里的applicationContext.xml配置文件4
因为所有的Bean都需要在applicationContext.xml中加载好,之后再通过@Resource去取得。如果每次都要整个业务流做的差不多了再去测试,这样效率很低,也很麻烦。如果单独去写一个测试用类,这样太繁琐了。于是想起...
spring+jpa的applicationContext.xml配置
PentahoEE版 CAS配置文件,配置完成后实现SSO
本篇文章主要介绍了详解spring applicationContext.xml 配置文件 ,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Spring ApplicationContext.xml配置的12个技巧演示教学.pdf
搭建struts2 + spring框架时需要使用的关联jar struts.xml中action的属性class引用applicationContext中bean的属性id指向的值