|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.JobDetail
public class 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
.
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
.
Job
,
StatefulJob
,
JobDataMap
,
Trigger
,
Serialized FormConstructor 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.Class jobClass)
Create a JobDetail with the given name, given class, default 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, group and class,
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 to the
end of the Job 's list of listeners. |
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object obj)
|
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 JobDetail 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
s assigned to the Job ,
in the order in which they should be notified. |
Key |
getKey()
|
java.lang.String |
getName()
Get the name of this Job . |
int |
hashCode()
|
boolean |
isDurable()
Whether or not the Job should remain stored after it is
orphaned (no point to it). |
boolean |
isStateful()
Whether or not the Job implements the interface . |
boolean |
isVolatile()
Whether or not the Job should not be persisted in the
for re-use after program
restarts. |
boolean |
removeJobListener(java.lang.String name)
Remove the specified name of a 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 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
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 |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JobDetail()
Create a JobDetail
with no specified name or group, and
the default settings of all the other properties.
Note that the setName(String)
,setGroup(String)
and
setJobClass(Class)
methods must be called before the job can be
placed into a Scheduler
public JobDetail(java.lang.String name, java.lang.Class jobClass)
Create a JobDetail
with the given name, given class, default group,
and the default settings of all the other properties.
group
- if null
, Scheduler.DEFAULT_GROUP will be used.
java.lang.IllegalArgumentException
- if name is null or empty, or the group is an empty string.public JobDetail(java.lang.String name, java.lang.String group, java.lang.Class jobClass)
Create a JobDetail
with the given name, group and class,
and the default settings of all the other properties.
group
- if null
, Scheduler.DEFAULT_GROUP will be used.
java.lang.IllegalArgumentException
- if name is null or empty, or the group is an empty string.public 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.
group
- if null
, Scheduler.DEFAULT_GROUP will be used.
java.lang.IllegalArgumentException
- if name is null or empty, or the group is an empty string.Method Detail |
---|
public java.lang.String getName()
Get the name of this Job
.
public void setName(java.lang.String name)
Set the name of this Job
.
java.lang.IllegalArgumentException
- if name is null or empty.public java.lang.String getGroup()
Get the group of this Job
.
public void setGroup(java.lang.String group)
Set the group of this Job
.
group
- if null
, Scheduler.DEFAULT_GROUP will be used.
java.lang.IllegalArgumentException
- if the group is an empty string.public java.lang.String getFullName()
Returns the 'full name' of the JobDetail
in the format
"group.name".
public Key getKey()
public java.lang.String getDescription()
Return the description given to the Job
instance by its
creator (if any).
public 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.
public java.lang.Class getJobClass()
Get the instance of Job
that will be executed.
public void setJobClass(java.lang.Class jobClass)
Set the instance of Job
that will be executed.
java.lang.IllegalArgumentException
- if jobClass is null or the class is not a Job
.public JobDataMap getJobDataMap()
Get the JobDataMap
that is associated with the Job
.
public void setJobDataMap(JobDataMap jobDataMap)
Set the JobDataMap
to be associated with the Job
.
public void validate() throws SchedulerException
Validates whether the properties of the JobDetail
are
valid for submission into a Scheduler
.
java.lang.IllegalStateException
- if a required property (such as Name, Group, Class) is not
set.
SchedulerException
public void setVolatility(boolean volatility)
Set whether or not the Job
should be persisted in the
for re-use after program
restarts.
JobStore
If not explicitly set, the default value is false
.
public void setDurability(boolean durability)
Set whether or not the Job
should remain stored after it
is orphaned (no
point to it).
Trigger
s
If not explicitly set, the default value is false
.
public 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.
If not explicitly set, the default value is false
.
JobExecutionContext.isRecovering()
public boolean isVolatile()
Whether or not the Job
should not be persisted in the
for re-use after program
restarts.
JobStore
If not explicitly set, the default value is false
.
true
if the Job
should be garbage
collected along with the Scheduler
.public boolean isDurable()
Whether or not the Job
should remain stored after it is
orphaned (no
point to it).
Trigger
s
If not explicitly set, the default value is false
.
true
if the Job should remain persisted after
being orphaned.public boolean isStateful()
Whether or not the Job
implements the interface
.
StatefulJob
public boolean requestsRecovery()
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
.
JobExecutionContext.isRecovering()
public void addJobListener(java.lang.String name)
Add the specified name of a
to the
end of the JobListener
Job
's list of listeners.
getJobListenerNames()
public boolean removeJobListener(java.lang.String name)
Remove the specified name of a
from
the JobListener
Job
's list of listeners.
public java.lang.String[] getJobListenerNames()
Returns an array of String
s containing the names of all
s assigned to the JobListener
Job
,
in the order in which they should be notified.
addJobListener(String)
public java.lang.String toString()
Return a simple string representation of this object.
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |