1:依赖的jar包
<!-- spring 定时器所依赖的jar包 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
2:配置文件信息
<?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:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- ==============INST每日黑名单数据导出Begin====================== -->
<!-- RDM黑名单即时同步到INST -->
<bean id="quart" class="com.creditease.beehive.employ.controller.EmployController">
</bean>
<bean id="blackDataJobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" >
<!-- 调用的类 -->
<property name="targetObject">
<ref bean="quart"/>
</property>
<!-- 调用类中的方法 -->
<property name="targetMethod" >
<value>Starts</value>
</property>
</bean>
<!-- 触发时间 -->
<bean id="blackDataDoTime" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="blackDataJobtask"/>
</property>
<!-- cron 表达式 -->
<property name="cronExpression">
<value>0 0/1 * * * ?</value>
</property>
</bean>
<bean id="sfb" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="blackDataDoTime"/> //定时任务列表
</list>
</property>
</bean>
</beans>