|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LifecycleAwareSchedulerService
An interface that scheduler service implementations will generally be expected to implement so that they can be stopped from accepting jobs when the application is not at a point in its lifecycle where it should be running them. For example, if the plugin system has not finished coming up, then this node's scheduler should not be claiming jobs, because it would steal clustered jobs that another node in the cluster would be able to process when we know we are unlikely to be ready.
As a general rule, scheduler implementations should begin in standby() mode, where
they will not run any jobs until explicitly started. Once started, the
scheduler may be placed back into standby mode and restarted as often as needed.
The shutdown() method should only be called when the SchedulerService is
being disposed and will not be asked to start() again.
| Nested Class Summary | |
|---|---|
static class |
LifecycleAwareSchedulerService.State
A representation of the scheduler's current state. |
| Method Summary | |
|---|---|
LifecycleAwareSchedulerService.State |
getState()
Returns the scheduler service's running state. |
void |
shutdown()
Permanent shutdown of the scheduler. |
void |
standby()
Places the scheduler into standby mode. |
void |
start()
Starts the scheduler if it had never been started or had been placed in standby() mode. |
| Methods inherited from interface com.atlassian.scheduler.SchedulerService |
|---|
getJobDetails, getJobRunnerKeysForAllScheduledJobs, getJobsByJobRunnerKey, getRegisteredJobRunnerKeys, registerJobRunner, scheduleJob, scheduleJobWithGeneratedId, unregisterJobRunner, unscheduleJob |
| Method Detail |
|---|
void start()
throws SchedulerServiceException
standby() mode.
If the scheduler was already active, then the request has no effect.
SchedulerServiceException - if the scheduler cannot be started
void standby()
throws SchedulerServiceException
started
again. If the scheduler was already in standby, then the request has no effect.
SchedulerServiceException - if the scheduler cannot be be placed in standby modevoid shutdown()
@Nonnull LifecycleAwareSchedulerService.State getState()
LifecycleAwareSchedulerService.State.STANDBY
and can be moved between this state and LifecycleAwareSchedulerService.State.STANDBY freely. LifecycleAwareSchedulerService.State.SHUTDOWN is
terminal — that is, once shut down, the scheduler's state can no longer be changed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||