Class ConfigWatcher

java.lang.Object
org.springframework.cloud.zookeeper.config.ConfigWatcher
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.curator.framework.recipes.cache.TreeCacheListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationEventPublisherAware

public class ConfigWatcher extends Object implements Closeable, org.apache.curator.framework.recipes.cache.TreeCacheListener, org.springframework.context.ApplicationEventPublisherAware
Class that registers a TreeCache for each context. It publishes events upon element change in Zookeeper.
Since:
1.0.0
Author:
Spencer Gibb
  • Constructor Details

    • ConfigWatcher

      public ConfigWatcher(List<String> contexts, org.apache.curator.framework.CuratorFramework source)
  • Method Details

    • setApplicationEventPublisher

      public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
      Specified by:
      setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware
    • start

      @PostConstruct public void start()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • childEvent

      public void childEvent(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.TreeCacheEvent event) throws Exception
      Specified by:
      childEvent in interface org.apache.curator.framework.recipes.cache.TreeCacheListener
      Throws:
      Exception
    • getEventDesc

      public String getEventDesc(org.apache.curator.framework.recipes.cache.TreeCacheEvent event)