Package org.quartz.jobs
Class JobDetailImpl
java.lang.Object
org.quartz.jobs.JobDetailImpl
- All Implemented Interfaces:
Serializable,Cloneable,JobDetail
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 .
Scheduler
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.
- Author:
- James House, Sharada Jambula, timmolter
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate aJobDetailwith no specified name or group, and the default settings of all the other properties. -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanReturn the description given to theJobinstance by its creator (if any).Get aJobBuilderthat is configured to produce aJobDetailidentical to this one.Get the instance ofJobthat will be executed.Get theJobDataMapthat is associated with theJob.getName()Get the name of thisJob.inthashCode()booleanThe default behavior is to veto any job is currently running concurrent.voidsetDescription(String description) Set a description for theJobinstance - may be useful for remembering/displaying the purpose of the job, though the description has no meaning to Quartz.voidsetIsConcurrencyAllowed(boolean isConcurrencyAllowed) voidsetJobClass(Class<? extends Job> jobClass) Set the instance ofJobthat will be executed.voidsetJobDataMap(JobDataMap jobDataMap) Set theJobDataMapto be associated with theJob.voidSet the name of thisJob.toString()
-
Constructor Details
-
JobDetailImpl
public JobDetailImpl()Create aJobDetailwith no specified name or group, and the default settings of all the other properties.Note that the
setName(String),andinvalid @link
#setGroup(String)setJobClass(Class)methods must be called before the job can be placed into aScheduler
-
-
Method Details
-
toString
-
getName
Get the name of thisJob. -
setName
Set the name of thisJob.- Throws:
IllegalArgumentException- if name is null or empty.
-
getDescription
Description copied from interface:JobDetailReturn the description given to theJobinstance by its creator (if any).- Specified by:
getDescriptionin interfaceJobDetail- Returns:
- null if no description was set.
-
setDescription
Set a description for theJobinstance - may be useful for remembering/displaying the purpose of the job, though the description has no meaning to Quartz. -
getJobClass
Description copied from interface:JobDetailGet the instance ofJobthat will be executed.- Specified by:
getJobClassin interfaceJobDetail
-
setJobClass
Set the instance ofJobthat will be executed.- Throws:
IllegalArgumentException- if jobClass is null or the class is not aJob.
-
getJobDataMap
Description copied from interface:JobDetailGet theJobDataMapthat is associated with theJob.- Specified by:
getJobDataMapin interfaceJobDetail
-
setJobDataMap
Set theJobDataMapto be associated with theJob. -
setIsConcurrencyAllowed
public void setIsConcurrencyAllowed(boolean isConcurrencyAllowed) -
isConcurrencyAllowed
public boolean isConcurrencyAllowed()Description copied from interface:JobDetailThe default behavior is to veto any job is currently running concurrent. However, concurrent jobs can be created by setting the 'Concurrency' to true- Specified by:
isConcurrencyAllowedin interfaceJobDetail- Returns:
-
equals
-
hashCode
public int hashCode() -
clone
-
getJobBuilder
Description copied from interface:JobDetailGet aJobBuilderthat is configured to produce aJobDetailidentical to this one.- Specified by:
getJobBuilderin interfaceJobDetail
-