spring-framework / org.springframework.context.support / DefaultLifecycleProcessor

DefaultLifecycleProcessor

open class DefaultLifecycleProcessor : LifecycleProcessor, BeanFactoryAware

Default implementation of the LifecycleProcessor strategy.

Author
Mark Fisher

Author
Juergen Hoeller

Since
3.0

Constructors

<init>

DefaultLifecycleProcessor()

Default implementation of the LifecycleProcessor strategy.

Functions

isRunning

open fun isRunning(): Boolean

onClose

open fun onClose(): Unit

onRefresh

open fun onRefresh(): Unit

setBeanFactory

open fun setBeanFactory(beanFactory: BeanFactory): Unit

setTimeoutPerShutdownPhase

open fun setTimeoutPerShutdownPhase(timeoutPerShutdownPhase: Long): Unit

Specify the maximum time allotted in milliseconds for the shutdown of any phase (group of SmartLifecycle beans with the same 'phase' value). The default value is 30 seconds.

start

open fun start(): Unit

Start all registered beans that implement Lifecycle and are not already running. Any bean that implements SmartLifecycle will be started within its 'phase', and all phases will be ordered from lowest to highest value. All beans that do not implement SmartLifecycle will be started in the default phase 0. A bean declared as a dependency of another bean will be started before the dependent bean regardless of the declared phase.

stop

open fun stop(): Unit

Stop all registered beans that implement Lifecycle and are currently running. Any bean that implements SmartLifecycle will be stopped within its 'phase', and all phases will be ordered from highest to lowest value. All beans that do not implement SmartLifecycle will be stopped in the default phase 0. A bean declared as dependent on another bean will be stopped before the dependency bean regardless of the declared phase.