xml配置
<bean name="scheduler" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="syncJobDock" />
</list>
</property>
</bean>
<bean id="syncJobDock" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="syncJobDetail"></property>
<property name="cronExpression">
<value>0 53 17 * * ?</value>
</property>
</bean>
<bean id="syncJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="onkey" />
</property>
<property name="targetMethod">
<value>executeInternal</value>
</property>
</bean>
<bean id ="onkey" class="com.xxx"></bean>
定时器任务类
public class XXX{
private static final Logger LOG = Logger.getLogger(XXX.class);
/**
* 要调度的具体任务
*/
protected void executeInternal(){
LOG.info("定时任务执行开始…");
LOG.info("定时任务执行结束…");
}
}