Class RefreshEventListener
- java.lang.Object
-
- org.springframework.cloud.endpoint.event.RefreshEventListener
-
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>,org.springframework.context.event.SmartApplicationListener,org.springframework.core.Ordered
public class RefreshEventListener extends Object implements org.springframework.context.event.SmartApplicationListener
CallsContextRefresher.refresh()when aRefreshEventis received. Only responds toRefreshEventafter receiving anApplicationReadyEvent, as the RefreshEvents might come too early in the application lifecycle.- Author:
- Spencer Gibb
-
-
Constructor Summary
Constructors Constructor Description RefreshEventListener(ContextRefresher refresh)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(org.springframework.boot.context.event.ApplicationReadyEvent event)voidhandle(RefreshEvent event)voidonApplicationEvent(org.springframework.context.ApplicationEvent event)booleansupportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
-
-
-
Constructor Detail
-
RefreshEventListener
public RefreshEventListener(ContextRefresher refresh)
-
-
Method Detail
-
supportsEventType
public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
- Specified by:
supportsEventTypein interfaceorg.springframework.context.event.SmartApplicationListener
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
-
handle
public void handle(org.springframework.boot.context.event.ApplicationReadyEvent event)
-
handle
public void handle(RefreshEvent event)
-
-