| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JobExecutionContext
A context bundle containing handles to various environment information, that
 is given to a JobDetailTrigger
 The JobDataMap found on this object (via the 
 getMergedJobDataMap() method) 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.
 
 JobExecutionContext s are also returned from the 
 Scheduler.getCurrentlyExecutingJobs()
 method. These are the same instances as those passed into the jobs that are
 currently executing within the scheduler. The exception to this is when your
 application is using Quartz remotely (i.e. via RMI) - in which case you get
 a clone of the JobExecutionContexts, and their references to
 the Scheduler and Job instances have been lost (a
 clone of the JobDetail is still available - just not a handle
 to the job instance that is running).
 
getScheduler(), 
getMergedJobDataMap(), 
getJobDetail(), 
Job, 
Trigger, 
JobDataMap| Method Summary | |
|---|---|
|  Object | get(Object key)Get the value with the given key from the context's data map. | 
|  Calendar | getCalendar()Get a handle to the Calendarreferenced by theTriggerinstance that fired theJob. | 
|  String | getFireInstanceId()Get the unique Id that identifies this particular firing instance of the trigger that triggered this job execution. | 
|  Date | getFireTime()The actual time the trigger fired. | 
|  JobDetail | getJobDetail()Get the JobDetailassociated with theJob. | 
|  Job | getJobInstance()Get the instance of the Jobthat was created for this
 execution. | 
|  long | getJobRunTime()The amount of time the job ran for (in milliseconds). | 
|  JobDataMap | getMergedJobDataMap()Get the convenience JobDataMapof this execution context. | 
|  Date | getNextFireTime() | 
|  Date | getPreviousFireTime() | 
|  int | getRefireCount() | 
|  Object | getResult()Returns the result (if any) that the Jobset before its 
 execution completed (the type of object set as the result is entirely up 
 to the particular job). | 
|  Date | getScheduledFireTime()The scheduled time the trigger fired for. | 
|  Scheduler | getScheduler()Get a handle to the Schedulerinstance that fired theJob. | 
|  Trigger | getTrigger()Get a handle to the Triggerinstance that fired theJob. | 
|  boolean | isRecovering()If the Jobis being re-executed because of a 'recovery'
 situation, this method will returntrue. | 
|  void | put(Object key,
    Object value)Put the specified value into the context's data map with the given key. | 
|  void | setResult(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). | 
| Method Detail | 
|---|
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.
 
Calendar getCalendar()
 Get a handle to the Calendar referenced by the Trigger
 instance that fired the Job.
 
boolean isRecovering()
 If the Job is being re-executed because of a 'recovery'
 situation, this method will return true.
 
int getRefireCount()
JobDataMap getMergedJobDataMap()
 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.
 
JobDetail getJobDetail()
 Get the JobDetail associated with the Job.
 
Job getJobInstance()
 Get the instance of the Job that was created for this
 execution.
 
Note: The Job instance is not available through remote scheduler interfaces.
Date getFireTime()
getScheduledFireTime()Date getScheduledFireTime()
getFireTime()Date getPreviousFireTime()
Date getNextFireTime()
String getFireInstanceId()
Scheduler.interrupt(String)Object getResult()
Job 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 JobListenersTriggerListeners
void setResult(Object result)
Job'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 JobListenersTriggerListeners
long getJobRunTime()
JobListeners and TriggerListeners.
void put(Object key,
         Object value)
NOTE: this data is volatile - it is lost after the job execution completes, and all TriggerListeners and JobListeners have been notified.
key - value - Object get(Object key)
key - | 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||