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 Summary
ConstructorsConstructorDescriptionConfigWatcher(List<String> contexts, org.apache.curator.framework.CuratorFramework source) -
Method Summary
Modifier and TypeMethodDescriptionvoidchildEvent(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.TreeCacheEvent event) voidclose()getEventDesc(org.apache.curator.framework.recipes.cache.TreeCacheEvent event) voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher) voidstart()
-
Constructor Details
-
ConfigWatcher
-
-
Method Details
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher) - Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
start
@PostConstruct public void start() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
childEvent
public void childEvent(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.TreeCacheEvent event) throws Exception - Specified by:
childEventin interfaceorg.apache.curator.framework.recipes.cache.TreeCacheListener- Throws:
Exception
-
getEventDesc
-