<property name="jobDetail">
<bean class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="schedule.PushJob"></property>
</bean>
</property>
<property name="cronExpression" value="0-59/1 * * * * ? *" />
</bean>
<!-- 执行实际的调度 -->
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="cronTriggerPay"></ref>
</list>
</property>
</bean>
if (!isRunning)
{
System.out.println(new Date() + "------>定时任务开始");
isRunning = true;
for (int i = 1; i <= 100; i++)
{
System.out.println("作业完成:" + i);
try
{
Thread.sleep(1000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
System.out.println(new Date() + "------>定时任务结束");
}
else
{
System.out.println(new Date() + " 任务结束!");
isRunning = false;
}