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
Job
s to run in, and for performing all of the work of executing theJob
, catching ANY thrown exceptions, updating theTrigger
with theJob
's completion code, etc.A
JobRunShell
instance is created by aJobRunShellFactory
on behalf of theQuartzSchedulerThread
which then runs the shell in a thread from the configuredThreadPool
when the scheduler determines that aJob
has been triggered.- Author:
- James House
- See Also:
JobRunShellFactory
,QuartzSchedulerThread
,Job
,Trigger
-
-
Field Summary
Fields Modifier and Type Field Description protected TriggerFiredBundle
firedTriggerBundle
protected JobExecutionContextImpl
jec
protected QuartzScheduler
qs
protected Scheduler
scheduler
protected boolean
shutdownRequested
-
Constructor Summary
Constructors Constructor Description JobRunShell(Scheduler scheduler, TriggerFiredBundle bndle)
Create a JobRunShell instance with the given settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
begin()
protected void
complete(boolean successfulExecution)
protected org.slf4j.Logger
getLog()
Get the
for this class's category.Logger
void
initialize(QuartzScheduler sched)
void
passivate()
void
requestShutdown()
void
run()
void
schedulerShuttingdown()
Called by the
to 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 bndle)
Create a JobRunShell instance with the given settings.
- Parameters:
scheduler
- TheScheduler
instance that should be made available within theJobExecutionContext
.
-
-
Method Detail
-
schedulerShuttingdown
public void schedulerShuttingdown()
Description copied from interface:SchedulerListener
Called by the
to inform the listener that it has begun the shutdown sequence.Scheduler
- Specified by:
schedulerShuttingdown
in interfaceSchedulerListener
- Overrides:
schedulerShuttingdown
in classSchedulerListenerSupport
-
getLog
protected org.slf4j.Logger getLog()
Description copied from class:SchedulerListenerSupport
Get the
for this class's category. This should be used by subclasses for logging.Logger
- Overrides:
getLog
in classSchedulerListenerSupport
-
initialize
public void initialize(QuartzScheduler sched) throws SchedulerException
- Throws:
SchedulerException
-
requestShutdown
public void requestShutdown()
-
run
public void run()
- Specified by:
run
in 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()
-
-