/*
* Copyright 2005 - 2009 Terracotta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
*/ package org.quartz.examples.example7; import java.util.Date; import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.SchedulerMetaData;
import org.quartz.SimpleTrigger;
import org.quartz.TriggerUtils;
import org.quartz.impl.StdSchedulerFactory; import org.slf4j.LoggerFactory;
import org.slf4j.Logger; /**
* Demonstrates the behavior of <code>StatefulJob</code>s, as well as how
* misfire instructions affect the firings of triggers of <code>StatefulJob</code>
* s - when the jobs take longer to execute that the frequency of the trigger's
* repitition.
*
* <p>
* While the example is running, you should note that there are two triggers
* with identical schedules, firing identical jobs. The triggers "want" to fire
* every 3 seconds, but the jobs take 10 seconds to execute. Therefore, by the
* time the jobs complete their execution, the triggers have already "misfired"
* (unless the scheduler's "misfire threshold" has been set to more than 7
* seconds). You should see that one of the jobs has its misfire instruction
* set to <code>SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT</code>-
* which causes it to fire immediately, when the misfire is detected. The other
* trigger uses the default "smart policy" misfire instruction, which causes
* the trigger to advance to its next fire time (skipping those that it has
* missed) - so that it does not refire immediately, but rather at the next
* scheduled time.
* </p>
*
* @author <a href="mailto:bonhamcm@thirdeyeconsulting.com">Chris Bonham</a>
*/
public class InterruptExample { public void run() throws Exception {
final Logger log = LoggerFactory.getLogger(InterruptExample.class); log.info("------- Initializing ----------------------"); // First we must get a reference to a scheduler
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler(); log.info("------- Initialization Complete -----------"); log.info("------- Scheduling Jobs -------------------"); // get a "nice round" time a few seconds in the future...
long ts = TriggerUtils.getNextGivenSecondDate(null, 15).getTime(); JobDetail job = new JobDetail("interruptableJob1", "group1",
DumbInterruptableJob.class);
SimpleTrigger trigger =
new SimpleTrigger("trigger1", "group1",
new Date(ts),
null,
SimpleTrigger.REPEAT_INDEFINITELY,
5000L);
Date ft = sched.scheduleJob(job, trigger);
log.info(job.getFullName() + " will run at: " + ft + " and repeat: "
+ trigger.getRepeatCount() + " times, every "
+ trigger.getRepeatInterval() / 1000 + " seconds"); // start up the scheduler (jobs do not start to fire until
// the scheduler has been started)
sched.start();
log.info("------- Started Scheduler -----------------"); log.info("------- Starting loop to interrupt job every 7 seconds ----------");
for(int i=0; i < 50; i++) {
try {
Thread.sleep(7000L);
// tell the scheduler to interrupt our job
sched.interrupt(job.getName(), job.getGroup());
} catch (Exception e) {
}
} log.info("------- Shutting Down ---------------------"); sched.shutdown(true); log.info("------- Shutdown Complete -----------------");
SchedulerMetaData metaData = sched.getMetaData();
log.info("Executed " + metaData.getNumberOfJobsExecuted() + " jobs."); } public static void main(String[] args) throws Exception { InterruptExample example = new InterruptExample();
example.run();
} }

  

