org.quartz
Class JobKey
java.lang.Object
org.quartz.utils.Key<JobKey>
org.quartz.JobKey
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Key>
public final class JobKey
- extends Key<JobKey>
Uniquely identifies a JobDetail
.
Keys are composed of both a name and group, and the name must be unique
within the group. If only a group is specified then the default group
name will be used.
Quartz provides a builder-style API for constructing scheduling-related
entities via a Domain-Specific Language (DSL). The DSL can best be
utilized through the usage of static imports of the methods on the classes
TriggerBuilder
, JobBuilder
,
DateBuilder
, JobKey
, TriggerKey
and the various ScheduleBuilder
implementations.
Client code can then use the DSL to write code such as this:
JobDetail job = newJob(MyJob.class)
.withIdentity("myJob")
.build();
Trigger trigger = newTrigger()
.withIdentity(triggerKey("myTrigger", "myTriggerGroup"))
.withSchedule(simpleSchedule()
.withIntervalInHours(1)
.repeatForever())
.startAt(futureDate(10, MINUTES))
.build();
scheduler.scheduleJob(job, trigger);
- See Also:
Job
,
Key.DEFAULT_GROUP
,
Serialized Form
Constructor Summary |
JobKey(java.lang.String name)
|
JobKey(java.lang.String name,
java.lang.String group)
|
Method Summary |
static JobKey |
jobKey(java.lang.String name)
|
static JobKey |
jobKey(java.lang.String name,
java.lang.String group)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
JobKey
public JobKey(java.lang.String name)
JobKey
public JobKey(java.lang.String name,
java.lang.String group)
jobKey
public static JobKey jobKey(java.lang.String name)
jobKey
public static JobKey jobKey(java.lang.String name,
java.lang.String group)
Copyright 2001-2019, Terracotta, Inc.