org.quartz
Class JobExecutionContext

java.lang.Object
  extended byorg.quartz.JobExecutionContext
All Implemented Interfaces:
java.io.Serializable

public class JobExecutionContext
extends java.lang.Object
implements java.io.Serializable

A context bundle containing handles to various environment information, that is given to a JobDetail instance as it is executed, and to a Trigger instance after the execution completes.

JobExecutionContexts are also returned from the Scheduler.getCurrentlyExecutingJobs() method. These are the same instances as those past 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).

Author:
James House
See Also:
Job, Trigger, Serialized Form

Constructor Summary
JobExecutionContext(Scheduler scheduler, Trigger trigger, Calendar calendar, JobDetail jobDetail, Job job, boolean recovering)
          Create a JobExcecutionContext with the given context data.
 
Method Summary
 Calendar getCalendar()
          Get a handle to the Calendar referenced by the Trigger instance that fired the Job.
 JobDetail getJobDetail()
          Get the JobDetail associated with the Job.
 Job getJobInstance()
          Get the instance of the Job that was created for this execution.
 int getRefireCount()
           
 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 isFailedOver()
          Deprecated.  
 boolean isRecovering()
          If the Job is being re-executed because of a 'recovery' situation, this method will return true.
protected  void setFailedOver(boolean failedOver)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobExecutionContext

public JobExecutionContext(Scheduler scheduler,
                           Trigger trigger,
                           Calendar calendar,
                           JobDetail jobDetail,
                           Job job,
                           boolean recovering)

Create a JobExcecutionContext with the given context data.

Method Detail

getScheduler

public Scheduler getScheduler()

Get a handle to the Scheduler instance that fired the Job.


getTrigger

public Trigger getTrigger()

Get a handle to the Trigger instance that fired the Job.


getCalendar

public Calendar getCalendar()

Get a handle to the Calendar referenced by the Trigger instance that fired the Job.


isRecovering

public boolean isRecovering()

If the Job is being re-executed because of a 'recovery' situation, this method will return true.


isFailedOver

public boolean isFailedOver()
Deprecated.  

If the Job is being re-executed because of a 'fail-over' situation, this method will return true.


setFailedOver

protected void setFailedOver(boolean failedOver)
Deprecated.  


incrementRefireCount

public void incrementRefireCount()

getRefireCount

public int getRefireCount()

getJobDetail

public JobDetail getJobDetail()

Get the JobDetail associated with the Job.


getJobInstance

public 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.



Copyright James House (c) 2001-2004