Interface defining methods for start/stop lifecycle control. The typical use case for this is to control asynchronous processing.
Can be implemented by both components (typically a Spring bean defined in a Spring {@link org.springframework.beans.factory.BeanFactory}) and containers (typically a Spring {@link ApplicationContext}). Containers will propagate start/stop signals to all components that apply.
Can be used for direct invocations or for management operations via JMX. In the latter case, the {@link org.springframework.jmx.export.MBeanExporter}will typically be defined with an {@link org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler}, restricting the visibility of activity-controlled components to the Lifecycle interface.
Note that the Lifecycle interface is only supported on top-level singleton beans. On any other component, the Lifecycle interface will remain undetected and hence ignored. Also, note that the extended {@link SmartLifecycle} interface provides more sophisticatedintegration with the container's startup and shutdown phases.
@author Juergen Hoeller
@since 2.0
@see SmartLifecycle
@see ConfigurableApplicationContext
@see org.springframework.jms.listener.AbstractMessageListenerContainer
@see org.springframework.scheduling.quartz.SchedulerFactoryBean