public class JobDetail extends Object implements IJobDetail
Conveys the detail properties of a given Job instance.
Quartz does not store an actual instance of a Job class, but
instead allows you to define an instance of one, through the use of a
JobDetail.
Jobs have a name and group associated with them, which should
uniquely identify them within a single .
IScheduler
Triggers are the 'mechanism' by which Jobs are
scheduled. Many Triggers can point to the same Job,
but a single Trigger can only point to one Job.
IJob,
JobDataMap,
ITrigger| Constructor and Description |
|---|
JobDetail()
Create a
JobDetail with no specified name or group, and the
default settings of all the other properties. |
JobDetail(JobDetail aOther) |
| Modifier and Type | Method and Description |
|---|---|
static JobDetail |
create(String name,
String group,
Class<? extends IJob> jobClass) |
boolean |
equals(Object o) |
JobDetail |
getClone() |
String |
getDescription()
Return the description given to the
Job instance by its
creator (if any). |
String |
getFullName()
Returns the 'full name' of the
JobDetail in the format
"group.name". |
String |
getGroup()
Get the group of this
Job. |
JobBuilder |
getJobBuilder()
Get a
JobBuilder that is configured to produce a
JobDetail identical to this one. |
Class<? extends IJob> |
getJobClass()
Get the instance of
Job that will be executed. |
JobDataMap |
getJobDataMap()
Get the
JobDataMap that is associated with the
Job. |
JobKey |
getKey() |
String |
getName()
Get the name of this
Job. |
int |
hashCode() |
boolean |
isConcurrentExectionDisallowed() |
boolean |
isDurable()
Whether or not the
Job should remain stored after it is
orphaned (no point to it). |
boolean |
isPersistJobDataAfterExecution() |
boolean |
requestsRecovery()
Instructs the
Scheduler whether or not the Job
should be re-executed if a 'recovery' or 'fail-over' situation is
encountered. |
void |
setDescription(String description)
Set a description for the
Job instance - may be useful for
remembering/displaying the purpose of the job, though the description has
no meaning to Quartz. |
void |
setDurability(boolean durability)
Set whether or not the
Job should remain stored after it is
orphaned (no Triggers point to it). |
void |
setGroup(String group)
Set the group of this
Job. |
void |
setJobClass(Class<? extends IJob> jobClass)
Set the instance of
Job that will be executed. |
void |
setJobDataMap(JobDataMap jobDataMap)
Set the
JobDataMap to be associated with the Job. |
void |
setKey(JobKey key) |
void |
setName(String name)
Set the name of this
Job. |
void |
setRequestsRecovery(boolean shouldRecover)
Set whether or not the the
Scheduler should re-execute the
Job if a 'recovery' or 'fail-over' situation is
encountered. |
String |
toString()
Return a simple string representation of this object.
|
public JobDetail()
JobDetail with no specified name or group, and the
default settings of all the other properties.setName(String),setGroup(String)and
setJobClass(Class)methods must be called before the job can be
placed into a ISchedulerpublic final String getName()
Job.public final void setName(String name)
Set the name of this Job.
IllegalArgumentException - if name is null or empty.public final String getGroup()
Job.public final void setGroup(String group)
Set the group of this Job.
group - if null, Scheduler.DEFAULT_GROUP will be used.IllegalArgumentException - if the group is an empty string.@Nonnull public final String getFullName()
JobDetail in the format
"group.name".@Nullable public final JobKey getKey()
getKey in interface IJobDetailpublic final String getDescription()
IJobDetailJob instance by its
creator (if any).getDescription in interface IJobDetailpublic final void setDescription(String description)
Job instance - may be useful for
remembering/displaying the purpose of the job, though the description has
no meaning to Quartz.public final Class<? extends IJob> getJobClass()
IJobDetailJob that will be executed.getJobClass in interface IJobDetailpublic final void setJobClass(Class<? extends IJob> jobClass)
Set the instance of Job that will be executed.
IllegalArgumentException - if jobClass is null or the class is not a Job.@Nonnull public JobDataMap getJobDataMap()
IJobDetailJobDataMap that is associated with the
Job.getJobDataMap in interface IJobDetailpublic void setJobDataMap(@Nullable JobDataMap jobDataMap)
JobDataMap to be associated with the Job.jobDataMap - May be null.public void setDurability(boolean durability)
Job should remain stored after it is
orphaned (no Triggers point to it).false.public void setRequestsRecovery(boolean shouldRecover)
Scheduler should re-execute the
Job if a 'recovery' or 'fail-over' situation is
encountered.false.IJobExecutionContext.isRecovering()public boolean isDurable()
IJobDetailJob should remain stored after it is
orphaned (no ITriggers point to it).false.isDurable in interface IJobDetailtrue if the Job should remain persisted after being
orphaned.public boolean isPersistJobDataAfterExecution()
isPersistJobDataAfterExecution in interface IJobDetailPersistJobDataAfterExecution annotation.PersistJobDataAfterExecutionpublic boolean isConcurrentExectionDisallowed()
isConcurrentExectionDisallowed in interface IJobDetailDisallowConcurrentExecution annotation.DisallowConcurrentExecutionpublic boolean requestsRecovery()
IJobDetail
Instructs the Scheduler whether or not the Job
should be re-executed if a 'recovery' or 'fail-over' situation is
encountered.
If not explicitly set, the default value is false.
requestsRecovery in interface IJobDetailIJobExecutionContext.isRecovering()public String toString()
Return a simple string representation of this object.
@Nonnull public JobBuilder getJobBuilder()
IJobDetailJobBuilder that is configured to produce a
JobDetail identical to this one.getJobBuilder in interface IJobDetail@Nonnull public JobDetail getClone()
getClone in interface com.helger.commons.lang.ICloneable<IJobDetail>Copyright © 2016–2021 Philip Helger. All rights reserved.