|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quartz.impl.JobExecutionContextImpl
public class JobExecutionContextImpl
| Constructor Summary | |
|---|---|
JobExecutionContextImpl(Scheduler scheduler,
TriggerFiredBundle firedBundle,
Job job)
Create a JobExcecutionContext with the given context data. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(java.lang.Object key)
Get the value with the given key from the context's data map. |
Calendar |
getCalendar()
Get a handle to the Calendar referenced by the Trigger
instance that fired the Job. |
java.util.Date |
getFireTime()
The actual time the trigger fired. |
JobDetail |
getJobDetail()
Get the JobDetail associated with the Job. |
Job |
getJobInstance()
Get the instance of the Job that was created for this
execution. |
long |
getJobRunTime()
The amount of time the job ran for (in milliseconds). |
JobDataMap |
getMergedJobDataMap()
Get the convenience JobDataMap of this execution context. |
java.util.Date |
getNextFireTime()
|
java.util.Date |
getPreviousFireTime()
|
int |
getRefireCount()
|
java.lang.Object |
getResult()
Returns the result (if any) that the Job set before its
execution completed (the type of object set as the result is entirely up
to the particular job). |
java.util.Date |
getScheduledFireTime()
The scheduled time the trigger fired for. |
Scheduler |
getScheduler()
Get a handle to the Scheduler instance that fired the
Job. |
Trigger |
getTrigger()
Get a handle to the Trigger instance that fired the
Job. |
void |
incrementRefireCount()
|
boolean |
isRecovering()
If the Job is being re-executed because of a 'recovery'
situation, this method will return true. |
void |
put(java.lang.Object key,
java.lang.Object value)
Put the specified value into the context's data map with the given key. |
void |
setJobRunTime(long jobRunTime)
|
void |
setResult(java.lang.Object result)
Set the result (if any) of the Job's execution (the type of
object set as the result is entirely up to the particular job). |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JobExecutionContextImpl(Scheduler scheduler,
TriggerFiredBundle firedBundle,
Job job)
Create a JobExcecutionContext with the given context data.
| Method Detail |
|---|
public Scheduler getScheduler()
JobExecutionContext
Get a handle to the Scheduler instance that fired the
Job.
getScheduler in interface JobExecutionContextpublic Trigger getTrigger()
JobExecutionContext
Get a handle to the Trigger instance that fired the
Job.
getTrigger in interface JobExecutionContextpublic Calendar getCalendar()
JobExecutionContext
Get a handle to the Calendar referenced by the Trigger
instance that fired the Job.
getCalendar in interface JobExecutionContextpublic boolean isRecovering()
JobExecutionContext
If the Job is being re-executed because of a 'recovery'
situation, this method will return true.
isRecovering in interface JobExecutionContextpublic void incrementRefireCount()
public int getRefireCount()
getRefireCount in interface JobExecutionContextpublic JobDataMap getMergedJobDataMap()
JobExecutionContext
Get the convenience JobDataMap of this execution context.
The JobDataMap found on this object serves as a convenience -
it is a merge of the JobDataMap found on the
JobDetail and the one found on the Trigger, with
the value in the latter overriding any same-named values in the former.
It is thus considered a 'best practice' that the execute code of a Job
retrieve data from the JobDataMap found on this object.
NOTE: Do not
expect value 'set' into this JobDataMap to somehow be set back onto a
StatefulJob's own JobDataMap.
Attempts to change the contents of this map typically result in an
IllegalStateException.
getMergedJobDataMap in interface JobExecutionContextpublic JobDetail getJobDetail()
JobExecutionContext
Get the JobDetail associated with the Job.
getJobDetail in interface JobExecutionContextpublic Job getJobInstance()
JobExecutionContext
Get the instance of the Job that was created for this
execution.
Note: The Job instance is not available through remote scheduler interfaces.
getJobInstance in interface JobExecutionContextpublic java.util.Date getFireTime()
JobExecutionContext
getFireTime in interface JobExecutionContextJobExecutionContext.getScheduledFireTime()public java.util.Date getScheduledFireTime()
JobExecutionContext
getScheduledFireTime in interface JobExecutionContextJobExecutionContext.getFireTime()public java.util.Date getPreviousFireTime()
getPreviousFireTime in interface JobExecutionContextpublic java.util.Date getNextFireTime()
getNextFireTime in interface JobExecutionContextpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object getResult()
JobExecutionContextJob set before its
execution completed (the type of object set as the result is entirely up
to the particular job).
The result itself is meaningless to Quartz, but may be informative
to or
JobListeners that are watching the job's
execution.
TriggerListeners
getResult in interface JobExecutionContextpublic void setResult(java.lang.Object result)
JobExecutionContextJob's execution (the type of
object set as the result is entirely up to the particular job).
The result itself is meaningless to Quartz, but may be informative
to or
JobListeners that are watching the job's
execution.
TriggerListeners
setResult in interface JobExecutionContextpublic long getJobRunTime()
JobExecutionContextJobListeners and TriggerListeners.
getJobRunTime in interface JobExecutionContextpublic void setJobRunTime(long jobRunTime)
jobRunTime - The jobRunTime to set.
public void put(java.lang.Object key,
java.lang.Object value)
JobExecutionContextNOTE: this data is volatile - it is lost after the job execution completes, and all TriggerListeners and JobListeners have been notified.
put in interface JobExecutionContextpublic java.lang.Object get(java.lang.Object key)
JobExecutionContext
get in interface JobExecutionContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||