Class NacosContextRefresher

java.lang.Object
com.alibaba.cloud.nacos.refresh.NacosContextRefresher
All Implemented Interfaces:
EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>

public class NacosContextRefresher extends Object implements org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>, org.springframework.context.ApplicationContextAware
On application start up, NacosContextRefresher add nacos listeners to all application level dataIds, when there is a change in the data, listeners will refresh configurations.
Author:
juven.xuxb, pbting, freeman
  • Constructor Details

  • Method Details

    • getRefreshCount

      public static long getRefreshCount()
    • refreshCountIncrement

      public static void refreshCountIncrement()
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.boot.context.event.ApplicationReadyEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • getNacosConfigProperties

      public NacosConfigProperties getNacosConfigProperties()
    • setNacosConfigProperties

      public NacosContextRefresher setNacosConfigProperties(NacosConfigProperties nacosConfigProperties)
    • isRefreshEnabled

      public boolean isRefreshEnabled()