1、InvoiceTaskJob,有一个invoiceTaskMothed (自定义)方法;
<bean id="invoiceTaskJob" class="com.feifei.bin.InvoiceTaskJob"></bean>
2、定义一个Quartz工作类
<bean id="invoiceTaskState" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="invoiceTaskJob"/>
<property name="targetMethod" value="invoiceTaskMothed"/>
<property name="concurrent" value="false"/>
</bean>
concurrent-->同时发生的
3、调度一个cron工作
<bean id="cronInvoiceTaskState" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="invoiceTaskState"/>
<property name="cronExpression" value="0 0 0/2 * * ? ">
<property name="jobDataAsMap">
<map>
<entry key="jobName" value="说明" />
</map>
</property>
</bean>
cronExpression--->0 0 0/2 * * ? 2小时执行一次
4、启动工作
<bean id="invoiceScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronInvoiceTaskJobGO" /> //另外一个 job
<ref bean="cronInvoiceTaskState" />
</list>
</property>
</bean>