Class JobExecutionContextImpl
- All Implemented Interfaces:
Serializable
,JobExecutionContext
- See Also:
-
Constructor Summary
ConstructorDescriptionJobExecutionContextImpl
(Scheduler scheduler, TriggerFiredBundle firedBundle, Job job) Create a JobExcecutionContext with the given context data. -
Method Summary
Modifier and TypeMethodDescriptionGet a handle to theCalendar
referenced by theTrigger
instance that fired theJob
.The actual time the trigger fired.Get theJobDetail
associated with theJob
.Get the instance of theJob
that was created for this execution.long
The amount of time the job ran for (in milliseconds).Get the convenienceJobDataMap
of this execution context.int
Returns the result (if any) that theJob
set 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 theScheduler
instance that fired theJob
.Get a handle to theTrigger
instance that fired theJob
.void
boolean
If theJob
is being re-executed because of a 'recovery' situation, this method will returntrue
.void
setJobRunTime
(long jobRunTime) void
Set 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:JobExecutionContext
Get a handle to theScheduler
instance that fired theJob
.- Specified by:
getScheduler
in interfaceJobExecutionContext
-
getTrigger
Description copied from interface:JobExecutionContext
Get a handle to theTrigger
instance that fired theJob
.- Specified by:
getTrigger
in interfaceJobExecutionContext
-
getCalendar
Description copied from interface:JobExecutionContext
Get a handle to theCalendar
referenced by theTrigger
instance that fired theJob
.- Specified by:
getCalendar
in interfaceJobExecutionContext
-
isRecovering
public boolean isRecovering()Description copied from interface:JobExecutionContext
If theJob
is being re-executed because of a 'recovery' situation, this method will returntrue
.- Specified by:
isRecovering
in interfaceJobExecutionContext
-
incrementRefireCount
public void incrementRefireCount() -
getRefireCount
public int getRefireCount()- Specified by:
getRefireCount
in interfaceJobExecutionContext
-
getMergedJobDataMap
Description copied from interface:JobExecutionContext
Get the convenienceJobDataMap
of this execution context.The
JobDataMap
found on this object serves as a convenience - it is a merge of theJobDataMap
found on theJobDetail
and 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:
getMergedJobDataMap
in interfaceJobExecutionContext
-
getJobDetail
Description copied from interface:JobExecutionContext
Get theJobDetail
associated with theJob
.- Specified by:
getJobDetail
in interfaceJobExecutionContext
-
getJobInstance
Description copied from interface:JobExecutionContext
Get the instance of theJob
that was created for this execution.Note: The Job instance is not available through remote scheduler interfaces.
- Specified by:
getJobInstance
in interfaceJobExecutionContext
-
getFireTime
Description copied from interface:JobExecutionContext
The 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:
getFireTime
in interfaceJobExecutionContext
- Returns:
- Returns the fireTime.
- See Also:
-
getScheduledFireTime
Description copied from interface:JobExecutionContext
The 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:
getScheduledFireTime
in interfaceJobExecutionContext
- Returns:
- Returns the scheduledFireTime.
- See Also:
-
getPreviousFireTime
- Specified by:
getPreviousFireTime
in interfaceJobExecutionContext
-
getNextFireTime
- Specified by:
getNextFireTime
in interfaceJobExecutionContext
-
toString
-
getResult
Description copied from interface:JobExecutionContext
Returns the result (if any) that theJob
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
JobListener
s
that are watching the job's execution.TriggerListener
s- Specified by:
getResult
in interfaceJobExecutionContext
- Returns:
- Returns the result.
-
setResult
Description copied from interface:JobExecutionContext
Set 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
JobListener
s
that are watching the job's execution.TriggerListener
s- Specified by:
setResult
in interfaceJobExecutionContext
-
getJobRunTime
public long getJobRunTime()Description copied from interface:JobExecutionContext
The 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 toJobListener
s andTriggerListener
s.- Specified by:
getJobRunTime
in interfaceJobExecutionContext
- Returns:
- Returns the jobRunTime.
-
setJobRunTime
public void setJobRunTime(long jobRunTime) - Parameters:
jobRunTime
- The jobRunTime to set.
-