public class QuartzSchedulerLifecycle extends Object implements org.springframework.context.SmartLifecycle
Scheduler
.
Scheduler is started after calling method start()
and after event ApplicationReadyEvent
is handled.
Scheduler
,
DefaultScheduler
,
ApplicationReadyEvent
Constructor and Description |
---|
QuartzSchedulerLifecycle(org.quartz.Scheduler scheduler)
New instance.
|
QuartzSchedulerLifecycle(org.quartz.Scheduler scheduler,
Integer startupDelay)
New instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getPhase() |
Integer |
getStartupDelay()
Gets delay of
Scheduler start. |
void |
handleApplicationReadyEvent(org.springframework.boot.context.event.ApplicationReadyEvent event)
Handled
ApplicationReadyEvent and start scheduler (if method start() was called). |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setAutoStartup(boolean autoStartup)
Set automatically start
Scheduler . |
void |
setPhase(int phase)
Set phase.
|
void |
setStartupDelay(Integer startupDelay)
Sets delay of
Scheduler start. |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
public QuartzSchedulerLifecycle(org.quartz.Scheduler scheduler)
Scheduler
.scheduler
- schedulerpublic void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
@EventListener public void handleApplicationReadyEvent(org.springframework.boot.context.event.ApplicationReadyEvent event)
ApplicationReadyEvent
and start scheduler (if method start()
was called).event
- eventpublic void setPhase(int phase)
phase
- phasepublic int getPhase()
getPhase
in interface org.springframework.context.Phased
public void setAutoStartup(boolean autoStartup)
Scheduler
.autoStartup
- true
scheduler start automatically,
false
- scheduler start after someone call method start()
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
@Nullable public Integer getStartupDelay()
Scheduler
start.NULL
- Scheduler
start immediatelyCopyright © 2018 Pivotal Software, Inc.. All rights reserved.