Class JobExecutionContextImpl
- All Implemented Interfaces:
Serializable,JobExecutionContext
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJobExecutionContextImpl(Scheduler scheduler, TriggerFiredBundle firedBundle, Job job) Create a JobExcecutionContext with the given context data. -
Method Summary
Modifier and TypeMethodDescriptionGet a handle to theCalendarreferenced by theTriggerinstance that fired theJob.The actual time the trigger fired.Get theJobDetailassociated with theJob.Get the instance of theJobthat was created for this execution.longThe amount of time the job ran for (in milliseconds).Get the convenienceJobDataMapof this execution context.intReturns the result (if any) that theJobset before its execution completed (the type of object set as the result is entirely up to the particular job).The scheduled time the trigger fired for.Get a handle to theSchedulerinstance that fired theJob.Get a handle to theTriggerinstance that fired theJob.voidbooleanIf theJobis being re-executed because of a 'recovery' situation, this method will returntrue.voidsetJobRunTime(long jobRunTime) voidSet the result (if any) of theJob's execution (the type of object set as the result is entirely up to the particular job).toString()
-
Constructor Details
-
JobExecutionContextImpl
Create a JobExcecutionContext with the given context data.
-
-
Method Details
-
getScheduler
Description copied from interface:JobExecutionContextGet a handle to theSchedulerinstance that fired theJob.- Specified by:
getSchedulerin interfaceJobExecutionContext
-
getTrigger
Description copied from interface:JobExecutionContextGet a handle to theTriggerinstance that fired theJob.- Specified by:
getTriggerin interfaceJobExecutionContext
-
getCalendar
Description copied from interface:JobExecutionContextGet a handle to theCalendarreferenced by theTriggerinstance that fired theJob.- Specified by:
getCalendarin interfaceJobExecutionContext
-
isRecovering
public boolean isRecovering()Description copied from interface:JobExecutionContextIf theJobis being re-executed because of a 'recovery' situation, this method will returntrue.- Specified by:
isRecoveringin interfaceJobExecutionContext
-
incrementRefireCount
public void incrementRefireCount() -
getRefireCount
public int getRefireCount()- Specified by:
getRefireCountin interfaceJobExecutionContext
-
getMergedJobDataMap
Description copied from interface:JobExecutionContextGet the convenienceJobDataMapof this execution context.The
JobDataMapfound on this object serves as a convenience - it is a merge of theJobDataMapfound on theJobDetailand the one found on theTrigger, 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.- Specified by:
getMergedJobDataMapin interfaceJobExecutionContext
-
getJobDetail
Description copied from interface:JobExecutionContextGet theJobDetailassociated with theJob.- Specified by:
getJobDetailin interfaceJobExecutionContext
-
getJobInstance
Description copied from interface:JobExecutionContextGet the instance of theJobthat was created for this execution.Note: The Job instance is not available through remote scheduler interfaces.
- Specified by:
getJobInstancein interfaceJobExecutionContext
-
getFireTime
Description copied from interface:JobExecutionContextThe actual time the trigger fired. For instance the scheduled time may have been 10:00:00 but the actual fire time may have been 10:00:03 if the scheduler was too busy.- Specified by:
getFireTimein interfaceJobExecutionContext- Returns:
- Returns the fireTime.
- See Also:
-
getScheduledFireTime
Description copied from interface:JobExecutionContextThe scheduled time the trigger fired for. For instance the scheduled time may have been 10:00:00 but the actual fire time may have been 10:00:03 if the scheduler was too busy.- Specified by:
getScheduledFireTimein interfaceJobExecutionContext- Returns:
- Returns the scheduledFireTime.
- See Also:
-
getPreviousFireTime
- Specified by:
getPreviousFireTimein interfaceJobExecutionContext
-
getNextFireTime
- Specified by:
getNextFireTimein interfaceJobExecutionContext
-
toString
-
getResult
Description copied from interface:JobExecutionContextReturns the result (if any) that theJobset 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
orJobListenersthat are watching the job's execution.TriggerListeners- Specified by:
getResultin interfaceJobExecutionContext- Returns:
- Returns the result.
-
setResult
Description copied from interface:JobExecutionContextSet the result (if any) of theJob'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
orJobListenersthat are watching the job's execution.TriggerListeners- Specified by:
setResultin interfaceJobExecutionContext
-
getJobRunTime
public long getJobRunTime()Description copied from interface:JobExecutionContextThe amount of time the job ran for (in milliseconds). The returned value will be -1 until the job has actually completed (or thrown an exception), and is therefore generally only useful toJobListeners andTriggerListeners.- Specified by:
getJobRunTimein interfaceJobExecutionContext- Returns:
- Returns the jobRunTime.
-
setJobRunTime
public void setJobRunTime(long jobRunTime) - Parameters:
jobRunTime- The jobRunTime to set.
-