类 ParentContextCloserApplicationListener
- java.lang.Object
- org.springframework.boot.builder.ParentContextCloserApplicationListener
- 所有已实现的接口:
EventListener
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener<ParentContextApplicationContextInitializer.ParentContextAvailableEvent>
,org.springframework.core.Ordered
public class ParentContextCloserApplicationListener extends Object implements org.springframework.context.ApplicationListener<ParentContextApplicationContextInitializer.ParentContextAvailableEvent>, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered
Listener that closes the application context if its parent is closed. It listens for refresh events and grabs the current context from there, and then listens for closed events and propagates it down the hierarchy.
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
ParentContextCloserApplicationListener.ContextCloserListener
ApplicationListener
to close the context.
构造器概要
构造器 构造器 说明 ParentContextCloserApplicationListener()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected ParentContextCloserApplicationListener.ContextCloserListener
createContextCloserListener(org.springframework.context.ConfigurableApplicationContext child)
Subclasses may override to create their own subclass of ContextCloserListener.int
getOrder()
void
onApplicationEvent(ParentContextApplicationContextInitializer.ParentContextAvailableEvent event)
void
setApplicationContext(org.springframework.context.ApplicationContext context)
构造器详细资料
ParentContextCloserApplicationListener
public ParentContextCloserApplicationListener()
方法详细资料
getOrder
public int getOrder()
- 指定者:
getOrder
在接口中org.springframework.core.Ordered
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException
- 指定者:
setApplicationContext
在接口中org.springframework.context.ApplicationContextAware
- 抛出:
org.springframework.beans.BeansException
onApplicationEvent
public void onApplicationEvent(ParentContextApplicationContextInitializer.ParentContextAvailableEvent event)
- 指定者:
onApplicationEvent
在接口中org.springframework.context.ApplicationListener<ParentContextApplicationContextInitializer.ParentContextAvailableEvent>
createContextCloserListener
protected ParentContextCloserApplicationListener.ContextCloserListener createContextCloserListener(org.springframework.context.ConfigurableApplicationContext child)
Subclasses may override to create their own subclass of ContextCloserListener. This still enforces the use of a weak reference.- 参数:
child
- the child context- 返回:
- the
ParentContextCloserApplicationListener.ContextCloserListener
to use