org.quartz.core
Class JobRunShell

java.lang.Object
  extended by org.quartz.core.JobRunShell
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
JTAJobRunShell

public class JobRunShell
extends java.lang.Object
implements java.lang.Runnable

JobRunShell instances are responsible for providing the 'safe' environment for Job s to run in, and for performing all of the work of executing the Job, catching ANY thrown exceptions, updating the Trigger with the Job's completion code, etc.

A JobRunShell instance is created by a JobRunShellFactory on behalf of the QuartzSchedulerThread which then runs the shell in a thread from the configured ThreadPool when the scheduler determines that a Job has been triggered.

Author:
James House
See Also:
JobRunShellFactory, QuartzSchedulerThread, Job, Trigger

Field Summary
protected  JobExecutionContext jec
           
protected  JobRunShellFactory jobRunShellFactory
           
protected  QuartzScheduler qs
           
protected  SchedulingContext schdCtxt
           
protected  Scheduler scheduler
           
protected  boolean shutdownRequested
           
 
Constructor Summary
JobRunShell(JobRunShellFactory jobRunShellFactory, Scheduler scheduler, SchedulingContext schdCtxt)
           Create a JobRunShell instance with the given settings.
 
Method Summary
protected  void begin()
           
protected  void complete(boolean successfulExecution)
           
 boolean completeTriggerRetryLoop(Trigger trigger, JobDetail jobDetail, int instCode)
           
protected  org.apache.commons.logging.Log getLog()
           
 void initialize(QuartzScheduler qs, TriggerFiredBundle firedBundle)
           
 void passivate()
           
 void requestShutdown()
           
 void run()
           
 boolean vetoedJobRetryLoop(Trigger trigger, JobDetail jobDetail, int instCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jec

protected JobExecutionContext jec

qs

protected QuartzScheduler qs

scheduler

protected Scheduler scheduler

schdCtxt

protected SchedulingContext schdCtxt

jobRunShellFactory

protected JobRunShellFactory jobRunShellFactory

shutdownRequested

protected boolean shutdownRequested
Constructor Detail

JobRunShell

public JobRunShell(JobRunShellFactory jobRunShellFactory,
                   Scheduler scheduler,
                   SchedulingContext schdCtxt)

Create a JobRunShell instance with the given settings.

Parameters:
jobRunShellFactory - A handle to the JobRunShellFactory that produced this JobRunShell.
scheduler - The Scheduler instance that should be made available within the JobExecutionContext.
schdCtxt - the SchedulingContext that should be used by the JobRunShell when making updates to the JobStore.
Method Detail

getLog

protected org.apache.commons.logging.Log getLog()

initialize

public void initialize(QuartzScheduler qs,
                       TriggerFiredBundle firedBundle)
                throws SchedulerException
Throws:
SchedulerException

requestShutdown

public void requestShutdown()

run

public void run()
Specified by:
run in interface java.lang.Runnable

begin

protected void begin()
              throws SchedulerException
Throws:
SchedulerException

complete

protected void complete(boolean successfulExecution)
                 throws SchedulerException
Throws:
SchedulerException

passivate

public void passivate()

completeTriggerRetryLoop

public boolean completeTriggerRetryLoop(Trigger trigger,
                                        JobDetail jobDetail,
                                        int instCode)

vetoedJobRetryLoop

public boolean vetoedJobRetryLoop(Trigger trigger,
                                  JobDetail jobDetail,
                                  int instCode)


Copyright © 2011. All Rights Reserved.