|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
org.quartz.impl Class JobExecutionContextImpl
java.lang.Objectorg.quartz.impl.JobExecutionContextImpl
- All Implemented Interfaces:
- Serializable, JobExecutionContext
public class JobExecutionContextImpl
- extends Object
- implements Serializable, JobExecutionContext
- See Also:
- Serialized Form
| Constructor Summary | |
|---|---|
JobExecutionContextImpl(Scheduler scheduler,
org.quartz.spi.TriggerFiredBundle firedBundle,
Job job)
Create a JobExcecutionContext with the given context data. |
|
| 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 Calendar referenced by the Trigger
instance that fired the Job. |
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. |
Date |
getNextFireTime()
|
Date |
getPreviousFireTime()
|
int |
getRefireCount()
|
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). |
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(Object key,
Object value)
Put the specified value into the context's data map with the given key. |
void |
setJobRunTime(long jobRunTime)
|
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). |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
JobExecutionContextImpl
public JobExecutionContextImpl(Scheduler scheduler, org.quartz.spi.TriggerFiredBundle firedBundle, Job job)
Create a JobExcecutionContext with the given context data.
| Method Detail |
|---|
getScheduler
public Scheduler getScheduler()
- Description copied from interface:
JobExecutionContext Get a handle to the
Schedulerinstance that fired theJob.- Specified by:
getSchedulerin interfaceJobExecutionContext
getTrigger
public Trigger getTrigger()
- Description copied from interface:
JobExecutionContext Get a handle to the
Triggerinstance that fired theJob.- Specified by:
getTriggerin interfaceJobExecutionContext
getCalendar
public Calendar getCalendar()
- Description copied from interface:
JobExecutionContext Get a handle to the
Calendarreferenced by theTriggerinstance that fired theJob.- Specified by:
getCalendarin interfaceJobExecutionContext
isRecovering
public boolean isRecovering()
- Description copied from interface:
JobExecutionContext If the
Jobis 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
public JobDataMap getMergedJobDataMap()
- Description copied from interface:
JobExecutionContext Get the convenience
JobDataMapof 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
public JobDetail getJobDetail()
- Description copied from interface:
JobExecutionContext Get the
JobDetailassociated with theJob.- Specified by:
getJobDetailin interfaceJobExecutionContext
getJobInstance
public Job getJobInstance()
- Description copied from interface:
JobExecutionContext Get the instance of the
Jobthat was created for this execution.Note: The Job instance is not available through remote scheduler interfaces.
- Specified by:
getJobInstancein interfaceJobExecutionContext
getFireTime
public Date 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:
getFireTimein interfaceJobExecutionContext
- Returns:
- Returns the fireTime.
- See Also:
JobExecutionContext.getScheduledFireTime()
getScheduledFireTime
public Date 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:
getScheduledFireTimein interfaceJobExecutionContext
- Returns:
- Returns the scheduledFireTime.
- See Also:
JobExecutionContext.getFireTime()
getPreviousFireTime
public Date getPreviousFireTime()
- Specified by:
getPreviousFireTimein interfaceJobExecutionContext
getNextFireTime
public Date getNextFireTime()
- Specified by:
getNextFireTimein interfaceJobExecutionContext
toString
public String toString()
getResult
public Object getResult()
- Description copied from interface:
JobExecutionContext - 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).The result itself is meaningless to Quartz, but may be informative to
JobListeners orTriggerListeners that are watching the job's execution. - Specified by:
getResultin interfaceJobExecutionContext
- Returns:
- Returns the result.
setResult
public void setResult(Object result)
- Description copied from interface:
JobExecutionContext - 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).The result itself is meaningless to Quartz, but may be informative to
JobListeners orTriggerListeners that are watching the job's execution. - Specified by:
setResultin 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 to
JobListeners andTriggerListeners. - Specified by:
getJobRunTimein interfaceJobExecutionContext
- Returns:
- Returns the jobRunTime.
setJobRunTime
public void setJobRunTime(long jobRunTime)
- Parameters:
jobRunTime- The jobRunTime to set.
put
public void put(Object key, Object value)
- Description copied from interface:
JobExecutionContext - Put the specified value into the context's data map with the given key.
Possibly useful for sharing data between listeners and jobs.
NOTE: this data is volatile - it is lost after the job execution completes, and all TriggerListeners and JobListeners have been notified.
- Specified by:
putin interfaceJobExecutionContext
get
public Object get(Object key)
- Description copied from interface:
JobExecutionContext - Get the value with the given key from the context's data map.
- Specified by:
getin interfaceJobExecutionContext
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2001-2011, Terracotta, Inc.
org.quartz.impl.JobExecutionContextImpl