Package com.alibaba.cloud.nacos.registry
Class NacosGracefulShutdownDelegate
java.lang.Object
com.alibaba.cloud.nacos.registry.NacosGracefulShutdownDelegate
- All Implemented Interfaces:
EventListener,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
public class NacosGracefulShutdownDelegate
extends Object
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>, org.springframework.context.ApplicationContextAware
- Author:
- uuuyuqi
-
Constructor Summary
ConstructorsConstructorDescriptionNacosGracefulShutdownDelegate(NacosAutoServiceRegistration autoServiceRegistration, NacosDiscoveryProperties nacosDiscoveryProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidonApplicationEvent(org.springframework.context.event.ContextClosedEvent event) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) boolean
-
Constructor Details
-
NacosGracefulShutdownDelegate
public NacosGracefulShutdownDelegate(NacosAutoServiceRegistration autoServiceRegistration, NacosDiscoveryProperties nacosDiscoveryProperties)
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(@NonNull org.springframework.context.event.ContextClosedEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
-
doGracefulShutdown
protected void doGracefulShutdown() -
supportsAsyncExecution
public boolean supportsAsyncExecution()- Specified by:
supportsAsyncExecutionin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
-