/*
* Copyright 2005 - 2009 Terracotta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
*/ package org.quartz.examples.example7; import java.util.Date; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.quartz.InterruptableJob;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.UnableToInterruptJobException; /**
* <p>
* A dumb implementation of an InterruptableJob, for unittesting purposes.
* </p>
*
* @author <a href="mailto:bonhamcm@thirdeyeconsulting.com">Chris Bonham</a>
* @author Bill Kratzer
*/
public class DumbInterruptableJob implements InterruptableJob { // logging services
private static Logger _log = LoggerFactory.getLogger(DumbInterruptableJob.class); // has the job been interrupted?
private boolean _interrupted = false; // job name
private String _jobName = ""; /**
* <p>
* Empty constructor for job initilization
* </p>
*/
public DumbInterruptableJob() {
} /**
* <p>
* Called by the <code>{@link org.quartz.Scheduler}</code> when a <code>{@link org.quartz.Trigger}</code>
* fires that is associated with the <code>Job</code>.
* </p>
*
* @throws JobExecutionException
* if there is an exception while executing the job.
*/
public void execute(JobExecutionContext context)
throws JobExecutionException { _jobName = context.getJobDetail().getFullName();
_log.info("---- " + _jobName + " executing at " + new Date()); try {
// main job loop... see the JavaDOC for InterruptableJob for discussion...
// do some work... in this example we are 'simulating' work by sleeping... :) for (int i = 0; i < 4; i++) {
try {
Thread.sleep(1000L);
} catch (Exception ignore) {
ignore.printStackTrace();
} // periodically check if we've been interrupted...
if(_interrupted) {
_log.info("--- " + _jobName + " -- Interrupted... bailing out!");
return; // could also choose to throw a JobExecutionException
// if that made for sense based on the particular
// job's responsibilities/behaviors
}
} } finally {
_log.info("---- " + _jobName + " completed at " + new Date());
}
} /**
* <p>
* Called by the <code>{@link Scheduler}</code> when a user
* interrupts the <code>Job</code>.
* </p>
*
* @return void (nothing) if job interrupt is successful.
* @throws JobExecutionException
* if there is an exception while interrupting the job.
*/
public void interrupt() throws UnableToInterruptJobException {
_log.info("---" + " -- INTERRUPTING --");
_interrupted = true;
} }
[INFO] 02 二月 03:42:22.832 下午 main [org.quartz.examples.example7.InterruptExample]
------- Initializing ---------------------- [INFO] 02 二月 03:42:22.856 下午 main [org.quartz.simpl.SimpleThreadPool]
Job execution threads will use class loader of thread: main [INFO] 02 二月 03:42:22.868 下午 main [org.quartz.core.SchedulerSignalerImpl]
Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl [INFO] 02 二月 03:42:22.869 下午 main [org.quartz.core.QuartzScheduler]
Quartz Scheduler v.1.8.5 created. [INFO] 02 二月 03:42:22.870 下午 main [org.quartz.simpl.RAMJobStore]
RAMJobStore initialized. [INFO] 02 二月 03:42:22.871 下午 main [org.quartz.core.QuartzScheduler]
Scheduler meta-data: Quartz Scheduler (v1.8.5) 'DefaultQuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered. [INFO] 02 二月 03:42:22.871 下午 main [org.quartz.impl.StdSchedulerFactory]
Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' [INFO] 02 二月 03:42:22.871 下午 main [org.quartz.impl.StdSchedulerFactory]
Quartz scheduler version: 1.8.5 [INFO] 02 二月 03:42:22.871 下午 main [org.quartz.examples.example7.InterruptExample]
------- Initialization Complete ----------- [INFO] 02 二月 03:42:22.871 下午 main [org.quartz.examples.example7.InterruptExample]
------- Scheduling Jobs ------------------- [INFO] 02 二月 03:42:22.876 下午 main [org.quartz.examples.example7.InterruptExample]
group1.interruptableJob1 will run at: Tue Feb 02 15:42:30 CST 2016 and repeat: -1 times, every 5 seconds [INFO] 02 二月 03:42:22.876 下午 main [org.quartz.core.QuartzScheduler]
Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started. [INFO] 02 二月 03:42:22.876 下午 main [org.quartz.examples.example7.InterruptExample]
------- Started Scheduler ----------------- [INFO] 02 二月 03:42:22.877 下午 main [org.quartz.examples.example7.InterruptExample]
------- Starting loop to interrupt job every 7 seconds ---------- [DEBUG] 02 二月 03:42:23.883 下午 Timer-0 [org.quartz.utils.UpdateChecker]
Checking for available updated version of Quartz... [DEBUG] 02 二月 03:42:30.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:42:30.018 下午 DefaultQuartzScheduler_Worker-1 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:42:30.030 下午 DefaultQuartzScheduler_Worker-1 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:42:30 CST 2016 [INFO] 02 二月 03:42:34.043 下午 DefaultQuartzScheduler_Worker-1 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:42:34 CST 2016 [DEBUG] 02 二月 03:42:35.007 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:42:35.008 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:42:35.009 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:42:35 CST 2016 [INFO] 02 二月 03:42:36.878 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:42:37.020 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:42:37.020 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:42:37 CST 2016 [DEBUG] 02 二月 03:42:40.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:42:40.000 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:42:40.001 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:42:40 CST 2016 [INFO] 02 二月 03:42:43.879 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:42:44.039 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:42:44.039 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:42:44 CST 2016 [DEBUG] 02 二月 03:42:45.001 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:42:45.002 下午 DefaultQuartzScheduler_Worker-4 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:42:45.002 下午 DefaultQuartzScheduler_Worker-4 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:42:45 CST 2016 [INFO] 02 二月 03:42:49.005 下午 DefaultQuartzScheduler_Worker-4 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:42:49 CST 2016 [DEBUG] 02 二月 03:42:50.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:42:50.000 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:42:50.000 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:42:50 CST 2016 [INFO] 02 二月 03:42:50.886 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:42:51.014 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:42:51.014 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:42:51 CST 2016 [DEBUG] 02 二月 03:42:55.001 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:42:55.001 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:42:55.001 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:42:55 CST 2016 [INFO] 02 二月 03:42:57.887 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:42:58.003 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:42:58.003 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:42:58 CST 2016 [DEBUG] 02 二月 03:43:00.005 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:00.005 下午 DefaultQuartzScheduler_Worker-7 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:00.006 下午 DefaultQuartzScheduler_Worker-7 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:00 CST 2016 [INFO] 02 二月 03:43:04.023 下午 DefaultQuartzScheduler_Worker-7 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:04 CST 2016 [DEBUG] 02 二月 03:43:05.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:05.001 下午 DefaultQuartzScheduler_Worker-8 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:05.001 下午 DefaultQuartzScheduler_Worker-8 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:05 CST 2016 [INFO] 02 二月 03:43:09.018 下午 DefaultQuartzScheduler_Worker-8 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:09 CST 2016 [DEBUG] 02 二月 03:43:10.001 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:10.001 下午 DefaultQuartzScheduler_Worker-9 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:10.002 下午 DefaultQuartzScheduler_Worker-9 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:10 CST 2016 [INFO] 02 二月 03:43:11.896 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:43:12.002 下午 DefaultQuartzScheduler_Worker-9 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:43:12.002 下午 DefaultQuartzScheduler_Worker-9 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:12 CST 2016 [DEBUG] 02 二月 03:43:15.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:15.000 下午 DefaultQuartzScheduler_Worker-10 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:15.000 下午 DefaultQuartzScheduler_Worker-10 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:15 CST 2016 [INFO] 02 二月 03:43:18.897 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:43:19.004 下午 DefaultQuartzScheduler_Worker-10 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:43:19.004 下午 DefaultQuartzScheduler_Worker-10 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:19 CST 2016 [DEBUG] 02 二月 03:43:20.001 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:20.001 下午 DefaultQuartzScheduler_Worker-1 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:20.001 下午 DefaultQuartzScheduler_Worker-1 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:20 CST 2016 [INFO] 02 二月 03:43:24.024 下午 DefaultQuartzScheduler_Worker-1 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:24 CST 2016 [DEBUG] 02 二月 03:43:25.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:25.000 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:25.000 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:25 CST 2016 [INFO] 02 二月 03:43:25.899 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:43:26.000 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:43:26.000 下午 DefaultQuartzScheduler_Worker-2 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:26 CST 2016 [DEBUG] 02 二月 03:43:30.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:30.001 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:30.001 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:30 CST 2016 [INFO] 02 二月 03:43:32.900 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:43:33.002 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:43:33.002 下午 DefaultQuartzScheduler_Worker-3 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:33 CST 2016 [DEBUG] 02 二月 03:43:35.001 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:35.001 下午 DefaultQuartzScheduler_Worker-4 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:35.001 下午 DefaultQuartzScheduler_Worker-4 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:35 CST 2016 [INFO] 02 二月 03:43:39.001 下午 DefaultQuartzScheduler_Worker-4 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:39 CST 2016 [DEBUG] 02 二月 03:43:40.001 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:40.002 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:40.002 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:40 CST 2016 [INFO] 02 二月 03:43:44.028 下午 DefaultQuartzScheduler_Worker-5 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:44 CST 2016 [DEBUG] 02 二月 03:43:45.000 下午 DefaultQuartzScheduler_QuartzSchedulerThread [org.quartz.simpl.SimpleJobFactory]
Producing instance of Job 'group1.interruptableJob1', class=org.quartz.examples.example7.DumbInterruptableJob [DEBUG] 02 二月 03:43:45.001 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.core.JobRunShell]
Calling execute on job group1.interruptableJob1 [INFO] 02 二月 03:43:45.002 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 executing at Tue Feb 02 15:43:45 CST 2016 [INFO] 02 二月 03:43:46.908 下午 main [org.quartz.examples.example7.DumbInterruptableJob]
--- -- INTERRUPTING -- [INFO] 02 二月 03:43:47.003 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.examples.example7.DumbInterruptableJob]
--- group1.interruptableJob1 -- Interrupted... bailing out! [INFO] 02 二月 03:43:47.003 下午 DefaultQuartzScheduler_Worker-6 [org.quartz.examples.example7.DumbInterruptableJob]
---- group1.interruptableJob1 completed at Tue Feb 02 15:43:47 CST 2016

  

  

