public abstract class LifecycleObjectSupport
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.context.SmartLifecycle, org.springframework.beans.factory.BeanFactoryAware
Constructor and Description |
---|
LifecycleObjectSupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
protected void |
doDestroy() |
protected void |
doStart()
Subclasses may implement this method with the start behavior.
|
protected void |
doStop()
Subclasses may implement this method with the stop behavior.
|
protected org.springframework.beans.factory.BeanFactory |
getBeanFactory()
Gets the
BeanFactory for this instance. |
int |
getPhase() |
protected org.springframework.core.task.TaskExecutor |
getTaskExecutor()
Gets the defined
TaskExecutor . |
protected org.springframework.scheduling.TaskScheduler |
getTaskScheduler()
Gets the defined
TaskScheduler . |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setAutoStartup(boolean autoStartup)
Sets the auto startup.
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setPhase(int phase)
Sets the phase.
|
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Sets the used
TaskExecutor . |
void |
setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
Sets the used
TaskScheduler . |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public final void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public final void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public final boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public final int getPhase()
getPhase
in interface org.springframework.context.Phased
public final boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public final void start()
start
in interface org.springframework.context.Lifecycle
public final void stop()
stop
in interface org.springframework.context.Lifecycle
public final void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void setAutoStartup(boolean autoStartup)
autoStartup
- the new auto startupSmartLifecycle
public void setPhase(int phase)
phase
- the new phaseSmartLifecycle
protected final org.springframework.beans.factory.BeanFactory getBeanFactory()
BeanFactory
for this instance.public void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
TaskScheduler
.taskScheduler
- the task schedulerprotected org.springframework.scheduling.TaskScheduler getTaskScheduler()
TaskScheduler
.public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
TaskExecutor
.taskExecutor
- the task executorprotected org.springframework.core.task.TaskExecutor getTaskExecutor()
TaskExecutor
.protected void onInit() throws java.lang.Exception
InitializingBean
phase. Implementor should
always call super method not to break initialization chain.java.lang.Exception
- exceptionprotected void doStart()
lifecycleLock
.protected void doStop()
lifecycleLock
.protected void doDestroy()