>
20 | * https://groups.google.com/forum/#!forum/quartz-scheduler-dev[Quartz Development Forum, role="external", window="_blank"] (via Google Groups)
21 |
22 |
23 | == Join the Team
24 |
25 | Got skills with coding, documenting, supporting or even art? We'd love to have you on the team!
26 |
27 |
28 | === Significant Contributors, Past and Present
29 |
30 | James House, Alex Snaps, Ludovic Orban, Tim Eck, Anthony Dahanne, Chris Dennis, Zemian Deng, Aaron Craven, Jasper Rosenberg, Henri Yandell, Weston M. Price, Bill Kratzer, Brian Topping, Brooke Hedrick, Chris Bonham, Chuck Cavaness, Fernando Ribeiro, Dafydd James, Jeffrey Wescott, Matthew Payne, David White, Mike Curwen, Mohammad Rezaei, Srinivas Venkatarangaiah, PartNET Inc.
31 |
32 |
33 | == Tools Support
34 |
35 | YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: http://www.yourkit.com/java/profiler/index.jsp[YourKit Java Profiler].
36 |
--------------------------------------------------------------------------------
/docs/cookbook/BiDailyTrigger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Trigger That Executes Every 2 Days
13 |
14 | At first glance, you may be tempted to use a CronTrigger. However, if this is truly to be every two days, CronTrigger won't work. To illustrate this, simply think of how many days are in a typical month (28-31). A cron expression like "0 0 5 2/2 * ?" would give us a trigger that would restart its count at the beginning of every month. This means that we would would get subsequent firings on July 30 and August 2, which is an interval of three days, not two.
15 |
16 | Likewise, an expression like "0 0 5 1/2 * ?" would end up firing on July 31 and August 1, just one day apart.
17 |
18 | Therefore, for this schedule, using SimpleTrigger or CalendarIntervalTrigger makes sense:
19 |
20 | ### Using SimpleTrigger
21 |
22 | Create a SimpleTrigger that executes 3:00PM tomorrow, and then every 48 hours (which may not always be at 3:00 PM -
23 | because adding 24 hours on days where daylight savings time shifts may result in 2:00 PM or 4:00 PM depending upon
24 | whether the 3:00 PM time was started during DST or standard time):
25 |
26 |
27 |
28 | trigger = newTrigger()
29 | .withIdentity("trigger3", "group1")
30 | .startAt(tomorrowAt(15, 0, 0) // first fire time 15:00:00 tomorrow
31 | .withSchedule(simpleSchedule()
32 | .withIntervalInHours(2 * 24) // interval is actually set at 48 hours' worth of milliseconds
33 | .repeatForever())
34 | .build();
35 |
36 |
37 |
38 | ### Using CalendarIntervalTrigger
39 |
40 |
41 |
42 | trigger = newTrigger()
43 | .withIdentity("trigger3", "group1")
44 | .startAt(tomorrowAt(15, 0, 0) // 15:00:00 tomorrow
45 | .withSchedule(calendarIntervalSchedule()
46 | .withIntervalInDays(2)) // interval is set in calendar days
47 | .build();
48 |
49 |
--------------------------------------------------------------------------------
/docs/cookbook/BiWeeklyTrigger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Trigger That Executes Every 2 Weeks
13 |
14 | As with a trigger meant to fire every two days, CronTrigger won't work for this schedule. For more details, see Trigger That Fires Every 2 Days. We'll need to use a SimpleTrigger or CalendarIntervalTrigger:
15 |
16 |
17 | ### Using SimpleTrigger
18 |
19 | Create a SimpleTrigger that executes 3:00PM tomorrow, and then every 48 hours (which may not always be at 3:00 PM -
20 | because adding 24 hours on days where daylight savings time shifts may result in 2:00 PM or 4:00 PM depending upon
21 | whether the 3:00 PM time was started during DST or standard time):
22 |
23 |
24 |
25 | trigger = newTrigger()
26 | .withIdentity("trigger3", "group1")
27 | .startAt(tomorrowAt(15, 0, 0) // first fire time 15:00:00 tomorrow
28 | .withSchedule(simpleSchedule()
29 | .withIntervalInHours(14 * 24) // interval is actually set at 14 * 24 hours' worth of milliseconds
30 | .repeatForever())
31 | .build();
32 |
33 |
34 |
35 | ### Using CalendarIntervalTrigger
36 |
37 |
38 |
39 | trigger = newTrigger()
40 | .withIdentity("trigger3", "group1")
41 | .startAt(tomorrowAt(15, 0, 0) // 15:00:00 tomorrow
42 | .withSchedule(calendarIntervalSchedule()
43 | .withIntervalInWeeks(2)) // interval is set in calendar weeks
44 | .build();
45 |
46 |
--------------------------------------------------------------------------------
/docs/cookbook/CreateScheduler.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Instantiating a Scheduler
13 |
14 | ### Instantiating the Default Scheduler
15 |
16 |
17 | // the 'default' scheduler is defined in "quartz.properties" found
18 | // in the current working directory, in the classpath, or
19 | // resorts to a fall-back default that is in the quartz.jar
20 |
21 | SchedulerFactory sf = new StdSchedulerFactory();
22 | Scheduler scheduler = sf.getScheduler();
23 |
24 | // Scheduler will not execute jobs until it has been started (though they can be scheduled before start())
25 | scheduler.start();
26 |
27 |
28 |
29 | ### Instantiating A Specific Scheduler From Specific Properties
30 |
31 |
32 | StdSchedulerFactory sf = new StdSchedulerFactory();
33 |
34 | sf.initialize(schedulerProperties);
35 |
36 | Scheduler scheduler = sf.getScheduler();
37 |
38 | // Scheduler will not execute jobs until it has been started (though they can be scheduled before start())
39 | scheduler.start();
40 |
41 |
42 |
43 | ### Instantiating A Specific Scheduler From A Specific Property File
44 |
45 |
46 | StdSchedulerFactory sf = new StdSchedulerFactory();
47 |
48 | sf.initialize(fileName);
49 |
50 | Scheduler scheduler = sf.getScheduler();
51 |
52 | // Scheduler will not execute jobs until it has been started (though they can be scheduled before start())
53 | scheduler.start();
54 |
55 |
--------------------------------------------------------------------------------
/docs/cookbook/DailyTrigger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Trigger That Executes Every Day
13 |
14 | If you want a trigger that always fires at a certain time of day, use CronTrigger or CalendarIntervalTrigger because
15 | they can preserve the fire time's time of day across daylight savings time changes.
16 |
17 |
18 | ### Using CronTrigger
19 |
20 | Create a CronTrigger. that executes every day at 3:00PM:
21 |
22 | trigger = newTrigger()
23 | .withIdentity("trigger3", "group1")
24 | .startNow()
25 | .withSchedule(dailyAtHourAndMinute(15, 0)) // fire every day at 15:00
26 | .build();
27 |
28 |
29 |
30 | ### Using SimpleTrigger
31 |
32 | Create a SimpleTrigger that executes 3:00PM tomorrow, and then every 24 hours (which may not always be at 3:00 PM -
33 | because adding 24 hours on days where daylight savings time shifts may result in 2:00 PM or 4:00 PM depending upon
34 | whether the 3:00 PM time was started during DST or standard time):
35 |
36 |
37 |
38 | trigger = newTrigger()
39 | .withIdentity("trigger3", "group1")
40 | .startAt(tomorrowAt(15, 0, 0) // first fire time 15:00:00 tomorrow
41 | .withSchedule(simpleSchedule()
42 | .withIntervalInHours(24) // interval is actually set at 24 hours' worth of milliseconds
43 | .repeatForever())
44 | .build();
45 |
46 |
47 |
48 | ### Using CalendarIntervalTrigger
49 |
50 |
51 |
52 | trigger = newTrigger()
53 | .withIdentity("trigger3", "group1")
54 | .startAt(tomorrowAt(15, 0, 0) // 15:00:00 tomorrow
55 | .withSchedule(calendarIntervalSchedule()
56 | .withIntervalInDays(1)) // interval is set in calendar days
57 | .build();
58 |
59 |
--------------------------------------------------------------------------------
/docs/cookbook/DefineJobWithData.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Defining a Job (with input data)
13 |
14 |
15 | ### A Job Class
16 |
17 |
18 | public class PrintPropsJob implements Job {
19 |
20 | public PrintPropsJob() {
21 | // Instances of Job must have a public no-argument constructor.
22 | }
23 |
24 | public void execute(JobExecutionContext context)
25 | throws JobExecutionException {
26 |
27 | JobDataMap data = context.getMergedJobDataMap();
28 | System.out.println("someProp = " + data.getString("someProp"));
29 | }
30 |
31 | }
32 |
33 |
34 | ### Defining a Job Instance
35 |
36 |
37 | // Define job instance
38 | JobDetail job1 = JobBuilder.newJob(MyJobClass.class)
39 | .withIdentity("job1", "group1")
40 | .usingJobData("someProp", "someValue")
41 | .build();
42 |
43 |
44 |
45 | Also note that if your Job class contains setter methods that match your JobDataMap keys (e.g. "setSomeProp" for the
46 | data in the above example), and you use the default JobFactory implementation, then Quartz will automatically call
47 | the setter method with the JobDataMap value, and there is no need to have code in the Job's execute method that
48 | retrieves the value from the JobDataMap.
49 |
--------------------------------------------------------------------------------
/docs/cookbook/JobTriggers.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Finding Triggers of a Job
13 |
14 |
15 | ### Finding Triggers of a Job
16 |
17 |
18 | List<Trigger> jobTriggers = sched.getTriggersOfJob(jobKey("jobName", "jobGroup"));
19 |
20 |
--------------------------------------------------------------------------------
/docs/cookbook/ListJobs.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Listing Jobs in the Scheduler
13 |
14 | ### Listing all Jobs in the scheduler
15 |
16 |
17 | // enumerate each job group
18 | for(String group: sched.getJobGroupNames()) {
19 | // enumerate each job in group
20 | for(JobKey jobKey : sched.getJobKeys(groupEquals(group))) {
21 | System.out.println("Found job identified by: " + jobKey);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/docs/cookbook/ListTriggers.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Listing Triggers In Scheduler
13 |
14 | ### Listing all Triggers in the scheduler
15 |
16 |
17 | // enumerate each trigger group
18 | for(String group: sched.getTriggerGroupNames()) {
19 | // enumerate each trigger in group
20 | for(TriggerKey triggerKey : sched.getTriggerKeys(groupEquals(group))) {
21 | System.out.println("Found trigger identified by: " + triggerKey);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/docs/cookbook/NintyMinTrigger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Trigger That Executes Every 90 minutes
13 |
14 | ### Using SimpleTrigger
15 |
16 |
17 |
18 | trigger = newTrigger()
19 | .withIdentity("trigger3", "group1")
20 | .startNow()
21 | .withSchedule(simpleSchedule()
22 | .withIntervalInMinutes(90)
23 | .repeatForever())
24 | .build();
25 |
26 |
27 |
28 | ### Using CalendarIntervalTrigger
29 |
30 |
31 |
32 | trigger = newTrigger()
33 | .withIdentity("trigger3", "group1")
34 | .startNow()
35 | .withSchedule(calendarIntervalSchedule()
36 | .withIntervalInMinutes(90))
37 | .build();
38 |
39 |
--------------------------------------------------------------------------------
/docs/cookbook/ScheduleJob.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Scheduling a Job
13 |
14 | ### Scheduling a Job
15 |
16 |
17 | // Define job instance
18 | JobDetail job1 = JobBuilder.newJob(ColorJob.class)
19 | .withIdentity("job1", "group1")
20 | .build();
21 |
22 | // Define a Trigger that will fire "now", and not repeat
23 | Trigger trigger = TriggerBuilder.newTrigger()
24 | .withIdentity("trigger1", "group1")
25 | .startNow()
26 | .build();
27 |
28 | // Schedule the job with the trigger
29 | sched.scheduleJob(job, trigger);
30 |
31 |
--------------------------------------------------------------------------------
/docs/cookbook/ScheduleStoredJob.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Scheduling an already stored job
13 |
14 | ### Scheduling an already stored job
15 |
16 |
17 | // Define a Trigger that will fire "now" and associate it with the existing job
18 | Trigger trigger = newTrigger()
19 | .withIdentity("trigger1", "group1")
20 | .startNow()
21 | .forJob(jobKey("job1", "group1"))
22 | .build();
23 |
24 | // Schedule the trigger
25 | sched.scheduleJob(trigger);
26 |
27 |
--------------------------------------------------------------------------------
/docs/cookbook/SchedulerListeners.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Using Scheduler Listeners
13 |
14 | ### Creating a SchedulerListener
15 |
16 | Extend TriggerListenerSupport and override methods for events you're interested in.
17 |
18 |
19 | package foo;
20 |
21 | import org.quartz.Trigger;
22 | import org.quartz.listeners.SchedulerListenerSupport;
23 |
24 | public class MyOtherSchedulerListener extends SchedulerListenerSupport {
25 |
26 | @Override
27 | public void schedulerStarted() {
28 | // do something with the event
29 | }
30 |
31 | @Override
32 | public void schedulerShutdown() {
33 | // do something with the event
34 | }
35 |
36 | @Override
37 | public void jobScheduled(Trigger trigger) {
38 | // do something with the event
39 | }
40 |
41 | }
42 |
43 |
44 |
45 | ### Registering A SchedulerListener With The Scheduler
46 |
47 |
48 |
49 | scheduler.getListenerManager().addSchedulerListener(mySchedListener);
50 |
51 |
--------------------------------------------------------------------------------
/docs/cookbook/SchedulerStandby.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Placing a Scheduler in Stand-by Mode
13 |
14 | ### Placing a Scheduler in Stand-by Mode
15 |
16 |
17 | // start() was previously invoked on the scheduler
18 |
19 | scheduler.standby();
20 |
21 | // now the scheduler will not fire triggers / execute jobs
22 |
23 | // ...
24 |
25 | scheduler.start();
26 |
27 | // now the scheduler will fire triggers and execute jobs
28 |
29 |
--------------------------------------------------------------------------------
/docs/cookbook/ServletInitScheduler.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | # How-To: Initializing a scheduler within a servlet container
14 |
15 | There are two approaches for this which are shown below.
16 |
17 | For both cases, make sure to look at the JavaDOC for the related classes to see all possible configuration
18 | parameters, as a complete set is not show below.
19 |
20 |
21 | ### Adding A Context/Container Listener To web.xml
22 |
23 |
24 | ...
25 | <context-param>
26 | <param-name>quartz:config-file</param-name>
27 | <param-value>/some/path/my_quartz.properties</param-value>
28 | </context-param>
29 | <context-param>
30 | <param-name>quartz:shutdown-on-unload</param-name>
31 | <param-value>true</param-value>
32 | </context-param>
33 | <context-param>
34 | <param-name>quartz:wait-on-shutdown</param-name>
35 | <param-value>false</param-value>
36 | </context-param>
37 | <context-param>
38 | <param-name>quartz:start-scheduler-on-load</param-name>
39 | <param-value>true</param-value>
40 | </context-param>
41 | ...
42 | <listener>
43 | <listener-class>
44 | org.quartz.ee.servlet.QuartzInitializerListener
45 | </listener-class>
46 | </listener>
47 | ...
48 |
49 |
50 |
51 | ### Adding A Start-up Servlet To web.xml
52 |
53 |
54 | ...
55 | <servlet>
56 | <servlet-name>QuartzInitializer</servlet-name>
57 | <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
58 | <init-param>
59 |
60 | <param-name>shutdown-on-unload</param-name>
61 | <param-value>true</param-value>
62 | </init-param>
63 | <load-on-startup>2</load-on-startup>
64 |
65 | </servlet>
66 | ...
67 |
68 |
--------------------------------------------------------------------------------
/docs/cookbook/ShutdownScheduler.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Shutting Down a Scheduler
13 |
14 | To shutdown / destroy a scheduler, simply call one of the shutdown(..) methods.
15 |
16 | Once you have shutdown a scheduler, it cannot be restarted (as threads and other resources are permanently destroyed). Also see the suspend method if you wish to simply pause the scheduler for a while.
17 |
18 |
19 | ### Wait for Executing Jobs to Finish
20 |
21 |
22 | //shutdown() does not return until executing Jobs complete execution
23 | scheduler.shutdown(true);
24 |
25 |
26 |
27 | ### Do Not Wait for Executing Jobs to Finish
28 |
29 |
30 | //shutdown() returns immediately, but executing Jobs continue running to completion
31 | scheduler.shutdown();
32 | //or
33 | scheduler.shutdown(false);
34 |
35 |
36 |
37 | If you are using the `org.quartz.ee.servlet.QuartzInitializerListener` to fire up a scheduler in your servlet container, its `contextDestroyed()` method will shutdown the scheduler when your application is undeployed or the application server shuts down (unless its shutdown-on-unload property has been explicitly set to false).
38 |
--------------------------------------------------------------------------------
/docs/cookbook/StoreJob.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Storing a Job for Later Use
13 |
14 | ### Storing a Job
15 |
16 |
17 | // Define a durable job instance (durable jobs can exist without triggers)
18 | JobDetail job1 = newJob(MyJobClass.class)
19 | .withIdentity("job1", "group1")
20 | .storeDurably()
21 | .build();
22 |
23 | // Add the the job to the scheduler's store
24 | sched.addJob(job, false);
25 |
26 |
--------------------------------------------------------------------------------
/docs/cookbook/TenSecTrigger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Trigger That Executes Every Ten Seconds
13 |
14 | ### Using SimpleTrigger
15 |
16 |
17 |
18 | trigger = newTrigger()
19 | .withIdentity("trigger3", "group1")
20 | .startNow()
21 | .withSchedule(simpleSchedule()
22 | .withIntervalInSeconds(10)
23 | .repeatForever())
24 | .build();
25 |
26 |
--------------------------------------------------------------------------------
/docs/cookbook/UnscheduleJob.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Unscheduling a Job
13 |
14 | ### Unscheduling a Particular Trigger of Job
15 |
16 |
17 | // Unschedule a particular trigger from the job (a job may have more than one trigger)
18 | scheduler.unscheduleJob(triggerKey("trigger1", "group1"));
19 |
20 |
21 |
22 | ### Deleting a Job and Unscheduling All of Its Triggers
23 |
24 |
25 | // Schedule the job with the trigger
26 | scheduler.deleteJob(jobKey("job1", "group1"));
27 |
28 |
--------------------------------------------------------------------------------
/docs/cookbook/UpdateJob.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Update an existing job
13 |
14 | ### Update an existing job
15 |
16 |
17 | // Add the new job to the scheduler, instructing it to "replace"
18 | // the existing job with the given name and group (if any)
19 | JobDetail job1 = newJob(MyJobClass.class)
20 | .withIdentity("job1", "group1")
21 | .build();
22 |
23 | // store, and set overwrite flag to 'true'
24 | scheduler.addJob(job1, true);
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docs/cookbook/UpdateTrigger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cookbook
3 | visible_title: "Quartz Cookbook"
4 | active_sub_menu_id: site_mnu_docs_cookbook
5 | ---
6 |
7 |
8 |
9 |
10 |
11 |
12 | # How-To: Updating a trigger
13 |
14 | ### Replacing a trigger
15 |
16 |
17 | // Define a new Trigger
18 | Trigger trigger = newTrigger()
19 | .withIdentity("newTrigger", "group1")
20 | .startNow()
21 | .build();
22 |
23 | // tell the scheduler to remove the old trigger with the given key, and put the new one in its place
24 | sched.rescheduleJob(triggerKey("oldTrigger", "group1"), trigger);
25 |
26 |
27 |
28 |
29 | ### Updating an existing trigger
30 |
31 |
32 | // retrieve the trigger
33 | Trigger oldTrigger = sched.getTrigger(triggerKey("oldTrigger", "group1");
34 |
35 | // obtain a builder that would produce the trigger
36 | TriggerBuilder tb = oldTrigger.getTriggerBuilder();
37 |
38 | // update the schedule associated with the builder, and build the new trigger
39 | // (other builder methods could be called, to change the trigger in any desired way)
40 | Trigger newTrigger = tb.withSchedule(simpleSchedule()
41 | .withIntervalInSeconds(10)
42 | .withRepeatCount(10)
43 | .build();
44 |
45 | sched.rescheduleJob(oldTrigger.getKey(), newTrigger);
46 |
47 |
48 |
--------------------------------------------------------------------------------
/docs/downloads.adoc:
--------------------------------------------------------------------------------
1 | = Download Quartz
2 | :toc:
3 | :quartz-version: latest-x.y.z
4 |
5 | == Manual Downloads
6 |
7 | You may download our standalone distribution packages from http://www.quartz-scheduler.org/downloads
8 |
9 | == Using Maven as Dependency
10 |
11 | If you are a Maven user you can add the dependencies to your existing project.
12 |
13 | Add the following into your project `pom.xml` file under `` element section:
14 |
15 | [source,xml,subs="verbatim,attributes"]
16 | ----
17 |
18 |
19 | org.quartz-scheduler
20 | quartz
21 | {quartz-version}
22 |
23 | ----
24 |
25 | Additional, you may include these optional dependencies if you choose use them
26 |
27 | [source,xml,subs="verbatim,attributes"]
28 | ----
29 |
30 |
31 | ch.qos.logback
32 | logback-classic
33 | 1.2.3
34 |
35 |
36 |
37 |
38 | org.postgresql
39 | postgresql
40 | 42.2.5
41 |
42 | ----
43 |
--------------------------------------------------------------------------------
/docs/index.adoc:
--------------------------------------------------------------------------------
1 | = Quartz Documentation
2 | :toc:
3 | :quartz-version: latest-x.y.z
4 |
5 | This documentation is for Quartz {quartz-version}.
6 |
7 | Project Home: https://github.com/quartz-scheduler/quartz/
8 |
9 | == Downloads
10 |
11 | Get Quartz from <>
12 |
13 | == Release and General Information
14 |
15 | * <>
16 | * <>
17 | * https://documentation.softwareag.com/legal/[Legal Notices, role="external", window="_blank"]
18 | * https://confluence.terracotta.org/display/release/Home[Terracotta Platform and Release Compatibility Tables, role="external", window="_blank"]
19 |
20 | == User's Guide
21 |
22 | * <>
23 | * <>
24 | * <>
25 | * http://www.quartz-scheduler.org/api/{quartz-version}/[JavaDoc, role="external", window="_blank"]
26 | * <>
27 | * <>
28 | * <>
29 | * <>
30 | * <>
31 | * <>
32 |
33 | == Quartz Developer's Guide
34 |
35 | * <>
36 | * <>
37 | * <>
38 | * https://github.com/quartz-scheduler/quartz/wiki[WIKI, role="external", window="_blank"]
39 |
40 | == More Help?
41 |
42 | If you don't find what you’re looking for in the docs, post a question to the Quartz support forums.
43 |
44 | * https://groups.google.com/forum/#!categories/quartz-scheduler[Quartz User Support Forum, role="external", window="_blank"]
45 | * https://groups.google.com/forum/#!forum/quartz-scheduler-dev[Quartz Development Forum, role="external", window="_blank"]
46 |
47 |
--------------------------------------------------------------------------------
/docs/tutorials/index.adoc:
--------------------------------------------------------------------------------
1 | = Quartz Job Scheduler Tutorials
2 | :title: Tutorials
3 | :visible_title: "Quartz Tutorials"
4 | :active_sub_menu_id: site_mnu_docs_tutorials
5 |
6 | Before starting the tutorial, you may first want to review the <<../quick-start-guide.adoc#,Quick Start Guide>>, which covers download, installation, and very basic configuration of Quartz.
7 |
8 | == Choose a Lesson:
9 |
10 | link:tutorial-lesson-01.html[Lesson 1: Using Quartz]
11 |
12 | link:tutorial-lesson-02.html[Lesson 2: The Quartz API, and Introduction to Jobs And Triggers]
13 |
14 | link:tutorial-lesson-03.html[Lesson 3: More About Jobs & JobDetails]
15 |
16 | link:tutorial-lesson-04.html[Lesson 4: More About Triggers]
17 |
18 | link:tutorial-lesson-05.html[Lesson 5: SimpleTriggers]
19 |
20 | link:tutorial-lesson-06.html[Lesson 6: CronTriggers]
21 |
22 | link:tutorial-lesson-07.html[Lesson 7: TriggerListeners & JobListeners]
23 |
24 | link:tutorial-lesson-08.html[Lesson 8: SchedulerListeners]
25 |
26 | link:tutorial-lesson-09.html[Lesson 9: JobStores]
27 |
28 | link:tutorial-lesson-10.html[Lesson 10: Configuration, Resource Usage and SchedulerFactory]
29 |
30 | link:tutorial-lesson-11.html[Lesson 11: Advanced (Enterprise) Features]
31 |
32 | link:tutorial-lesson-12.html[Lesson 12: Miscellaneous Features]
33 |
34 | == Choose a Special Topic:
35 |
36 | link:crontrigger.html[CronTrigger Tutorial]
--------------------------------------------------------------------------------
/docs/tutorials/tutorial-lesson-01.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tutorial 1
3 | visible_title: "Quartz Tutorials"
4 | active_sub_menu_id: site_mnu_docs_tutorials
5 | ---
6 |
10 |
11 | ## Lesson 1: Using Quartz
12 |
13 | Before you can use the scheduler, it needs to be instantiated (who'd have guessed?). To do this, you use a
14 | SchedulerFactory. Some users of Quartz may keep an instance of a factory in a JNDI store, others may find it
15 | just as easy (or easier) to instantiate and use a factory instance directly (such as in the example below).
16 |
17 | Once a scheduler is instantiated, it can be started, placed in stand-by mode, and shutdown. Note that once a
18 | scheduler is shutdown, it cannot be restarted without being re-instantiated. Triggers do not fire (jobs do not execute)
19 | until the scheduler has been started, nor while it is in the paused state.
20 |
21 | Here's a quick snippet of code, that instantiates and starts a scheduler, and schedules a job for execution:
22 |
23 |
24 | SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
25 |
26 | Scheduler sched = schedFact.getScheduler();
27 |
28 | sched.start();
29 |
30 | // define the job and tie it to our HelloJob class
31 | JobDetail job = newJob(HelloJob.class)
32 | .withIdentity("myJob", "group1")
33 | .build();
34 |
35 | // Trigger the job to run now, and then every 40 seconds
36 | Trigger trigger = newTrigger()
37 | .withIdentity("myTrigger", "group1")
38 | .startNow()
39 | .withSchedule(simpleSchedule()
40 | .withIntervalInSeconds(40)
41 | .repeatForever())
42 | .build();
43 |
44 | // Tell quartz to schedule the job using our trigger
45 | sched.scheduleJob(job, trigger);
46 |
47 |
48 |
49 | As you can see, working with quartz is rather simple. In Lesson 2 we'll give a quick overview of Jobs and Triggers, and Quartz's API so that
51 | you can more fully understand this example.
52 |
--------------------------------------------------------------------------------
/docs/tutorials/tutorial-lesson-08.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tutorial 7
3 | visible_title: "Quartz Tutorials"
4 | active_sub_menu_id: site_mnu_docs_tutorials
5 | ---
6 |
11 |
12 | ## Lesson 8: SchedulerListeners
13 |
14 | ***SchedulerListeners*** are much like TriggerListeners and JobListeners, except they receive
15 | notification of events within the Scheduler itself - not necessarily events related to a specific trigger or job.
16 |
17 | Scheduler-related events include: the addition of a job/trigger, the removal of a job/trigger, a serious error
18 | within the scheduler, notification of the scheduler being shutdown, and others.
19 |
20 | **The org.quartz.SchedulerListener Interface**
21 |
22 |
23 | public interface SchedulerListener {
24 |
25 | public void jobScheduled(Trigger trigger);
26 |
27 | public void jobUnscheduled(String triggerName, String triggerGroup);
28 |
29 | public void triggerFinalized(Trigger trigger);
30 |
31 | public void triggersPaused(String triggerName, String triggerGroup);
32 |
33 | public void triggersResumed(String triggerName, String triggerGroup);
34 |
35 | public void jobsPaused(String jobName, String jobGroup);
36 |
37 | public void jobsResumed(String jobName, String jobGroup);
38 |
39 | public void schedulerError(String msg, SchedulerException cause);
40 |
41 | public void schedulerStarted();
42 |
43 | public void schedulerInStandbyMode();
44 |
45 | public void schedulerShutdown();
46 |
47 | public void schedulingDataCleared();
48 | }
49 |
50 |
51 |
52 | SchedulerListeners are registered with the scheduler's ListenerManager. SchedulerListeners can be virtually any
53 | object that implements the org.quartz.SchedulerListener interface.
54 |
55 | **Adding a SchedulerListener:**
56 |
57 |
58 | scheduler.getListenerManager().addSchedulerListener(mySchedListener);
59 |
60 |
61 |
62 | **Removing a SchedulerListener:**
63 |
64 |
65 | scheduler.getListenerManager().removeSchedulerListener(mySchedListener);
66 |
67 |
--------------------------------------------------------------------------------
/docs/tutorials/tutorial-lesson-12.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tutorial 12
3 | visible_title: "Quartz Tutorials"
4 | active_sub_menu_id: site_mnu_docs_tutorials
5 | ---
6 |
10 |
11 | ## Lesson 12: Miscellaneous Features of Quartz
12 |
13 | ### [Plug-Ins](#TutorialLesson12-PlugIns)
14 |
15 | Quartz provides an interface (org.quartz.spi.SchedulerPlugin) for plugging-in additional functionality.
16 |
17 | Plugins that ship with Quartz to provide various utility capabilities can be found documented in the ***org.quartz.plugins***
18 | package. They provide functionality such as auto-scheduling of jobs upon scheduler startup, logging a history of job and
19 | trigger events, and ensuring that the scheduler shuts down cleanly when the JVM exits.
20 |
21 |
22 | ### [JobFactory](#TutorialLesson12-JobFactory)
23 |
24 | When a trigger fires, the Job it is associated to is instantiated via the JobFactory configured on the Scheduler.
25 | The default JobFactory simply calls newInstance() on the job class. You may want to create your own implementation of
26 | JobFactory to accomplish things such as having your application's IoC or DI container produce/initialize the job
27 | instance.
28 |
29 | See the **org.quartz.spi.JobFactory** interface, and the associated **Scheduler.setJobFactory(fact)**
30 | method.
31 |
32 |
33 | ### '[Factory-Shipped' Jobs](#TutorialLesson12-FactoryShippedJobs)
34 |
35 | Quartz also provides a number of utility Jobs that you can use in your application for doing things like sending
36 | e-mails and invoking EJBs. These out-of-the-box Jobs can be found documented in the ***org.quartz.jobs***
37 | package.
38 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/DisallowConcurrentExecution.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz;
19 |
20 | import java.lang.annotation.Documented;
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | /**
27 | * An annotation that marks a {@link Job} class as one that must not have multiple
28 | * instances executed concurrently (where instance is based-upon a {@link JobDetail}
29 | * definition - or in other words based upon a {@link JobKey}).
30 | *
31 | * @see PersistJobDataAfterExecution
32 | *
33 | * @author jhouse
34 | */
35 | @Documented
36 | @Retention(RetentionPolicy.RUNTIME)
37 | @Target(ElementType.TYPE)
38 | public @interface DisallowConcurrentExecution {
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/ExecuteInJTATransaction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz;
19 |
20 | import java.lang.annotation.Documented;
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | import javax.transaction.UserTransaction;
27 |
28 | /**
29 | * An annotation that marks a {@link Job} class as one that will have its
30 | * execution wrapped by a JTA Transaction.
31 | *
32 | * If this annotation is present, Quartz will begin a JTA transaction
33 | * before calling the execute()
method, and will commit
34 | * the transaction if the method does not throw an exception and the
35 | * transaction has not had setRollbackOnly()
called on it
36 | * (otherwise the transaction will be rolled-back by Quartz).
37 | *
38 | * This is essentially the same behavior as setting the configuration
39 | * property org.quartz.scheduler.wrapJobExecutionInUserTransaction
40 | * to true
- except that it only affects the job that has
41 | * the annotation, rather than all jobs (as the property does). If the
42 | * property is set to true
and the annotation is also set,
43 | * then of course the annotation becomes redundant.
44 | *
45 | * @author jhouse
46 | */
47 | @Documented
48 | @Retention(RetentionPolicy.RUNTIME)
49 | @Target(ElementType.TYPE)
50 | public @interface ExecuteInJTATransaction {
51 |
52 | /**
53 | * The JTA transaction timeout.
54 | *
55 | * If set then the {@code UserTransaction} timeout will be set to this
56 | * value before beginning the transaction.
57 | *
58 | * @see UserTransaction#setTransactionTimeout(int)
59 | * @return the transaction timeout.
60 | */
61 | int timeout() default -1;
62 | }
63 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/JobPersistenceException.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz;
20 |
21 | /**
22 | * An exception that is thrown to indicate that there has been a failure in the
23 | * scheduler's underlying persistence mechanism.
24 | *
25 | * @author James House
26 | */
27 | public class JobPersistenceException extends SchedulerException {
28 |
29 | private static final long serialVersionUID = -8924958757341995694L;
30 |
31 | /*
32 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 | *
34 | * Constructors.
35 | *
36 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | */
38 |
39 | /**
40 | *
41 | * Create a JobPersistenceException
with the given message.
42 | *
43 | */
44 | public JobPersistenceException(String msg) {
45 | super(msg);
46 | }
47 |
48 |
49 | /**
50 | *
51 | * Create a JobPersistenceException
with the given message
52 | * and cause.
53 | *
54 | */
55 | public JobPersistenceException(String msg, Throwable cause) {
56 | super(msg, cause);
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/Matcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz;
19 |
20 | import java.io.Serializable;
21 |
22 | import org.quartz.utils.Key;
23 |
24 | /**
25 | * Matchers can be used in various {@link Scheduler} API methods to
26 | * select the entities that should be operated upon.
27 | *
28 | * @author jhouse
29 | * @since 2.0
30 | */
31 | public interface Matcher> extends Serializable {
32 |
33 | boolean isMatch(T key);
34 |
35 | public int hashCode();
36 |
37 | public boolean equals(Object obj);
38 | }
39 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/PersistJobDataAfterExecution.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz;
19 |
20 | import java.lang.annotation.Documented;
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | /**
27 | * An annotation that marks a {@link Job} class as one that makes updates to its
28 | * {@link JobDataMap} during execution, and wishes the scheduler to re-store the
29 | * JobDataMap
when execution completes.
30 | *
31 | * Jobs that are marked with this annotation should also seriously consider
32 | * using the {@link DisallowConcurrentExecution} annotation, to avoid data
33 | * storage race conditions with concurrently executing job instances.
34 | *
35 | * @see DisallowConcurrentExecution
36 | *
37 | * @author jhouse
38 | */
39 | @Documented
40 | @Retention(RetentionPolicy.RUNTIME)
41 | @Target(ElementType.TYPE)
42 | public @interface PersistJobDataAfterExecution {
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/ScheduleBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz;
19 |
20 | import org.quartz.spi.MutableTrigger;
21 |
22 | public abstract class ScheduleBuilder {
23 |
24 | protected abstract MutableTrigger build();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/SchedulerConfigException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz;
19 |
20 | /**
21 | * An exception that is thrown to indicate that there is a misconfiguration of
22 | * the SchedulerFactory
- or one of the components it
23 | * configures.
24 | *
25 | * @author James House
26 | */
27 | public class SchedulerConfigException extends SchedulerException {
28 |
29 | private static final long serialVersionUID = -5921239824646083098L;
30 |
31 | /*
32 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 | *
34 | * Constructors.
35 | *
36 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | */
38 |
39 | /**
40 | *
41 | * Create a JobPersistenceException
with the given message.
42 | *
43 | */
44 | public SchedulerConfigException(String msg) {
45 | super(msg);
46 | }
47 |
48 | /**
49 | *
50 | * Create a JobPersistenceException
with the given message
51 | * and cause.
52 | *
53 | */
54 | public SchedulerConfigException(String msg, Throwable cause) {
55 | super(msg, cause);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/SchedulerContext.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz;
20 |
21 | import java.io.Serializable;
22 | import java.util.Map;
23 |
24 | import org.quartz.utils.StringKeyDirtyFlagMap;
25 |
26 | /**
27 | * Holds context/environment data that can be made available to Jobs as they
28 | * are executed. This feature is much like the ServletContext feature when
29 | * working with J2EE servlets.
30 | *
31 | *
32 | * Future versions of Quartz may make distinctions on how it propagates
33 | * data in SchedulerContext
between instances of proxies to a
34 | * single scheduler instance - i.e. if Quartz is being used via RMI.
35 | *
36 | *
37 | * @see Scheduler#getContext
38 | *
39 | * @author James House
40 | */
41 | public class SchedulerContext extends StringKeyDirtyFlagMap implements Serializable {
42 |
43 | private static final long serialVersionUID = -6659641334616491764L;
44 |
45 | /**
46 | * Create an empty SchedulerContext
.
47 | */
48 | public SchedulerContext() {
49 | super(15);
50 | }
51 |
52 | /**
53 | * Create a SchedulerContext
with the given data.
54 | */
55 | public SchedulerContext(Map, ?> map) {
56 | this();
57 | @SuppressWarnings("unchecked") // param must be a String key map.
58 | Map mapTyped = (Map)map;
59 | putAll(mapTyped);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/SchedulerFactory.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz;
20 |
21 | import java.util.Collection;
22 |
23 | /**
24 | * Provides a mechanism for obtaining client-usable handles to Scheduler
25 | * instances.
26 | *
27 | * Scheduler的工厂接口
28 | *
29 | * @see Scheduler
30 | * @see org.quartz.impl.StdSchedulerFactory
31 | *
32 | * @author James House
33 | */
34 | public interface SchedulerFactory {
35 |
36 | /*
37 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | *
39 | * Interface.
40 | *
41 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 | */
43 |
44 | /**
45 | *
46 | * Returns a client-usable handle to a Scheduler
.
47 | *
48 | * 返回一个scheduler
49 | *
50 | *
51 | * @throws SchedulerException
52 | * if there is a problem with the underlying Scheduler
.
53 | */
54 | Scheduler getScheduler() throws SchedulerException;
55 |
56 | /**
57 | *
58 | * Returns a handle to the Scheduler with the given name, if it exists.
59 | *
60 | * 根据指定名字返回对应的scheduler
61 | *
62 | */
63 | Scheduler getScheduler(String schedName) throws SchedulerException;
64 |
65 | /**
66 | *
67 | * Returns handles to all known Schedulers (made by any SchedulerFactory
68 | * within this jvm.).
69 | *
70 | */
71 | Collection getAllSchedulers() throws SchedulerException;
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/StatefulJob.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz;
20 |
21 | /**
22 | * A marker interface for {@link org.quartz.JobDetail}
s that
23 | * wish to have their state maintained between executions.
24 | *
25 | *
26 | * StatefulJob
instances follow slightly different rules from
27 | * regular Job
instances. The key difference is that their
28 | * associated {@link JobDataMap}
is re-persisted after every
29 | * execution of the job, thus preserving state for the next execution. The
30 | * other difference is that stateful jobs are not allowed to execute
31 | * concurrently, which means new triggers that occur before the completion of
32 | * the execute(xx)
method will be delayed.
33 | *
34 | *
35 | * @see DisallowConcurrentExecution
36 | * @see PersistJobDataAfterExecution
37 | *
38 | * @see Job
39 | * @see JobDetail
40 | * @see JobDataMap
41 | * @see Scheduler
42 | *
43 | *
44 | * @deprecated use DisallowConcurrentExecution and/or PersistJobDataAfterExecution annotations instead.
45 | *
46 | * @author James House
47 | */
48 | @PersistJobDataAfterExecution
49 | @DisallowConcurrentExecution
50 | public interface StatefulJob extends Job {
51 |
52 | /*
53 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54 | *
55 | * Interface.
56 | *
57 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 | */
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/UnableToInterruptJobException.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz;
20 |
21 | /**
22 | * An exception that is thrown to indicate that a call to
23 | * InterruptableJob.interrupt() failed without interrupting the Job.
24 | *
25 | * @see org.quartz.InterruptableJob#interrupt()
26 | *
27 | * @author James House
28 | */
29 | public class UnableToInterruptJobException extends SchedulerException {
30 |
31 | private static final long serialVersionUID = -490863760696463776L;
32 |
33 | /*
34 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 | *
36 | * Constructors.
37 | *
38 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | */
40 |
41 | /**
42 | *
43 | * Create a UnableToInterruptJobException
with the given message.
44 | *
45 | */
46 | public UnableToInterruptJobException(String msg) {
47 | super(msg);
48 | }
49 |
50 | /**
51 | *
52 | * Create a UnableToInterruptJobException
with the given cause.
53 | *
54 | */
55 | public UnableToInterruptJobException(Throwable cause) {
56 | super(cause);
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/core/JobRunShellFactory.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz.core;
20 |
21 | import org.quartz.Scheduler;
22 | import org.quartz.SchedulerConfigException;
23 | import org.quartz.SchedulerException;
24 | import org.quartz.spi.TriggerFiredBundle;
25 |
26 | /**
27 | *
28 | * Responsible for creating the instances of {@link JobRunShell}
29 | * to be used within the {@link QuartzScheduler} instance.
30 | *
31 | *
32 | * @author James House
33 | */
34 | public interface JobRunShellFactory {
35 |
36 | /*
37 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | *
39 | * Interface.
40 | *
41 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 | */
43 |
44 | /**
45 | *
46 | * Initialize the factory, providing a handle to the Scheduler
47 | * that should be made available within the JobRunShell
and
48 | * the JobExecutionContext
s within it.
49 | *
50 | */
51 | void initialize(Scheduler scheduler)
52 | throws SchedulerConfigException;
53 |
54 | /**
55 | *
56 | * Called by the {@link org.quartz.core.QuartzSchedulerThread}
57 | * to obtain instances of {@link JobRunShell}
.
58 | *
59 | */
60 | JobRunShell createJobRunShell(TriggerFiredBundle bundle) throws SchedulerException;
61 | }
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/core/NullSampledStatisticsImpl.java:
--------------------------------------------------------------------------------
1 | package org.quartz.core;
2 |
3 | public class NullSampledStatisticsImpl implements SampledStatistics {
4 | public long getJobsCompletedMostRecentSample() {
5 | return 0;
6 | }
7 |
8 | public long getJobsExecutingMostRecentSample() {
9 | return 0;
10 | }
11 |
12 | public long getJobsScheduledMostRecentSample() {
13 | return 0;
14 | }
15 |
16 | public void shutdown() {
17 | // nothing to do
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/core/SampledStatistics.java:
--------------------------------------------------------------------------------
1 | package org.quartz.core;
2 |
3 | public interface SampledStatistics {
4 | long getJobsScheduledMostRecentSample();
5 | long getJobsExecutingMostRecentSample();
6 | long getJobsCompletedMostRecentSample();
7 | void shutdown();
8 | }
9 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/core/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz.core
4 |
5 |
6 | Contains the core classes and interfaces for the Quartz job scheduler.
7 |
8 |
9 |
10 |
11 | See the Quartz project
12 | for more information.
13 |
14 |
15 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/helpers/VersionPrinter.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy
7 | * of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | *
17 | */
18 |
19 | package org.quartz.helpers;
20 |
21 | import org.quartz.core.QuartzScheduler;
22 |
23 | /**
24 | *
25 | * Prints the version of Quartz on stdout.
26 | *
27 | *
28 | * @author James House
29 | */
30 | public class VersionPrinter {
31 |
32 | /**
33 | * Private constructor because this is a pure utility class.
34 | */
35 | private VersionPrinter() {
36 | }
37 |
38 | /*
39 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | *
41 | * Interface.
42 | *
43 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 | */
45 |
46 | public static void main(String[] args) {
47 | System.out.println("Quartz version: " + QuartzScheduler.getVersionMajor()
48 | + "." + QuartzScheduler.getVersionMinor() + "."
49 | + QuartzScheduler.getVersionIteration());
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/helpers/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz.helpers
4 |
5 |
6 | Contains helper classes to make working with Quartz easier.
7 |
8 |
9 |
10 |
11 | See the Quartz project
12 | for more information.
13 |
14 |
15 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/DefaultThreadExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.impl;
17 |
18 | import org.quartz.spi.ThreadExecutor;
19 |
20 | /**
21 | * Schedules work on a newly spawned thread. This is the default Quartz
22 | * behavior.
23 | *
24 | * 默认在新的线程执行调度任务
25 | *
26 | * @author matt.accola
27 | * @version $Revision$ $Date$
28 | */
29 | public class DefaultThreadExecutor implements ThreadExecutor {
30 |
31 | public void initialize() {
32 | }
33 |
34 | public void execute(Thread thread) {
35 | thread.start();
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/DB2v8Delegate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.impl.jdbcjobstore;
18 |
19 | import java.sql.PreparedStatement;
20 | import java.sql.SQLException;
21 |
22 | import org.quartz.spi.ClassLoadHelper;
23 | import org.slf4j.Logger;
24 |
25 | /**
26 | * Quartz JDBC delegate for DB2 v8 databases.
27 | *
28 | * This differs from the StdJDBCDelegate
in that it stores
29 | * boolean
values in an integer
column.
30 | *
31 | *
32 | * @author Blair Jensen
33 | */
34 | public class DB2v8Delegate extends StdJDBCDelegate {
35 |
36 | /**
37 | * Sets the designated parameter to the given Java boolean
value.
38 | * This translates the boolean to 1/0 for true/false.
39 | */
40 | @Override
41 | protected void setBoolean(PreparedStatement ps, int index, boolean val) throws SQLException {
42 | ps.setInt(index, ((val) ? 1 : 0));
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/InvalidConfigurationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.impl.jdbcjobstore;
19 |
20 | /**
21 | *
22 | * Exception class for when a driver delegate cannot be found for a given
23 | * configuration, or lack thereof.
24 | *
25 | *
26 | * @author Jeffrey Wescott
27 | */
28 | public class InvalidConfigurationException extends Exception {
29 |
30 | private static final long serialVersionUID = 1836325935209404611L;
31 |
32 | /*
33 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | *
35 | * Constructors.
36 | *
37 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | */
39 |
40 | public InvalidConfigurationException(String msg) {
41 | super(msg);
42 | }
43 |
44 | public InvalidConfigurationException() {
45 | super();
46 | }
47 | }
48 |
49 | // EOF
50 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/LockException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.impl.jdbcjobstore;
19 |
20 | import org.quartz.JobPersistenceException;
21 |
22 | /**
23 | *
24 | * Exception class for when there is a failure obtaining or releasing a
25 | * resource lock.
26 | *
27 | *
28 | * @see Semaphore
29 | *
30 | * @author James House
31 | */
32 | public class LockException extends JobPersistenceException {
33 |
34 | private static final long serialVersionUID = 3993800462589137228L;
35 |
36 | /*
37 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | *
39 | * Constructors.
40 | *
41 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 | */
43 |
44 | public LockException(String msg) {
45 | super(msg);
46 | }
47 |
48 | public LockException(String msg, Throwable cause) {
49 | super(msg, cause);
50 | }
51 | }
52 |
53 | // EOF
54 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/NoSuchDelegateException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.impl.jdbcjobstore;
19 |
20 | import org.quartz.JobPersistenceException;
21 |
22 | /**
23 | *
24 | * Exception class for when a driver delegate cannot be found for a given
25 | * configuration, or lack thereof.
26 | *
27 | *
28 | * @author Jeffrey Wescott
29 | */
30 | public class NoSuchDelegateException extends JobPersistenceException {
31 |
32 | private static final long serialVersionUID = -4255865028975822979L;
33 |
34 | /*
35 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36 | *
37 | * Constructors.
38 | *
39 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | */
41 |
42 | public NoSuchDelegateException(String msg) {
43 | super(msg);
44 | }
45 |
46 | public NoSuchDelegateException(String msg, Throwable cause) {
47 | super(msg, cause);
48 | }
49 | }
50 |
51 | // EOF
52 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/SchedulerStateRecord.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.impl.jdbcjobstore;
19 |
20 | /**
21 | *
22 | * Conveys a scheduler-instance state record.
23 | *
24 | *
25 | * @author James House
26 | */
27 | public class SchedulerStateRecord implements java.io.Serializable {
28 |
29 | private static final long serialVersionUID = -715704959016191445L;
30 |
31 | /*
32 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 | *
34 | * Data members.
35 | *
36 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | */
38 |
39 | private String schedulerInstanceId;
40 |
41 | private long checkinTimestamp;
42 |
43 | private long checkinInterval;
44 |
45 | /*
46 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47 | *
48 | * Interface.
49 | *
50 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51 | */
52 |
53 | /**
54 | */
55 | public long getCheckinInterval() {
56 | return checkinInterval;
57 | }
58 |
59 | /**
60 | */
61 | public long getCheckinTimestamp() {
62 | return checkinTimestamp;
63 | }
64 |
65 | /**
66 | */
67 | public String getSchedulerInstanceId() {
68 | return schedulerInstanceId;
69 | }
70 |
71 | /**
72 | */
73 | public void setCheckinInterval(long l) {
74 | checkinInterval = l;
75 | }
76 |
77 | /**
78 | */
79 | public void setCheckinTimestamp(long l) {
80 | checkinTimestamp = l;
81 | }
82 |
83 | /**
84 | */
85 | public void setSchedulerInstanceId(String string) {
86 | schedulerInstanceId = string;
87 | }
88 |
89 | }
90 |
91 | // EOF
92 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/Semaphore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.impl.jdbcjobstore;
18 |
19 | import java.sql.Connection;
20 |
21 | /**
22 | * An interface for providing thread/resource locking in order to protect
23 | * resources from being altered by multiple threads at the same time.
24 | *
25 | * @author jhouse
26 | */
27 | public interface Semaphore {
28 |
29 | /*
30 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | *
32 | * Interface.
33 | *
34 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 | */
36 |
37 | /**
38 | * Grants a lock on the identified resource to the calling thread (blocking
39 | * until it is available).
40 | *
41 | * @param conn Database connection used to establish lock. Can be null if
42 | * {@link #requiresConnection()}
returns false.
43 | *
44 | * @return true if the lock was obtained.
45 | */
46 | boolean obtainLock(Connection conn, String lockName) throws LockException;
47 |
48 | /**
49 | * Release the lock on the identified resource if it is held by the calling
50 | * thread.
51 | */
52 | void releaseLock(String lockName) throws LockException;
53 |
54 | /**
55 | * Whether this Semaphore implementation requires a database connection for
56 | * its lock management operations.
57 | *
58 | * @see #obtainLock(Connection, String)
59 | * @see #releaseLock(String)
60 | */
61 | boolean requiresConnection();
62 | }
63 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/jdbcjobstore/TablePrefixAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 | package org.quartz.impl.jdbcjobstore;
17 |
18 | /**
19 | * Interface for Quartz objects that need to know what the table prefix of
20 | * the tables used by a JDBC JobStore is.
21 | */
22 | public interface TablePrefixAware {
23 | void setTablePrefix(String tablePrefix);
24 | void setSchedName(String schedName);
25 | }
26 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/matchers/EverythingMatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.impl.matchers;
18 |
19 | import org.quartz.JobKey;
20 | import org.quartz.Matcher;
21 | import org.quartz.TriggerKey;
22 | import org.quartz.utils.Key;
23 |
24 | /**
25 | * Matches on the complete key being equal (both name and group).
26 | *
27 | * @author jhouse
28 | */
29 | public class EverythingMatcher> implements Matcher {
30 |
31 | private static final long serialVersionUID = 202300056681974058L;
32 |
33 | protected EverythingMatcher() {
34 | }
35 |
36 | /**
37 | * Create an EverythingMatcher that matches all jobs.
38 | */
39 | public static EverythingMatcher allJobs() {
40 | return new EverythingMatcher();
41 | }
42 |
43 | /**
44 | * Create an EverythingMatcher that matches all triggers.
45 | */
46 | public static EverythingMatcher allTriggers() {
47 | return new EverythingMatcher();
48 | }
49 |
50 | public boolean isMatch(T key) {
51 | return true;
52 | }
53 |
54 | @Override
55 | public boolean equals(Object obj) {
56 | if(obj == null)
57 | return false;
58 |
59 | return obj.getClass().equals(getClass());
60 | }
61 |
62 | @Override
63 | public int hashCode() {
64 | return getClass().getName().hashCode();
65 | }
66 |
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/matchers/KeyMatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.impl.matchers;
18 |
19 | import org.quartz.Matcher;
20 | import org.quartz.utils.Key;
21 |
22 | /**
23 | * Matches on the complete key being equal (both name and group).
24 | *
25 | * @author jhouse
26 | */
27 | public class KeyMatcher> implements Matcher {
28 |
29 | private static final long serialVersionUID = 1230009869074992437L;
30 |
31 | protected T compareTo;
32 |
33 | protected KeyMatcher(T compareTo) {
34 | this.compareTo = compareTo;
35 | }
36 |
37 | /**
38 | * Create a KeyMatcher that matches Keys that equal the given key.
39 | */
40 | public static > KeyMatcher keyEquals(U compareTo) {
41 | return new KeyMatcher(compareTo);
42 | }
43 |
44 | public boolean isMatch(T key) {
45 |
46 | return compareTo.equals(key);
47 | }
48 |
49 | public T getCompareToValue() {
50 | return compareTo;
51 | }
52 |
53 | @Override
54 | public int hashCode() {
55 | final int prime = 31;
56 | int result = 1;
57 | result = prime * result
58 | + ((compareTo == null) ? 0 : compareTo.hashCode());
59 | return result;
60 | }
61 |
62 | @Override
63 | public boolean equals(Object obj) {
64 | if (this == obj)
65 | return true;
66 | if (obj == null)
67 | return false;
68 | if (getClass() != obj.getClass())
69 | return false;
70 | KeyMatcher> other = (KeyMatcher>) obj;
71 | if (compareTo == null) {
72 | if (other.compareTo != null)
73 | return false;
74 | } else if (!compareTo.equals(other.compareTo))
75 | return false;
76 | return true;
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz.impl
4 |
5 |
6 | Contains implementations of the SchedulerFactory, JobStore, ThreadPool, and
7 | other interfaces required by the org.quartz.core.QuartzScheduler.
8 |
9 | Classes in this package may have dependencies on third-party packages.
10 |
11 |
12 |
13 |
14 | See the Quartz project
15 | for more information.
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/triggers/CoreTrigger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.impl.triggers;
19 |
20 | import org.quartz.Trigger;
21 |
22 | /**
23 | * internal interface preserved for backward compatibility
24 | */
25 | public interface CoreTrigger extends Trigger {
26 |
27 | public boolean hasAdditionalProperties();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/impl/triggers/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz.triggers
4 |
5 |
6 | This package contains Trigger implementations that ship with Quartz. End-users should not directly use these classes,
7 | but rather use the builders and interfaces found in the main org.quartz package.
8 |
9 |
10 |
11 |
12 | See the Quartz project for more information.
13 |
14 |
15 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/listeners/JobListenerSupport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 | package org.quartz.listeners;
17 |
18 | import org.slf4j.Logger;
19 | import org.slf4j.LoggerFactory;
20 | import org.quartz.JobListener;
21 | import org.quartz.JobExecutionContext;
22 | import org.quartz.JobExecutionException;
23 |
24 | /**
25 | * A helpful abstract base class for implementors of
26 | * {@link org.quartz.JobListener}
.
27 | *
28 | *
29 | * The methods in this class are empty so you only need to override the
30 | * subset for the {@link org.quartz.JobListener}
events
31 | * you care about.
32 | *
33 | *
34 | *
35 | * You are required to implement {@link org.quartz.JobListener#getName()}
36 | * to return the unique name of your JobListener
.
37 | *
38 | *
39 | * @see org.quartz.JobListener
40 | */
41 | public abstract class JobListenerSupport implements JobListener {
42 | private final Logger log = LoggerFactory.getLogger(getClass());
43 |
44 | /**
45 | * Get the {@link org.slf4j.Logger}
for this
46 | * class's category. This should be used by subclasses for logging.
47 | */
48 | protected Logger getLog() {
49 | return log;
50 | }
51 |
52 | public void jobToBeExecuted(JobExecutionContext context) {
53 | }
54 |
55 | public void jobExecutionVetoed(JobExecutionContext context) {
56 | }
57 |
58 | public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/management/ManagementServer.java:
--------------------------------------------------------------------------------
1 | package org.quartz.management;
2 |
3 | import org.quartz.core.QuartzScheduler;
4 |
5 |
6 | /**
7 | * Copyright Terracotta, Inc.
8 | *
9 | * Licensed under the Apache License, Version 2.0 (the "License");
10 | * you may not use this file except in compliance with the License.
11 | * You may obtain a copy of the License at
12 | *
13 | * http://www.apache.org/licenses/LICENSE-2.0
14 | *
15 | * Unless required by applicable law or agreed to in writing, software
16 | * distributed under the License is distributed on an "AS IS" BASIS,
17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | * See the License for the specific language governing permissions and
19 | * limitations under the License.
20 | */
21 |
22 |
23 | /**
24 | * Interface implemented by management servers.
25 | *
26 | * @author Ludovic Orban
27 | * @author brandony
28 | */
29 | public interface ManagementServer {
30 |
31 | /**
32 | * Start the management server
33 | */
34 | public void start();
35 |
36 | /**
37 | * Stop the management server
38 | */
39 | public void stop();
40 |
41 | /**
42 | * Puts the submitted resource under the purview of this {@code ManagementServer}.
43 | *
44 | * @param managedResource the resource to be managed
45 | */
46 | public void register(QuartzScheduler managedResource);
47 |
48 | /**
49 | * Removes the submitted resource under the purview of this {@code ManagementServer}.
50 | *
51 | * @param managedResource the resource to be managed
52 | */
53 | public void unregister(QuartzScheduler managedResource);
54 |
55 | /**
56 | * Returns true if this {@code ManagementServer} has any resources registered.
57 | *
58 | * @return true if actively managing resources, false if not.
59 | */
60 | public boolean hasRegistered();
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz
4 |
5 |
6 | The main package of Quartz, containing the client-side interfaces.
7 |
8 |
9 |
10 |
11 | See the Quartz project for more information.
12 |
13 |
14 | Quartz provides a builder-style API for constructing scheduling-related
15 | entities via a Domain-Specific Language (DSL). The DSL can best be
16 | utilized through the usage of static imports of the methods on the classes
17 | TriggerBuilder
, JobBuilder
,
18 | DateBuilder
, JobKey
, TriggerKey
19 | and the various ScheduleBuilder
implementations.
20 |
21 | Client code can then use the DSL to write code such as this:
22 |
23 | JobDetail job = newJob(MyJob.class)
24 | .withIdentity("myJob")
25 | .build();
26 |
27 | Trigger trigger = newTrigger()
28 | .withIdentity(triggerKey("myTrigger", "myTriggerGroup"))
29 | .withSchedule(simpleSchedule()
30 | .withIntervalInHours(1)
31 | .repeatForever())
32 | .startAt(futureDate(10, MINUTES))
33 | .build();
34 |
35 | scheduler.scheduleJob(job, trigger);
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/simpl/HostnameInstanceIdGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.simpl;
18 |
19 | import java.net.InetAddress;
20 |
21 | import org.quartz.SchedulerException;
22 | import org.quartz.spi.InstanceIdGenerator;
23 |
24 | /**
25 | *
26 | * InstanceIdGenerator
that names the scheduler instance using
27 | * just the machine hostname.
28 | *
29 | *
30 | *
31 | * This class is useful when you know that your scheduler instance will be the
32 | * only one running on a particular machine. Each time the scheduler is
33 | * restarted, it will get the same instance id as long as the machine is not
34 | * renamed.
35 | *
36 | *
37 | * @see InstanceIdGenerator
38 | * @see SimpleInstanceIdGenerator
39 | */
40 | public class HostnameInstanceIdGenerator implements InstanceIdGenerator {
41 | public String generateInstanceId() throws SchedulerException {
42 | try {
43 | return InetAddress.getLocalHost().getHostName();
44 | } catch (Exception e) {
45 | throw new SchedulerException("Couldn't get host name!", e);
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/simpl/SimpleInstanceIdGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.simpl;
18 |
19 | import java.net.InetAddress;
20 |
21 | import org.quartz.SchedulerException;
22 | import org.quartz.spi.InstanceIdGenerator;
23 |
24 | /**
25 | * The default InstanceIdGenerator used by Quartz when instance id is to be
26 | * automatically generated. Instance id is of the form HOSTNAME + CURRENT_TIME.
27 | *
28 | * @see InstanceIdGenerator
29 | * @see HostnameInstanceIdGenerator
30 | */
31 | public class SimpleInstanceIdGenerator implements InstanceIdGenerator {
32 | public String generateInstanceId() throws SchedulerException {
33 | try {
34 | return InetAddress.getLocalHost().getHostName() + System.currentTimeMillis();
35 | } catch (Exception e) {
36 | throw new SchedulerException("Couldn't get host name!", e);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/simpl/SimpleJobFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.simpl;
18 |
19 | import org.slf4j.Logger;
20 | import org.slf4j.LoggerFactory;
21 | import org.quartz.Job;
22 | import org.quartz.JobDetail;
23 | import org.quartz.Scheduler;
24 | import org.quartz.SchedulerException;
25 | import org.quartz.spi.JobFactory;
26 | import org.quartz.spi.TriggerFiredBundle;
27 |
28 | /**
29 | * The default JobFactory used by Quartz - simply calls
30 | * newInstance()
on the job class.
31 | *
32 | * @see JobFactory
33 | * @see PropertySettingJobFactory
34 | *
35 | * @author jhouse
36 | */
37 | public class SimpleJobFactory implements JobFactory {
38 |
39 | private final Logger log = LoggerFactory.getLogger(getClass());
40 |
41 | protected Logger getLog() {
42 | return log;
43 | }
44 |
45 | public Job newJob(TriggerFiredBundle bundle, Scheduler Scheduler) throws SchedulerException {
46 |
47 | JobDetail jobDetail = bundle.getJobDetail();
48 | Class extends Job> jobClass = jobDetail.getJobClass();
49 | try {
50 | if(log.isDebugEnabled()) {
51 | log.debug(
52 | "Producing instance of Job '" + jobDetail.getKey() +
53 | "', class=" + jobClass.getName());
54 | }
55 |
56 | return jobClass.newInstance();
57 | } catch (Exception e) {
58 | SchedulerException se = new SchedulerException(
59 | "Problem instantiating class '"
60 | + jobDetail.getJobClass().getName() + "'", e);
61 | throw se;
62 | }
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/simpl/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz.simpl
4 |
5 |
6 | Contains simple / light-weight implementations (with no dependencies on
7 | external libraries) of interfaces required by the
8 | org.quartz.core.QuartzScheduler.
9 |
10 |
11 |
12 |
13 | See the Quartz project
14 | for more information.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/spi/InstanceIdGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.spi;
18 |
19 | import org.quartz.SchedulerException;
20 |
21 | /**
22 | *
23 | * An InstanceIdGenerator is responsible for generating the clusterwide unique
24 | * instance id for a Scheduler
node.
25 | *
26 | *
27 | *
28 | * This interface may be of use to those wishing to have specific control over
29 | * the mechanism by which the Scheduler
instances in their
30 | * application are named.
31 | *
32 | *
33 | * @see org.quartz.simpl.SimpleInstanceIdGenerator
34 | */
35 | public interface InstanceIdGenerator {
36 | /**
37 | * Generate the instance id for a Scheduler
38 | *
39 | * @return The clusterwide unique instance id.
40 | */
41 | String generateInstanceId() throws SchedulerException;
42 | }
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/spi/SchedulerSignaler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.spi;
19 |
20 | import org.quartz.JobKey;
21 | import org.quartz.SchedulerException;
22 | import org.quartz.Trigger;
23 |
24 | /**
25 | * An interface to be used by JobStore
instances in order to
26 | * communicate signals back to the QuartzScheduler
.
27 | *
28 | * @author jhouse
29 | */
30 | public interface SchedulerSignaler {
31 |
32 | /*
33 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | *
35 | * Interface.
36 | *
37 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | */
39 |
40 | void notifyTriggerListenersMisfired(Trigger trigger);
41 |
42 | void notifySchedulerListenersFinalized(Trigger trigger);
43 |
44 | void notifySchedulerListenersJobDeleted(JobKey jobKey);
45 |
46 | void signalSchedulingChange(long candidateNewNextFireTime);
47 |
48 | void notifySchedulerListenersError(String string, SchedulerException jpe);
49 | }
50 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/spi/ThreadExecutor.java:
--------------------------------------------------------------------------------
1 | package org.quartz.spi;
2 |
3 | /**
4 | * Allows different strategies for scheduling threads. The {@link #initialize()}
5 | * method is required to be called before the first call to
6 | * {@link #execute(Thread)}. The Thread containing the work to be performed is
7 | * passed to execute and the work is scheduled by the underlying implementation.
8 | *
9 | * 使用不同的策略执行调度线程
10 | *
11 | * 只有一种实现,即默认实现{@link org.quartz.impl.DefaultThreadExecutor}
12 | *
13 | * @author matt.accola
14 | * @version $Revision$ $Date$
15 | */
16 | public interface ThreadExecutor {
17 |
18 | /**
19 | * Submit a task for execution
20 | *
21 | * @param thread the thread to execute
22 | */
23 | void execute(Thread thread);
24 |
25 | /**
26 | * Initialize any state prior to calling {@link #execute(Thread)}
27 | */
28 | void initialize();
29 | }
30 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/spi/TriggerFiredResult.java:
--------------------------------------------------------------------------------
1 | package org.quartz.spi;
2 |
3 | /**
4 | * @author lorban
5 | */
6 | public class TriggerFiredResult {
7 |
8 | private TriggerFiredBundle triggerFiredBundle;
9 |
10 | private Exception exception;
11 |
12 | public TriggerFiredResult(TriggerFiredBundle triggerFiredBundle) {
13 | this.triggerFiredBundle = triggerFiredBundle;
14 | }
15 |
16 | public TriggerFiredResult(Exception exception) {
17 | this.exception = exception;
18 | }
19 |
20 | public TriggerFiredBundle getTriggerFiredBundle() {
21 | return triggerFiredBundle;
22 | }
23 |
24 | public Exception getException() {
25 | return exception;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/spi/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Package org.quartz.spi
4 |
5 |
6 | Contains Service Provider Interfaces that can be implemented by those
7 | wishing to create and use custom versions of Quartz back-end/behind-the-scenes
8 | services.
9 |
10 |
11 |
12 |
13 | See the Quartz project
14 | for more information.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/ConnectionProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.utils;
19 |
20 | import java.sql.Connection;
21 | import java.sql.SQLException;
22 |
23 | /**
24 | * Implementations of this interface used by DBConnectionManager
25 | * to provide connections from various sources.
26 | *
27 | * @see DBConnectionManager
28 | * @see PoolingConnectionProvider
29 | * @see JNDIConnectionProvider
30 | * @see org.quartz.utils.weblogic.WeblogicConnectionProvider
31 | *
32 | * @author Mohammad Rezaei
33 | */
34 | public interface ConnectionProvider {
35 | /*
36 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | *
38 | * Interface.
39 | *
40 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 | */
42 |
43 | /**
44 | * @return connection managed by this provider
45 | * @throws SQLException
46 | */
47 | Connection getConnection() throws SQLException;
48 |
49 |
50 | void shutdown() throws SQLException;
51 |
52 | void initialize() throws SQLException;
53 | }
54 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/FindbugsSuppressWarnings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.utils;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR,
25 | ElementType.LOCAL_VARIABLE, ElementType.PACKAGE })
26 | @Retention(RetentionPolicy.CLASS)
27 | public @interface FindbugsSuppressWarnings {
28 |
29 | String[] value() default {};
30 | }
31 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/PoolingConnectionProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 |
18 | package org.quartz.utils;
19 |
20 | import javax.sql.DataSource;
21 |
22 | /**
23 | *
24 | * ConnectionProvider
s supporting pooling of connections.
25 | *
26 | *
27 | *
28 | * Implementations must pool connections.
29 | *
30 | *
31 | * @see DBConnectionManager
32 | * @see ConnectionProvider
33 | * @author Ludovic Orban
34 | */
35 | public interface PoolingConnectionProvider extends ConnectionProvider {
36 |
37 | /** The pooling provider. */
38 | String POOLING_PROVIDER = "provider";
39 |
40 | /** The c3p0 pooling provider. */
41 | String POOLING_PROVIDER_C3P0 = "c3p0";
42 |
43 | /** The Hikari pooling provider. */
44 | String POOLING_PROVIDER_HIKARICP = "hikaricp";
45 |
46 | /** The JDBC database driver. */
47 | String DB_DRIVER = "driver";
48 |
49 | /** The JDBC database URL. */
50 | String DB_URL = "URL";
51 |
52 | /** The database user name. */
53 | String DB_USER = "user";
54 |
55 | /** The database user password. */
56 | String DB_PASSWORD = "password";
57 |
58 | /** The maximum number of database connections to have in the pool. Default is 10. */
59 | String DB_MAX_CONNECTIONS = "maxConnections";
60 |
61 | /**
62 | * The database sql query to execute every time a connection is returned
63 | * to the pool to ensure that it is still valid.
64 | */
65 | String DB_VALIDATION_QUERY = "validationQuery";
66 |
67 | /** Default maximum number of database connections in the pool. */
68 | int DEFAULT_DB_MAX_CONNECTIONS = 10;
69 |
70 |
71 | DataSource getDataSource();
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/counter/Counter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.quartz.utils.counter;
18 |
19 | /**
20 | * A simple counter
21 | *
22 | * @author Abhishek Sanoujam
23 | *
24 | * @since 1.8
25 | */
26 | public interface Counter {
27 |
28 | /**
29 | * Increment the counter by 1
30 | *
31 | * @return the value after incrementing
32 | */
33 | long increment();
34 |
35 | /**
36 | * Decrement the counter by 1
37 | *
38 | * @return the value after decrementing
39 | */
40 | long decrement();
41 |
42 | /**
43 | * Returns the value of the counter and sets it to the new value
44 | *
45 | * @param newValue
46 | * @return Returns the old value
47 | */
48 | long getAndSet(long newValue);
49 |
50 | /**
51 | * Gets current value of the counter
52 | *
53 | * @return current value of the counter
54 | */
55 | long getValue();
56 |
57 | /**
58 | * Increment the counter by given amount
59 | *
60 | * @param amount
61 | * @return the value of the counter after incrementing
62 | */
63 | long increment(long amount);
64 |
65 | /**
66 | * Decrement the counter by given amount
67 | *
68 | * @param amount
69 | * @return the value of the counter after decrementing
70 | */
71 | long decrement(long amount);
72 |
73 | /**
74 | * Sets the value of the counter to the supplied value
75 | *
76 | * @param newValue
77 | */
78 | void setValue(long newValue);
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/counter/CounterConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.quartz.utils.counter;
18 |
19 | /**
20 | * Config for a simple Counter
21 | *
22 | * @author Abhishek Sanoujam
23 | * @since 1.8
24 | *
25 | */
26 | public class CounterConfig {
27 |
28 | private final long initialValue;
29 |
30 | /**
31 | * Creates a config with the initial value
32 | *
33 | * @param initialValue
34 | */
35 | public CounterConfig(long initialValue) {
36 | this.initialValue = initialValue;
37 | }
38 |
39 | /**
40 | * Gets the initial value
41 | *
42 | * @return the initial value of counters created by this config
43 | */
44 | public final long getInitialValue() {
45 | return initialValue;
46 | }
47 |
48 | /**
49 | * Creates and returns a Counter based on the initial value
50 | *
51 | * @return The counter created by this config
52 | */
53 | public Counter createCounter() {
54 | return new CounterImpl(initialValue);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/counter/CounterManager.java:
--------------------------------------------------------------------------------
1 | /**
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.quartz.utils.counter;
18 |
19 | /**
20 | * A Counter Manager that accepts a config to create counters. Creates counter's
21 | * based on {@link CounterConfig}. This manages the lifycycle of a counter
22 | *
23 | * @author Abhishek Sanoujam
24 | * @since 1.8
25 | *
26 | */
27 | public interface CounterManager {
28 | /**
29 | * Creates a Counter based on tha passed config
30 | *
31 | * @param config
32 | * @return The counter created and managed by this CounterManager
33 | */
34 | Counter createCounter(CounterConfig config);
35 |
36 | /**
37 | * Shuts down this counter manager
38 | */
39 | void shutdown(boolean killTimer);
40 |
41 | /**
42 | * Shuts down the counter
43 | *
44 | * @param counter
45 | */
46 | void shutdownCounter(Counter counter);
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/counter/sampled/SampledCounter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.quartz.utils.counter.sampled;
18 |
19 | import org.quartz.utils.counter.Counter;
20 |
21 | /**
22 | * Interface of a sampled counter -- a counter that keeps sampled values
23 | *
24 | * @author Abhishek Sanoujam
25 | * @since 1.8
26 | *
27 | */
28 | public interface SampledCounter extends Counter {
29 | /**
30 | * Shutdown this counter
31 | */
32 | void shutdown();
33 |
34 | /**
35 | * Returns the most recent sampled value
36 | *
37 | * @return Value of the most recent sampled value
38 | */
39 | TimeStampedCounterValue getMostRecentSample();
40 |
41 | /**
42 | * Returns all samples in history
43 | *
44 | * @return An array containing the TimeStampedCounterValue's
45 | */
46 | TimeStampedCounterValue[] getAllSampleValues();
47 |
48 | /**
49 | * Returns the current value of the counter and resets it to 0
50 | *
51 | * @return current value of the counter
52 | */
53 | long getAndReset();
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/counter/sampled/SampledRateCounter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.quartz.utils.counter.sampled;
18 |
19 | /**
20 | * Interface of a sampled rate counter -- a counter that keeps sampled values of
21 | * rates
22 | *
23 | * @author Abhishek Sanoujam
24 | * @since 1.8
25 | *
26 | */
27 | public interface SampledRateCounter extends SampledCounter {
28 |
29 | /**
30 | * Increments the numerator and denominator by the passed values
31 | *
32 | * @param numerator
33 | * @param denominator
34 | */
35 | public void increment(long numerator, long denominator);
36 |
37 | /**
38 | * Decrements the numerator and denominator by the passed values
39 | *
40 | * @param numerator
41 | * @param denominator
42 | */
43 | public void decrement(long numerator, long denominator);
44 |
45 | /**
46 | * Sets the values of the numerator and denominator to the passed values
47 | *
48 | * @param numerator
49 | * @param denominator
50 | */
51 | public void setValue(long numerator, long denominator);
52 |
53 | /**
54 | * Sets the value of the numerator to the passed value
55 | *
56 | * @param newValue
57 | */
58 | public void setNumeratorValue(long newValue);
59 |
60 | /**
61 | * Sets the value of the denominator to the passed value
62 | *
63 | * @param newValue
64 | */
65 | public void setDenominatorValue(long newValue);
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/org/quartz/utils/counter/sampled/TimeStampedCounterValue.java:
--------------------------------------------------------------------------------
1 | /**
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.quartz.utils.counter.sampled;
18 |
19 | import java.io.Serializable;
20 |
21 | /**
22 | * A counter value at a particular time instance
23 | *
24 | * @author Abhishek Sanoujam
25 | * @since 1.8
26 | */
27 | public class TimeStampedCounterValue implements Serializable {
28 |
29 | private static final long serialVersionUID = 1931111347823687672L;
30 |
31 | private final long counterValue;
32 | private final long timestamp;
33 |
34 | /**
35 | * Constructor accepting the value of both timestamp and the counter value.
36 | *
37 | * @param timestamp
38 | * @param value
39 | */
40 | public TimeStampedCounterValue(long timestamp, long value) {
41 | this.timestamp = timestamp;
42 | this.counterValue = value;
43 | }
44 |
45 | /**
46 | * Get the counter value
47 | *
48 | * @return The counter value
49 | */
50 | public long getCounterValue() {
51 | return this.counterValue;
52 | }
53 |
54 | /**
55 | * Get value of the timestamp
56 | *
57 | * @return the timestamp associated with the current value
58 | */
59 | public long getTimestamp() {
60 | return this.timestamp;
61 | }
62 |
63 | /**
64 | * {@inheritDoc}
65 | */
66 | @Override
67 | public String toString() {
68 | return "value: " + this.counterValue + ", timestamp: " + this.timestamp;
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/quartz-core/src/main/java/overview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This document is the API specification for Quartz.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/quartz-core/src/main/resources/checkstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/quartz-core/src/main/resources/org/quartz/core/quartz-build.properties:
--------------------------------------------------------------------------------
1 | fullname=${name}
2 | name=${artifactId}
3 | version=${version}
4 |
5 |
--------------------------------------------------------------------------------
/quartz-core/src/main/resources/org/quartz/quartz.properties:
--------------------------------------------------------------------------------
1 | # Default Properties file for use by StdSchedulerFactory
2 | # to create a Quartz Scheduler Instance, if a different
3 | # properties file is not explicitly specified.
4 | #
5 |
6 | org.quartz.scheduler.instanceName: DefaultQuartzScheduler
7 | org.quartz.scheduler.rmi.export: false
8 | org.quartz.scheduler.rmi.proxy: false
9 | org.quartz.scheduler.wrapJobExecutionInUserTransaction: false
10 |
11 | org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
12 | org.quartz.threadPool.threadCount: 10
13 | org.quartz.threadPool.threadPriority: 5
14 | org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
15 |
16 | org.quartz.jobStore.misfireThreshold: 60000
17 |
18 | org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
19 |
20 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/CronScheduleBuilderTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz;
18 |
19 | import static org.quartz.CronScheduleBuilder.atHourAndMinuteOnGivenDaysOfWeek;
20 | import static org.quartz.TriggerBuilder.newTrigger;
21 | import junit.framework.Assert;
22 | import junit.framework.TestCase;
23 |
24 | /**
25 | * Unit test for CronScheduleBuilder.
26 | *
27 | * @author jhouse
28 | *
29 | */
30 | public class CronScheduleBuilderTest extends TestCase {
31 |
32 | public void testAtHourAndMinuteOnGivenDaysOfWeek() {
33 |
34 | CronTrigger trigger = newTrigger().withIdentity("test")
35 | .withSchedule(
36 | atHourAndMinuteOnGivenDaysOfWeek(10, 0, DateBuilder.MONDAY, DateBuilder.THURSDAY, DateBuilder.FRIDAY))
37 | .build();
38 | Assert.assertEquals("0 0 10 ? * 2,5,6", trigger.getCronExpression());
39 |
40 | trigger = newTrigger().withIdentity("test")
41 | .withSchedule(
42 | atHourAndMinuteOnGivenDaysOfWeek(10, 0, DateBuilder.WEDNESDAY))
43 | .build();
44 | Assert.assertEquals("0 0 10 ? * 4", trigger.getCronExpression());
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/DefaultSchedulerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz;
17 |
18 | import static org.junit.Assert.assertThat;
19 | import static org.junit.matchers.JUnitMatchers.containsString;
20 |
21 | import org.quartz.impl.JobDetailImpl;
22 | import org.quartz.impl.StdSchedulerFactory;
23 |
24 | import junit.framework.TestCase;
25 |
26 | /**
27 | * DefaultSchedulerTest
28 | */
29 | public class DefaultSchedulerTest extends TestCase {
30 |
31 | public void testAddJobNoTrigger() throws Exception {
32 | Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
33 | JobDetailImpl jobDetail = new JobDetailImpl();
34 | jobDetail.setName("testjob");
35 |
36 | try {
37 | scheduler.addJob(jobDetail, false);
38 | } catch (SchedulerException e) {
39 | assertThat(e.getMessage(), containsString("durable"));
40 | }
41 |
42 | jobDetail.setDurability(true);
43 | scheduler.addJob(jobDetail, false);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/JdbcSchedulerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz;
17 |
18 | import java.sql.SQLException;
19 |
20 | import org.quartz.impl.DirectSchedulerFactory;
21 | import org.quartz.impl.SchedulerRepository;
22 | import org.quartz.impl.jdbcjobstore.JdbcQuartzTestUtilities;
23 | import org.quartz.impl.jdbcjobstore.JobStoreTX;
24 | import org.quartz.simpl.SimpleThreadPool;
25 |
26 | public class JdbcSchedulerTest extends AbstractSchedulerTest {
27 |
28 | @Override
29 | protected Scheduler createScheduler(String name, int threadPoolSize) throws SchedulerException {
30 | try {
31 | JdbcQuartzTestUtilities.createDatabase(name + "Database");
32 | } catch (SQLException e) {
33 | throw new AssertionError(e);
34 | }
35 | JobStoreTX jobStore = new JobStoreTX();
36 | jobStore.setDataSource(name + "Database");
37 | jobStore.setTablePrefix("QRTZ_");
38 | jobStore.setInstanceId("AUTO");
39 | DirectSchedulerFactory.getInstance().createScheduler(name + "Scheduler", "AUTO", new SimpleThreadPool(threadPoolSize, Thread.NORM_PRIORITY), jobStore);
40 | return SchedulerRepository.getInstance().lookup(name + "Scheduler");
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/JobDataMapTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 | package org.quartz;
17 |
18 |
19 | /**
20 | * Unit test for JobDataMap serialization backwards compatibility.
21 | */
22 | public class JobDataMapTest extends SerializationTestSupport {
23 | private static final String[] VERSIONS = new String[] {"1.4.5", "1.5.1", "2.1"};
24 |
25 | /**
26 | * Get the object to serialize when generating serialized file for future
27 | * tests, and against which to validate deserialized object.
28 | */
29 | @Override
30 | protected Object getTargetObject() {
31 | JobDataMap m = new JobDataMap();
32 | m.put("key", Integer.valueOf(5));
33 | return m;
34 | }
35 |
36 | /**
37 | * Get the Quartz versions for which we should verify
38 | * serialization backwards compatibility.
39 | */
40 | @Override
41 | protected String[] getVersions() {
42 | return VERSIONS;
43 | }
44 |
45 | /**
46 | * Verify that the target object and the object we just deserialized
47 | * match.
48 | */
49 | @SuppressWarnings("deprecation")
50 | @Override
51 | protected void verifyMatch(Object target, Object deserialized) {
52 | JobDataMap targetMap = (JobDataMap)target;
53 | JobDataMap deserializedMap = (JobDataMap)deserialized;
54 |
55 | assertNotNull(deserializedMap);
56 | assertEquals(targetMap.getWrappedMap(), deserializedMap.getWrappedMap());
57 | assertEquals(targetMap.getAllowsTransientData(), deserializedMap.getAllowsTransientData());
58 | assertEquals(targetMap.isDirty(), deserializedMap.isDirty());
59 | }
60 |
61 | public static void main(String[] args) throws Exception {
62 | new JobDataMapTest().writeJobDataFile("2.1");
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/MonthlyCalendarTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 | package org.quartz;
17 |
18 | import java.util.Calendar;
19 |
20 | import junit.framework.TestCase;
21 |
22 | import org.quartz.impl.calendar.MonthlyCalendar;
23 |
24 | /**
25 | * Unit test for MonthlyCalendar
26 | */
27 | public class MonthlyCalendarTest extends TestCase {
28 |
29 | /**
30 | * Tests whether greater than the 7th of the month causes infinite looping.
31 | * See: QUARTZ-636
32 | */
33 | public void testForInfiniteLoop() {
34 | MonthlyCalendar monthlyCalendar = new MonthlyCalendar();
35 |
36 | for(int i=1; i<9; i++) {
37 | monthlyCalendar.setDayExcluded(i, true);
38 | }
39 | Calendar c = Calendar.getInstance();
40 | c.set(2007, 11, 8, 12, 0, 0);
41 |
42 | monthlyCalendar.getNextIncludedTime(c.getTime().getTime());
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/RAMSchedulerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz;
17 |
18 | import java.util.Properties;
19 |
20 | import org.quartz.impl.StdSchedulerFactory;
21 |
22 | public class RAMSchedulerTest extends AbstractSchedulerTest {
23 |
24 | @Override
25 | protected Scheduler createScheduler(String name, int threadPoolSize) throws SchedulerException {
26 | Properties config = new Properties();
27 | config.setProperty("org.quartz.scheduler.instanceName", name + "Scheduler");
28 | config.setProperty("org.quartz.scheduler.instanceId", "AUTO");
29 | config.setProperty("org.quartz.threadPool.threadCount", Integer.toString(threadPoolSize));
30 | config.setProperty("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
31 | return new StdSchedulerFactory(config).getScheduler();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/VersionTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 | package org.quartz;
17 |
18 | import java.util.regex.Pattern;
19 | import java.util.regex.Matcher;
20 | import junit.framework.TestCase;
21 |
22 | import org.quartz.core.QuartzScheduler;
23 |
24 | public class VersionTest extends TestCase {
25 | @SuppressWarnings("unused")
26 | private static final String SNAPSHOT_SUFFIX = "-SNAPSHOT";
27 | @SuppressWarnings("unused")
28 | private static final String PROTOTYPE_SUFFIX = "-PROTO";
29 |
30 | public void testVersionParsing() {
31 | assertNonNegativeInteger(QuartzScheduler.getVersionMajor());
32 | assertNonNegativeInteger(QuartzScheduler.getVersionMinor());
33 |
34 | String iter = QuartzScheduler.getVersionIteration();
35 | assertNotNull(iter);
36 | Pattern suffix = Pattern.compile("(\\d+)(-\\w+)?");
37 | Matcher m = suffix.matcher(iter);
38 | if (m.matches()) {
39 | assertNonNegativeInteger(m.group(1));
40 | } else {
41 | throw new RuntimeException(iter + " doesn't match pattern '(\\d+)(-\\w+)?'");
42 | }
43 |
44 | }
45 |
46 | private void assertNonNegativeInteger(String s) {
47 | assertNotNull(s);
48 | boolean parsed = false;
49 | int intVal = -1;
50 | try {
51 | intVal = Integer.parseInt(s);
52 | parsed = true;
53 | } catch (NumberFormatException e) {}
54 |
55 | assertTrue(parsed);
56 | assertTrue(intVal >= 0);
57 | }
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/impl/JobDetailImplTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.impl;
17 |
18 | import org.hamcrest.Matchers;
19 | import org.junit.Assert;
20 | import org.junit.Test;
21 |
22 | public class JobDetailImplTest {
23 | @Test
24 | public void testHashCode() {
25 | JobDetailImpl job = new JobDetailImpl();
26 | Assert.assertThat(job.hashCode(), Matchers.is(0));
27 |
28 | job.setName("test");
29 | Assert.assertThat(job.hashCode(), Matchers.not(Matchers.is(0)));
30 |
31 | job.setGroup("test");
32 | Assert.assertThat(job.hashCode(), Matchers.not(Matchers.is(0)));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/impl/MockConnectionProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.impl;
17 |
18 | import java.sql.Connection;
19 | import java.sql.SQLException;
20 | import java.util.ArrayList;
21 | import java.util.List;
22 |
23 | import org.quartz.utils.ConnectionProvider;
24 |
25 | /**
26 | * Mock implementation of a ConnectionProvider
27 | * that keeps track of the order of it methods calls
28 | *
29 | * @author adahanne
30 | */
31 | public class MockConnectionProvider implements ConnectionProvider {
32 |
33 | private String customProperty;
34 | public static List methodsCalled = new ArrayList();
35 |
36 | public Connection getConnection() throws SQLException {
37 | methodsCalled.add("getConnection");
38 | throw new MockSQLException("getConnection correctly called on MockConnectionProvider");
39 | }
40 |
41 | public void shutdown() throws SQLException {
42 | }
43 |
44 | public void initialize() throws SQLException {
45 | methodsCalled.add("initialize");
46 |
47 | }
48 |
49 | public void setCustomProperty(String customProperty) {
50 | methodsCalled.add("setCustomProperty("+customProperty+")");
51 | }
52 |
53 | }
54 |
55 | class MockSQLException extends SQLException{
56 | public MockSQLException(String string) {
57 | super(string);
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/impl/StdSchedulerFactoryCustomConnectionProviderTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.impl;
17 |
18 | import static org.junit.Assert.assertEquals;
19 |
20 | import org.junit.Test;
21 | import org.quartz.Scheduler;
22 | import org.quartz.SchedulerException;
23 |
24 | /**
25 | * TestCase to verify StdSchedulerFactory initializes correctly a custom ConnectionProvider
26 | *
27 | * @author adahanne
28 | *
29 | */
30 |
31 | public class StdSchedulerFactoryCustomConnectionProviderTest {
32 |
33 | @Test
34 | public void loadAndInitializeCustomConnectionProviderTest() throws SchedulerException, InterruptedException {
35 | StdSchedulerFactory factory = new StdSchedulerFactory("org/quartz/properties/quartzCustomConnectionProvider.properties");
36 | Scheduler scheduler = factory.getScheduler();
37 | try{
38 | scheduler.start();
39 | } catch(Exception e){
40 | //the mock connection provider throws a MockSQLException
41 | assertEquals("org.quartz.impl.MockSQLException",e.getCause().getCause().getClass().getName());
42 | }
43 | assertEquals("setCustomProperty(customValue)",MockConnectionProvider.methodsCalled.get(0));
44 | assertEquals("initialize",MockConnectionProvider.methodsCalled.get(1));
45 | assertEquals("getConnection",MockConnectionProvider.methodsCalled.get(2));
46 | }
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/impl/calendar/BaseCalendarTest.java:
--------------------------------------------------------------------------------
1 | package org.quartz.impl.calendar;
2 |
3 | import junit.framework.TestCase;
4 |
5 | public class BaseCalendarTest extends TestCase {
6 |
7 | public void testClone() {
8 | BaseCalendar base = new BaseCalendar();
9 | BaseCalendar clone = (BaseCalendar) base.clone();
10 |
11 | assertEquals(base.getDescription(), clone.getDescription());
12 | assertEquals(base.getBaseCalendar(), clone.getBaseCalendar());
13 | assertEquals(base.getTimeZone(), clone.getTimeZone());
14 | }
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/impl/jdbcjobstore/JdbcJobStoreTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.impl.jdbcjobstore;
17 |
18 | import java.sql.SQLException;
19 | import java.util.HashMap;
20 |
21 | import org.quartz.AbstractJobStoreTest;
22 | import org.quartz.spi.JobStore;
23 |
24 | public class JdbcJobStoreTest extends AbstractJobStoreTest {
25 |
26 | private HashMap stores = new HashMap();
27 |
28 | public void testNothing() {
29 | // nothing
30 | }
31 |
32 | @Override
33 | protected JobStore createJobStore(String name) {
34 | try {
35 | JdbcQuartzTestUtilities.createDatabase(name);
36 | JobStoreTX jdbcJobStore = new JobStoreTX();
37 | jdbcJobStore.setDataSource(name);
38 | jdbcJobStore.setTablePrefix("QRTZ_");
39 | jdbcJobStore.setInstanceId("SINGLE_NODE_TEST");
40 | jdbcJobStore.setInstanceName(name);
41 | jdbcJobStore.setUseDBLocks(true);
42 |
43 | stores.put(name, jdbcJobStore);
44 |
45 | return jdbcJobStore;
46 | } catch (SQLException e) {
47 | throw new AssertionError(e);
48 | }
49 | }
50 |
51 | @Override
52 | protected void destroyJobStore(String name) {
53 | try {
54 | JobStoreSupport jdbcJobStore = stores.remove(name);
55 | jdbcJobStore.shutdown();
56 |
57 | JdbcQuartzTestUtilities.destroyDatabase(name);
58 | } catch (SQLException e) {
59 | throw new AssertionError(e);
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/impl/matchers/GroupMatcherTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | *
16 | */
17 | package org.quartz.impl.matchers;
18 |
19 | import junit.framework.Assert;
20 | import junit.framework.TestCase;
21 | import org.quartz.JobKey;
22 | import org.quartz.TriggerKey;
23 |
24 | import static org.quartz.JobKey.jobKey;
25 | import static org.quartz.TriggerKey.triggerKey;
26 | import static org.quartz.impl.matchers.GroupMatcher.anyJobGroup;
27 | import static org.quartz.impl.matchers.GroupMatcher.anyTriggerGroup;
28 |
29 | /**
30 | * Unit test for CronScheduleBuilder.
31 | *
32 | * @author jhouse
33 | *
34 | */
35 | public class GroupMatcherTest extends TestCase {
36 |
37 | public void testAnyGroupMatchers() {
38 |
39 | TriggerKey tKey = triggerKey("booboo", "baz");
40 | JobKey jKey = jobKey("frumpwomp", "bazoo");
41 |
42 | GroupMatcher tgm = anyTriggerGroup();
43 | GroupMatcher jgm = anyJobGroup();
44 |
45 | Assert.assertTrue("Expected match on trigger group", tgm.isMatch(tKey));
46 | Assert.assertTrue("Expected match on job group", jgm.isMatch(jKey));
47 |
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/integrations/tests/HelloJob.java:
--------------------------------------------------------------------------------
1 | package org.quartz.integrations.tests;
2 |
3 | /*
4 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 | * use this file except in compliance with the License. You may obtain a copy
8 | * of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 | * License for the specific language governing permissions and limitations
16 | * under the License.
17 | *
18 | */
19 |
20 | import java.util.Date;
21 |
22 | import org.quartz.Job;
23 | import org.quartz.JobExecutionContext;
24 | import org.quartz.JobExecutionException;
25 | import org.slf4j.Logger;
26 | import org.slf4j.LoggerFactory;
27 |
28 | /**
29 | *
30 | * This is just a simple job that says "Hello" to the world.
31 | *
32 | *
33 | * @author Bill Kratzer
34 | */
35 | public class HelloJob implements Job {
36 |
37 | private static Logger _log = LoggerFactory.getLogger(HelloJob.class);
38 |
39 | /**
40 | *
41 | * Empty constructor for job initilization
42 | *
43 | *
44 | * Quartz requires a public empty constructor so that the scheduler can
45 | * instantiate the class whenever it needs.
46 | *
47 | */
48 | public HelloJob() {
49 | }
50 |
51 | /**
52 | *
53 | * Called by the {@link org.quartz.Scheduler}
when a
54 | * {@link org.quartz.Trigger}
fires that is associated with the
55 | * Job
.
56 | *
57 | *
58 | * @throws JobExecutionException
59 | * if there is an exception while executing the job.
60 | */
61 | public void execute(JobExecutionContext context) throws JobExecutionException {
62 |
63 | // Say Hello to the World and display the date/time
64 | _log.info("Hello World! - " + new Date());
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/integrations/tests/JobDataMapStorageTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.integrations.tests;
17 |
18 | import org.junit.Assert;
19 | import org.junit.Test;
20 | import org.quartz.*;
21 |
22 | import java.util.Collections;
23 | import java.util.LinkedList;
24 | import java.util.List;
25 |
26 | import static org.hamcrest.CoreMatchers.is;
27 | import static org.quartz.CronScheduleBuilder.cronSchedule;
28 | import static org.quartz.JobBuilder.newJob;
29 | import static org.quartz.TriggerBuilder.newTrigger;
30 | import static org.quartz.TriggerKey.triggerKey;
31 |
32 | /**
33 | * Created by zemian on 10/25/16.
34 | */
35 | public class JobDataMapStorageTest extends QuartzDatabaseTestSupport {
36 | @Test
37 | public void testJobDataMapDirtyFlag() throws Exception {
38 | JobDetail jobDetail = newJob(HelloJob.class)
39 | .withIdentity("test")
40 | .usingJobData("jfoo", "bar")
41 | .build();
42 |
43 | CronTrigger trigger = newTrigger()
44 | .withIdentity("test")
45 | .withSchedule(cronSchedule("0 0 0 * * ?"))
46 | .usingJobData("tfoo", "bar")
47 | .build();
48 |
49 | scheduler.scheduleJob(jobDetail, trigger);
50 |
51 | JobDetail storedJobDetail = scheduler.getJobDetail(JobKey.jobKey("test"));
52 | JobDataMap storedJobMap = storedJobDetail.getJobDataMap();
53 | Assert.assertThat(storedJobMap.isDirty(), is(false));
54 |
55 | Trigger storedTrigger = scheduler.getTrigger(triggerKey("test"));
56 | JobDataMap storedTriggerMap = storedTrigger.getJobDataMap();
57 | Assert.assertThat(storedTriggerMap.isDirty(), is(false));
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/integrations/tests/TrackingJob.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.integrations.tests;
17 |
18 | import java.util.List;
19 | import org.quartz.Job;
20 | import org.quartz.JobExecutionContext;
21 | import org.quartz.JobExecutionException;
22 | import org.quartz.Scheduler;
23 | import org.quartz.SchedulerException;
24 |
25 | /**
26 | *
27 | * @author cdennis
28 | */
29 | public class TrackingJob implements Job {
30 | public static String SCHEDULED_TIMES_KEY = "TrackingJob.ScheduledTimes";
31 | @Override
32 | public void execute(JobExecutionContext context) throws JobExecutionException {
33 | try {
34 | Scheduler scheduler = context.getScheduler();
35 | List scheduledFires = (List)scheduler.getContext().get(SCHEDULED_TIMES_KEY);
36 | scheduledFires.add(context.getScheduledFireTime().getTime());
37 | } catch (SchedulerException e) {
38 | throw new JobExecutionException(e);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/simpl/RAMJobStoreTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy
6 | * of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 | package org.quartz.simpl;
17 |
18 | import org.quartz.AbstractJobStoreTest;
19 | import org.quartz.spi.JobStore;
20 |
21 | public class RAMJobStoreTest extends AbstractJobStoreTest {
22 |
23 | @Override
24 | protected JobStore createJobStore(String name) {
25 | RAMJobStore rs = new RAMJobStore();
26 | return rs;
27 | }
28 |
29 | @Override
30 | protected void destroyJobStore(String name) {
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/utils/ClassUtilsTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.utils;
17 |
18 | import org.quartz.DisallowConcurrentExecution;
19 | import org.quartz.Job;
20 | import org.quartz.JobExecutionContext;
21 | import org.quartz.JobExecutionException;
22 | import org.quartz.PersistJobDataAfterExecution;
23 |
24 | import junit.framework.TestCase;
25 |
26 | /**
27 | * @author Alex Snaps
28 | */
29 | public class ClassUtilsTest extends TestCase {
30 |
31 | public void testIsAnnotationPresentOnSuperClass() throws Exception {
32 | assertTrue(ClassUtils.isAnnotationPresent(BaseJob.class, DisallowConcurrentExecution.class));
33 | assertFalse(ClassUtils.isAnnotationPresent(BaseJob.class, PersistJobDataAfterExecution.class));
34 | assertTrue(ClassUtils.isAnnotationPresent(ExtendedJob.class, DisallowConcurrentExecution.class));
35 | assertFalse(ClassUtils.isAnnotationPresent(ExtendedJob.class, PersistJobDataAfterExecution.class));
36 | assertTrue(ClassUtils.isAnnotationPresent(ReallyExtendedJob.class, DisallowConcurrentExecution.class));
37 | assertTrue(ClassUtils.isAnnotationPresent(ReallyExtendedJob.class, PersistJobDataAfterExecution.class));
38 | }
39 |
40 | @DisallowConcurrentExecution
41 | private static class BaseJob implements Job {
42 | public void execute(final JobExecutionContext context) throws JobExecutionException {
43 | System.out.println(this.getClass().getSimpleName());
44 | }
45 | }
46 |
47 | private static class ExtendedJob extends BaseJob {
48 | }
49 |
50 | @PersistJobDataAfterExecution
51 | private static class ReallyExtendedJob extends ExtendedJob {
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/quartz-core/src/test/java/org/quartz/utils/PropertiesParserTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.quartz.utils;
17 |
18 | import java.util.Properties;
19 |
20 | import junit.framework.TestCase;
21 |
22 | /**
23 | * Unit tests for PropertiesParser.
24 | */
25 | public class PropertiesParserTest extends TestCase {
26 |
27 | /**
28 | * Unit test for full getPropertyGroup() method.
29 | */
30 | public void testGetPropertyGroupStringBooleanStringArray() {
31 | // Test that an empty property does not cause an exception
32 | Properties props = new Properties();
33 | props.put("x.y.z", "");
34 |
35 | PropertiesParser propertiesParser = new PropertiesParser(props);
36 | Properties propGroup = propertiesParser.getPropertyGroup("x.y", true, new String[] {});
37 | assertEquals("", propGroup.getProperty("z"));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Configure logging for testing
2 | log4j.rootLogger=INFO, stdout
3 | #log4j.logger.org.quartz=DEBUG
4 |
5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
6 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
7 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
8 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/AnnualCalendar-1.5.1.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/AnnualCalendar-1.5.1.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/CalendarIntervalTriggerImpl-2.0.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/CalendarIntervalTriggerImpl-2.0.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/CronExpression-1.5.2.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/CronExpression-1.5.2.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/CronTrigger-1.5.2.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/CronTrigger-1.5.2.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/CronTriggerImpl-2.0.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/CronTriggerImpl-2.0.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/JobDataMap-1.4.5.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/JobDataMap-1.4.5.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/JobDataMap-1.5.1.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/JobDataMap-1.5.1.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/JobDataMap-2.1.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/JobDataMap-2.1.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/SimpleTrigger-1.5.2.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/SimpleTrigger-1.5.2.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/SimpleTriggerImpl-2.0.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/SimpleTriggerImpl-2.0.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/impl/calendar/DailyCalendar-1.5.2.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz-core/src/test/resources/org/quartz/impl/calendar/DailyCalendar-1.5.2.ser
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/properties/quartzCustomConnectionProvider.properties:
--------------------------------------------------------------------------------
1 | # Main Quartz configuration
2 | org.quartz.scheduler.instanceName = DatabaseScheduler
3 | org.quartz.scheduler.instanceId = NON_CLUSTERED
4 | org.quartz.scheduler.jobFactory.class = org.quartz.simpl.SimpleJobFactory
5 | org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
6 | org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
7 | org.quartz.jobStore.dataSource = quartzDataSource
8 | org.quartz.jobStore.tablePrefix = QRTZ_
9 | org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
10 | org.quartz.threadPool.threadCount = 5
11 |
12 | # JobStore: JDBC jobStoreTX
13 | org.quartz.dataSource.quartzDataSource.connectionProvider.class = org.quartz.impl.MockConnectionProvider
14 | org.quartz.dataSource.quartzDataSource.customProperty = customValue
15 |
16 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/delete-no-jobclass.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | testjob1
9 | DEFAULT
10 |
11 |
12 |
13 |
14 |
15 | job1
16 | DEFAULT
17 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
18 |
19 | foobar
20 |
21 |
22 |
23 |
24 | job1
25 | DEFAULT
26 | job1
27 | DEFAULT
28 | -1
29 | 1500
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/directives_no-overwrite_ignoredups.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 | false
13 | true
14 |
15 |
16 |
17 |
18 | job1
19 | DEFAULT
20 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
21 |
22 |
23 |
24 | job1
25 | DEFAULT
26 | job1
27 | DEFAULT
28 | -1
29 | 1500
30 |
31 |
32 |
33 |
34 | job2
35 | DEFAULT
36 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
37 |
38 |
39 | color
40 | GREEN
41 |
42 |
43 |
44 |
45 |
46 | job2
47 | DEFAULT
48 | job2
49 | DEFAULT
50 | * * * * * ?
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/directives_overwrite_no-ignoredups.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 | true
13 | false
14 |
15 |
16 |
17 |
18 | job1
19 | DEFAULT
20 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
21 |
22 |
23 |
24 | job1
25 | DEFAULT
26 | job1
27 | DEFAULT
28 | -1
29 | 1500
30 |
31 |
32 |
33 |
34 | job2
35 | DEFAULT
36 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
37 |
38 |
39 | color
40 | GREEN
41 |
42 |
43 |
44 |
45 |
46 | job2
47 | DEFAULT
48 | job2
49 | DEFAULT
50 | * * * * * ?
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/overwrite-no-jobclass.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | true
8 | false
9 |
10 |
11 |
12 |
13 | job1
14 | DEFAULT
15 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
16 |
17 | foobar
18 |
19 |
20 |
21 |
22 | job1
23 | DEFAULT
24 | job1
25 | DEFAULT
26 | -1
27 | 1500
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/quartz-test.properties:
--------------------------------------------------------------------------------
1 | org.quartz.scheduler.instanceName: DefaultQuartzScheduler
2 | org.quartz.scheduler.rmi.export: false
3 | org.quartz.scheduler.rmi.proxy: false
4 | org.quartz.scheduler.wrapJobExecutionInUserTransaction: false
5 |
6 | org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
7 | org.quartz.threadPool.threadCount: 10
8 | org.quartz.threadPool.threadPriority: 5
9 | org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
10 |
11 | org.quartz.jobStore.misfireThreshold: 60000
12 |
13 | org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
14 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/simple-job-trigger-no-repeat.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | job1
9 | DEFAULT
10 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
11 | true
12 | false
13 |
14 |
15 |
16 | job1_trigger
17 | DEFAULT
18 | job1
19 | DEFAULT
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/simple-job-trigger-with-timezones.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | job1
9 | DEFAULT
10 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
11 | true
12 | false
13 |
14 | foobar
15 |
16 |
17 |
18 |
19 | job1
20 | DEFAULT
21 | job1
22 | DEFAULT
23 | 2012-01-01T18:00:00Z
24 | 2012-01-01T22:00:00+03:00
25 | -1
26 | 1500
27 |
28 |
29 |
30 |
31 | job2
32 | DEFAULT
33 | job1
34 | DEFAULT
35 | 2012-01-01T06:00:00
36 | 2012-01-01T16:00:00-03:00
37 | -1
38 | 1500
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/org/quartz/xml/simple-job-trigger.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | job1
9 | DEFAULT
10 | org.quartz.xml.XMLSchedulingDataProcessorTest$MyJob
11 | true
12 | false
13 |
14 | foobar
15 |
16 |
17 |
18 |
19 | job1
20 | DEFAULT
21 | job1
22 | DEFAULT
23 | -1
24 | 1500
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/quartz-core/src/test/resources/tables_derby_drop.sql:
--------------------------------------------------------------------------------
1 | --
2 | -- Apache Derby scripts by Steve Stewart, updated by Ronald Pomeroy
3 | -- Based on Srinivas Venkatarangaiah's file for Cloudscape
4 | --
5 | -- Known to work with Apache Derby 10.0.2.1, or 10.6.2.1
6 | --
7 | -- Updated by Zemian Deng on 08/21/2011
8 | -- * Fixed nullable fields on qrtz_simprop_triggers table.
9 | -- * Added Derby QuickStart comments and drop tables statements.
10 | --
11 | -- DerbyDB + Quartz Quick Guide:
12 | -- * Derby comes with Oracle JDK! For Java6, it default install into C:/Program Files/Sun/JavaDB on Windows.
13 | -- 1. Create a derby.properties file under JavaDB directory, and have the following:
14 | -- derby.connection.requireAuthentication = true
15 | -- derby.authentication.provider = BUILTIN
16 | -- derby.user.quartz2=quartz2123
17 | -- 2. Start the DB server by running bin/startNetworkServer script.
18 | -- 3. On a new terminal, run bin/ij tool to bring up an SQL prompt, then run:
19 | -- connect 'jdbc:derby://localhost:1527/quartz2;user=quartz2;password=quartz2123;create=true';
20 | -- run 'quartz/docs/dbTables/tables_derby.sql';
21 | -- Now in quartz.properties, you may use these properties:
22 | -- org.quartz.dataSource.quartzDataSource.driver = org.apache.derby.jdbc.ClientDriver
23 | -- org.quartz.dataSource.quartzDataSource.URL = jdbc:derby://localhost:1527/quartz2
24 | -- org.quartz.dataSource.quartzDataSource.user = quartz2
25 | -- org.quartz.dataSource.quartzDataSource.password = quartz2123
26 | --
27 |
28 | -- Auto drop and reset tables
29 | -- Derby doesn't support if exists condition on table drop, so user must manually do this step if needed to.
30 | drop table qrtz_fired_triggers;
31 | drop table qrtz_paused_trigger_grps;
32 | drop table qrtz_scheduler_state;
33 | drop table qrtz_locks;
34 | drop table qrtz_simple_triggers;
35 | drop table qrtz_simprop_triggers;
36 | drop table qrtz_cron_triggers;
37 | drop table qrtz_blob_triggers;
38 | drop table qrtz_triggers;
39 | drop table qrtz_job_details;
40 | drop table qrtz_calendars;
41 |
42 |
--------------------------------------------------------------------------------
/quartz-readme.adoc:
--------------------------------------------------------------------------------
1 | == Quartz Scheduler
2 |
3 | Quartz is a richly featured, open source job scheduling library that can be
4 | integrated within virtually any Java application - from the smallest stand-alone
5 | application to the largest e-commerce system.
6 |
7 | See <>
8 |
9 | Status of the build:
10 | [link="https://dev.azure.com/TerracottaCI/quartz/_build/latest?definitionId=24"]
11 | image::https://dev.azure.com/TerracottaCI/quartz/_apis/build/status/quartz-scheduler.quartz[Build Status]
12 |
13 | == Quick Links
14 |
15 | * <>
16 | * <>
17 | * <>
18 | * <>
19 | * <>
20 | * <>
21 | * <>
22 |
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testBaseCalendarAndComplex.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testBaseCalendarAndComplex.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testBaseCalendarAndComplex.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testBaseCalendarAndComplex.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseComplex.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseComplex.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseComplex.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseComplex.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseSimple.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseSimple.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseSimple.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/AnnualCalendarSerializationTest.testNoBaseSimple.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testConstructed.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testConstructed.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testConstructed.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testConstructed.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testConstructed.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testConstructed.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testFired.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testFired.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testFired.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testFired.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testFired.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CalendarIntervalTriggerImplSerializationTest.testFired.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronCalendarSerializationTest.testWithBase.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronCalendarSerializationTest.testWithBase.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronCalendarSerializationTest.testWithTimezone.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronCalendarSerializationTest.testWithTimezone.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronCalendarSerializationTest.testWithoutBase.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronCalendarSerializationTest.testWithoutBase.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronExpressionSerializationTest.testComplexCron.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronExpressionSerializationTest.testComplexCron.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronExpressionSerializationTest.testCronWithTimeZone.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronExpressionSerializationTest.testCronWithTimeZone.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronExpressionSerializationTest.testSimpleCron.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronExpressionSerializationTest.testSimpleCron.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testConstructed.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testConstructed.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testConstructed.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testConstructed.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testConstructed.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testConstructed.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testFired.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testFired.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testFired.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testFired.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testFired.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/CronTriggerImplSerializationTest.testFired.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyCalendarSerializationTest.testWithBaseCalendar.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyCalendarSerializationTest.testWithBaseCalendar.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyCalendarSerializationTest.testWithEverything.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyCalendarSerializationTest.testWithEverything.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyCalendarSerializationTest.testWithoutBaseCalendar.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyCalendarSerializationTest.testWithoutBaseCalendar.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testConstructed.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testConstructed.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testConstructed.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testConstructed.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testConstructed.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testConstructed.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK17_1.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK17_1.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK17_2.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK17_2.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/DailyTimeIntervalTriggerImplSerializationTest.testFired.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/FiredTriggerSerializationTest.testSimple.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/FiredTriggerSerializationTest.testSimple.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testExtendedProperties.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testExtendedProperties.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testNoDaysExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testNoDaysExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testOneDayExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testOneDayExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testTwoDaysExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/HolidayCalendarSerializationTest.testTwoDaysExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyAllowTransientsMap.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyAllowTransientsMap.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyAllowTransientsMap.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyAllowTransientsMap.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyAllowTransientsMap.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyAllowTransientsMap.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyMap.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyMap.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyMap.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyMap.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyMap.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testEmptyMap.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testOccupiedCleanMap.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testOccupiedCleanMap.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testOccupiedDirtyMap.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDataMapSerializationTest.testOccupiedDirtyMap.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDetailImplSerializationTest.testComplex.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDetailImplSerializationTest.testComplex.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobDetailImplSerializationTest.testMinimal.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobDetailImplSerializationTest.testMinimal.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobKeySerializationTest.testWithGroup.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobKeySerializationTest.testWithGroup.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobKeySerializationTest.testWithoutGroup.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobKeySerializationTest.testWithoutGroup.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/JobWrapperSerializationTest.testSimple.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/JobWrapperSerializationTest.testSimple.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testAllDaysExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testAllDaysExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testAllDaysExcluded.ser.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testAllDaysExcluded.ser.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testDefaultExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testDefaultExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testExtendedProperties.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testExtendedProperties.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testNoDaysExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/MonthlyCalendarSerializationTest.testNoDaysExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testConstructed.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testConstructed.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testConstructed.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testConstructed.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testConstructed.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testConstructed.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testFired.JDK16.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testFired.JDK16.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testFired.JDK17.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testFired.JDK17.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testFired.JDK18.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/SimpleTriggerImplSerializationTest.testFired.JDK18.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TimeOfDaySerializationTest.testEagle.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TimeOfDaySerializationTest.testEagle.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TimeOfDaySerializationTest.testMidday.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TimeOfDaySerializationTest.testMidday.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TimeOfDaySerializationTest.testMidnight.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TimeOfDaySerializationTest.testMidnight.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TimeTriggerSerializationTest.testSimple.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TimeTriggerSerializationTest.testSimple.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TriggerKeySerializationTest.testWithGroup.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TriggerKeySerializationTest.testWithGroup.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TriggerKeySerializationTest.testWithoutGroup.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TriggerKeySerializationTest.testWithoutGroup.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TriggerWrapperSerializationTest.testAcquired.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TriggerWrapperSerializationTest.testAcquired.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/TriggerWrapperSerializationTest.testSimple.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/TriggerWrapperSerializationTest.testSimple.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testAllDaysExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testAllDaysExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testDefaultExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testDefaultExcluded.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testExtendedProperties.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testExtendedProperties.ser
--------------------------------------------------------------------------------
/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testNoDaysExcluded.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkcoder/quartz-explained/8d9916cf90c8ce40dc0254ce042dcf56940d967e/quartz/src/test/resources/serializedforms/WeeklyCalendarSerializationTest.testNoDaysExcluded.ser
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | 本repo是对quartz核心源码[quartz-core](https://github.com/quartz-scheduler/quartz)进行的一些说明和注解,限于水平,不足之处请多指教。
2 |
3 | ---
4 |
5 | quartz教程系列博文之前发表在[并发编程网](http://ifeve.com/quartz-tutorial-using-quartz/),现根据最新版`2.4.0`重新校对和整理后,发布在[我的博客](https://nkcoder.github.io/)上,后续会根据源码对一些核心组件进行分析。
6 |
7 | ## quartz使用教程
8 |
9 | - [quartz教程一:使用quartz](https://nkcoder.github.io/2019/03/18/quartz-tutorial-1/)
10 | - [quartz教程二:API,Job和Trigger](https://nkcoder.github.io/2019/03/18/quartz-tutorial-2/)
11 | - [quartz教程三:使用Job和JobDetail](https://nkcoder.github.io/2019/03/18/quartz-tutorial-3/)
12 | - [quartz教程四:Trigger](quartz教程四:Trigger)
13 | - [quartz教程五:SimpleTrigger](quartz教程五:SimpleTrigger)
14 | - [quartz教程六:CronTrigger](https://nkcoder.github.io/2019/03/28/quartz-tutorial-6/)
15 | - [quartz教程七:TriggerListeners与JobListeners](https://nkcoder.github.io/2019/03/29/quartz-tutorial-7/)
16 | - [quartz教程八:SchedulerListener](https://nkcoder.github.io/2019/03/29/quartz-tutorial-8/)
17 | - [quartz教程九:Job Stores](https://nkcoder.github.io/2019/04/08/quartz-tutorial-9/)
18 |
--------------------------------------------------------------------------------