Quartz1.8.5例子(七)的更多相关文章

  1. 从零开始学习Node.js例子七 发送HTTP客户端请求并显示响应结果

    wget.js:发送HTTP客户端请求并显示响应的各种结果 options对象描述了将要发出的请求.data事件在数据到达时被触发,error事件在发生错误时被触发.HTTP请求中的数据格式通过MIM ...

  2. Quartz1.8.5例子(二)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

  3. scrapy-splash抓取动态数据例子七

    一.介绍 本例子用scrapy-splash抓取36氪网站给定关键字抓取咨询信息. 给定关键字:个性化:融合:电视 抓取信息内如下: 1.资讯标题 2.资讯链接 3.资讯时间 4.资讯来源 二.网站信 ...

  4. Quartz1.8.5例子(十四)

    org.quartz.scheduler.instanceName: PriorityExampleScheduler # Set thread count to 1 to force Trigger ...

  5. Quartz1.8.5例子(十一)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

  6. Quartz1.8.5例子(十)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

  7. Quartz1.8.5例子(九)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

  8. Quartz1.8.5例子(八)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

  9. Quartz1.8.5例子(六)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

随机推荐

  1. Quartz定时任务学习(二)web应用

    web中使用Quartz 1.首先在web.xml文件中加入 如下内容(根据自己情况设定) 在web.xml中添加QuartzInitializerServlet,Quartz为能够在web应用中使用 ...

  2. TortoiseSVN客户端重新设置用户名和密码[转]

    在第一次使用TortoiseSVN从服务器CheckOut的时候,会要求输入用户名和密码,这时输入框下面有个选项是保存认证信息,如果选了这个选项,那么以后就不用每次都输入一遍用户名密码了. 不过,如果 ...

  3. BA的广度和深度

    http://insights.thoughtworkers.org/ba-capability-and-development-path-in-thoughtworks/ 作者:ThoughtWor ...

  4. 修正android cocos2dx项目当点击属性时提示错误的问题

    近期在用cocos2dx 3.x版本号做android版本号的时候,出现点击project-属性-C/C++ builder的时候会提示 The currently displayed paye co ...

  5. mongodb 学习笔记 09 -- shard分片

    概述 shard 分片 就是 把不同的数据分在不同的server 模型 当中:     用户对mongodb的操作都是向mongs请求的     configsvr 用于保存,某条数据保存在哪个sha ...

  6. Linux终端Ctrl相关快捷键

    快速跳至行首:Ctrl+A 快速跳至行尾:Ctrl+E 向前删除至行首:Ctrl+U 向后删除至行尾:Ctrl+K 向后删一个单词:Ctrl+D 清屏:Crtl+L(clear)

  7. 31、三层架构、AJAX+FormsAuthentication实现登陆

    三层架构 前段时间公司要求修改一个网站,打开后我疯了,一层没有都是调用的DB接口,遍地的SQL语句,非常杂乱. 什么是三层架构? 三层架构是将整个项目划分为三个层次:表现层.业务逻辑层.数据访问层.目 ...

  8. Log4net 集成到MVC+EF框架

    前提引用Log4Net.dll文件 1. [assembly: log4net.Config.XmlConfigurator(ConfigFile = "Web.config", ...

  9. vs2015中ctrl+shift+F进行“在文件中查找”,有时候无效?

    搜狗拼音的默认简繁切换快捷键是ctrl+shift+F,改掉以后vs就可以收到这个按键消息了

  10. 在解决方案中添加Layout,Image文件夹

    在解决方案中添加文件夹如Layout,Image,可以使用映射的方式(右键该解决方案,添加对Layout的映射),这样IIS的地址和该文件夹就绑定了:拖该文件夹中的 文件时,显示的就是该文件在IIS中 ...