|
|||||||||
| Home >> All >> org >> [ quartz overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.quartz
Class JobDetail

java.lang.Objectorg.quartz.JobDetail
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class JobDetail
- extends java.lang.Object
- implements java.lang.Cloneable, java.io.Serializable
- extends java.lang.Object
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.
Job s have a name and group associated with them, which
should uniquely identify them within a single Scheduler.
Trigger s are the 'mechanism' by which Job s
are scheduled. Many Trigger s can point to the same Job,
but a single Trigger can only point to one Job.
| Field Summary | |
private java.lang.String |
description
|
private boolean |
durability
|
private java.lang.String |
group
|
private java.lang.Class |
jobClass
|
private JobDataMap |
jobDataMap
|
private java.util.ArrayList |
jobListeners
|
private java.lang.String |
name
|
private boolean |
shouldRecover
|
private boolean |
volatility
|
| Constructor Summary | |
JobDetail()
Create a JobDetail with no specified name or group, and
the default settings of all the other properties. |
|
JobDetail(java.lang.String name,
java.lang.String group,
java.lang.Class jobClass)
Create a JobDetail with the given name, and group, and
the default settings of all the other properties. |
|
JobDetail(java.lang.String name,
java.lang.String group,
java.lang.Class jobClass,
boolean volatility,
boolean durability,
boolean recover)
Create a JobDetail with the given name, and group, and
the given settings of all the other properties. |
|
| Method Summary | |
void |
addJobListener(java.lang.String name)
Add the specified name of a JobListener to the
end of the Job's list of listeners. |
java.lang.Object |
clone()
This method may be called to create a new copy of the Object. |
java.lang.String |
getDescription()
Return the description given to the Job instance by its
creator (if any). |
java.lang.String |
getFullName()
Returns the 'full name' of the Trigger in the format
"group.name". |
java.lang.String |
getGroup()
Get the group of this Job. |
java.lang.Class |
getJobClass()
Get the instance of Job that will be executed. |
JobDataMap |
getJobDataMap()
Get the JobDataMap that is associated with the Job. |
java.lang.String[] |
getJobListenerNames()
Returns an array of String s containing the names of all
JobListener s assigned to the Job,
in the order in which they should be notified. |
java.lang.String |
getName()
Get the name of this Job. |
boolean |
isDurable()
Whether or not the Job should remain stored after it is
orphaned (no Triggers point to it). |
boolean |
isStateful()
Whether or not the Job implements the interface StatefulJob. |
boolean |
isVolatile()
Whether or not the Job should not be persisted in the
org.quartz.spi.JobStore for re-use after program
restarts. |
boolean |
removeJobListener(java.lang.String name)
Remove the specified name of a JobListener from
the Job's list of listeners. |
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(java.lang.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(java.lang.String group)
Set the group of this Job. |
void |
setJobClass(java.lang.Class jobClass)
Set the instance of Job that will be executed. |
void |
setJobDataMap(JobDataMap jobDataMap)
Set the JobDataMap to be associated with the Job. |
void |
setName(java.lang.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. |
void |
setVolatility(boolean volatility)
Set whether or not the Job should be persisted in the
org.quartz.spi.JobStore for re-use after program
restarts. |
java.lang.String |
toString()
Return a simple string representation of this object. |
void |
validate()
Validates whether the properties of the JobDetail are
valid for submission into a Scheduler. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
name
private java.lang.String name
group
private java.lang.String group
description
private java.lang.String description
jobClass
private java.lang.Class jobClass
jobDataMap
private JobDataMap jobDataMap
volatility
private boolean volatility
durability
private boolean durability
shouldRecover
private boolean shouldRecover
jobListeners
private java.util.ArrayList jobListeners
| Constructor Detail |
JobDetail
public JobDetail()
Create a
JobDetailwith no specified name or group, and the default settings of all the other properties.Note that the
setName(String)55 ,setGroup(String)55 andsetJobClass(Class)55 methods must be called before the job can be placed into a Scheduler
JobDetail
public JobDetail(java.lang.String name, java.lang.String group, java.lang.Class jobClass)
Create a
JobDetailwith the given name, and group, and the default settings of all the other properties.
JobDetail
public JobDetail(java.lang.String name, java.lang.String group, java.lang.Class jobClass, boolean volatility, boolean durability, boolean recover)
Create a
JobDetailwith the given name, and group, and the given settings of all the other properties.
| Method Detail |
getName
public java.lang.String getName()
Get the name of this
Job.
setName
public void setName(java.lang.String name)
Set the name of this
Job.
getGroup
public java.lang.String getGroup()
Get the group of this
Job.
setGroup
public void setGroup(java.lang.String group)
Set the group of this
Job.
getFullName
public java.lang.String getFullName()
Returns the 'full name' of the
Triggerin the format "group.name".
getDescription
public java.lang.String getDescription()
Return the description given to the
Jobinstance by its creator (if any).
setDescription
public void setDescription(java.lang.String description)
Set a description for the
Jobinstance - may be useful for remembering/displaying the purpose of the job, though the description has no meaning to Quartz.
getJobClass
public java.lang.Class getJobClass()
Get the instance of
Jobthat will be executed.
setJobClass
public void setJobClass(java.lang.Class jobClass)
Set the instance of
Jobthat will be executed.
getJobDataMap
public JobDataMap getJobDataMap()
Get the
JobDataMapthat is associated with theJob.
setJobDataMap
public void setJobDataMap(JobDataMap jobDataMap)
Set the
JobDataMapto be associated with theJob.
validate
public void validate()
throws SchedulerException
Validates whether the properties of the
JobDetailare valid for submission into aScheduler.
setVolatility
public void setVolatility(boolean volatility)
Set whether or not the
Jobshould be persisted in theorg.quartz.spi.JobStorefor re-use after program restarts.If not explicitly set, the default value is
false.
setDurability
public void setDurability(boolean durability)
Set whether or not the
Jobshould remain stored after it is orphaned (noTriggerspoint to it).If not explicitly set, the default value is
false.
setRequestsRecovery
public void setRequestsRecovery(boolean shouldRecover)
Set whether or not the the
Schedulershould re-execute theJobif a 'recovery' or 'fail-over' situation is encountered.If not explicitly set, the default value is
false.
isVolatile
public boolean isVolatile()
Whether or not the
Jobshould not be persisted in theorg.quartz.spi.JobStorefor re-use after program restarts.If not explicitly set, the default value is
false.
isDurable
public boolean isDurable()
Whether or not the
Jobshould remain stored after it is orphaned (noTriggerspoint to it).If not explicitly set, the default value is
false.
isStateful
public boolean isStateful()
Whether or not the
Jobimplements the interfaceStatefulJob.
requestsRecovery
public boolean requestsRecovery()
Instructs the
Schedulerwhether or not theJobshould be re-executed if a 'recovery' or 'fail-over' situation is encountered.If not explicitly set, the default value is
false.
addJobListener
public void addJobListener(java.lang.String name)
Add the specified name of a
JobListenerto the end of theJob's list of listeners.
removeJobListener
public boolean removeJobListener(java.lang.String name)
Remove the specified name of a
JobListenerfrom theJob's list of listeners.
getJobListenerNames
public java.lang.String[] getJobListenerNames()
Returns an array of
Strings containing the names of allJobListeners assigned to theJob, in the order in which they should be notified.
toString
public java.lang.String toString()
Return a simple string representation of this object.
clone
public java.lang.Object clone()
- Description copied from class:
java.lang.Object - This method may be called to create a new copy of the
Object. The typical behavior is as follows:
o == o.clone()is falseo.getClass() == o.clone().getClass()is trueo.equals(o)is true
However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>
Object.equals(Object)55 .If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.
Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override this method as follows (it should never fail):
public Object clone() { try { super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.getMessage()); } }
|
|||||||||
| Home >> All >> org >> [ quartz overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.quartz.JobDetail