Package org.quartz.core
Class JobRunShell
- java.lang.Object
-
- org.quartz.listeners.SchedulerListenerSupport
-
- org.quartz.core.JobRunShell
-
- All Implemented Interfaces:
java.lang.Runnable,SchedulerListener
- Direct Known Subclasses:
JTAJobRunShell
public class JobRunShell extends SchedulerListenerSupport implements java.lang.Runnable
JobRunShell instances are responsible for providing the 'safe' environment for
Jobs to run in, and for performing all of the work of executing theJob, catching ANY thrown exceptions, updating theTriggerwith theJob's completion code, etc.A
JobRunShellinstance is created by aJobRunShellFactoryon behalf of theQuartzSchedulerThreadwhich then runs the shell in a thread from the configuredThreadPoolwhen the scheduler determines that aJobhas been triggered.- Author:
- James House
- See Also:
JobRunShellFactory,QuartzSchedulerThread,Job,Trigger
-
-
Field Summary
Fields Modifier and Type Field Description protected TriggerFiredBundlefiredTriggerBundleprotected JobExecutionContextImpljecprotected QuartzSchedulerqsprotected Schedulerschedulerprotected booleanshutdownRequested
-
Constructor Summary
Constructors Constructor Description JobRunShell(Scheduler scheduler, TriggerFiredBundle bundle)Create a JobRunShell instance with the given settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbegin()protected voidcomplete(boolean successfulExecution)protected org.slf4j.LoggergetLog()Get thefor this class's category.Loggervoidinitialize(QuartzScheduler sched)voidpassivate()voidrequestShutdown()voidrun()voidschedulerShuttingdown()Called by theto inform the listener that it has begun the shutdown sequence.Scheduler-
Methods inherited from class org.quartz.listeners.SchedulerListenerSupport
jobAdded, jobDeleted, jobPaused, jobResumed, jobScheduled, jobsPaused, jobsResumed, jobUnscheduled, schedulerError, schedulerInStandbyMode, schedulerShutdown, schedulerStarted, schedulerStarting, schedulingDataCleared, triggerFinalized, triggerPaused, triggerResumed, triggersPaused, triggersResumed
-
-
-
-
Field Detail
-
jec
protected JobExecutionContextImpl jec
-
qs
protected QuartzScheduler qs
-
firedTriggerBundle
protected TriggerFiredBundle firedTriggerBundle
-
scheduler
protected Scheduler scheduler
-
shutdownRequested
protected volatile boolean shutdownRequested
-
-
Constructor Detail
-
JobRunShell
public JobRunShell(Scheduler scheduler, TriggerFiredBundle bundle)
Create a JobRunShell instance with the given settings.
- Parameters:
scheduler- TheSchedulerinstance that should be made available within theJobExecutionContext.
-
-
Method Detail
-
schedulerShuttingdown
public void schedulerShuttingdown()
Description copied from interface:SchedulerListenerCalled by the
to inform the listener that it has begun the shutdown sequence.Scheduler- Specified by:
schedulerShuttingdownin interfaceSchedulerListener- Overrides:
schedulerShuttingdownin classSchedulerListenerSupport
-
getLog
protected org.slf4j.Logger getLog()
Description copied from class:SchedulerListenerSupportGet thefor this class's category. This should be used by subclasses for logging.Logger- Overrides:
getLogin classSchedulerListenerSupport
-
initialize
public void initialize(QuartzScheduler sched) throws SchedulerException
- Throws:
SchedulerException
-
requestShutdown
public void requestShutdown()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
begin
protected void begin() throws SchedulerException- Throws:
SchedulerException
-
complete
protected void complete(boolean successfulExecution) throws SchedulerException- Throws:
SchedulerException
-
passivate
public void passivate()
-
-