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
Calls ContextRefresher.refresh() when a RefreshEvent is received. Only responds to RefreshEvent after receiving an ApplicationReadyEvent, as the RefreshEvents might come too early in the application lifecycle.
Author:
Spencer Gibb
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(org.springframework.boot.context.event.ApplicationReadyEvent event)
     
    void
     
    void
    onApplicationEvent(org.springframework.context.ApplicationEvent event)
     
    boolean
    supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.event.SmartApplicationListener

    getListenerId, getOrder, supportsSourceType
  • Constructor Details

  • Method Details

    • supportsEventType

      public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
      Specified by:
      supportsEventType in interface org.springframework.context.event.SmartApplicationListener
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
    • handle

      public void handle(org.springframework.boot.context.event.ApplicationReadyEvent event)
    • handle

      public void handle(RefreshEvent event)