public class ZookeeperServiceWatch extends Object implements org.springframework.context.ApplicationListener<org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent<?>>, org.apache.curator.framework.recipes.cache.TreeCacheListener, org.springframework.context.ApplicationEventPublisherAware
TreeCacheListener
that sends HeartbeatEvent
when an
entry inside Zookeeper has changed.Constructor and Description |
---|
ZookeeperServiceWatch(org.apache.curator.framework.CuratorFramework curator,
ZookeeperDiscoveryProperties properties) |
Modifier and Type | Method and Description |
---|---|
void |
childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.TreeCacheEvent event) |
org.apache.curator.framework.recipes.cache.TreeCache |
getCache() |
void |
onApplicationEvent(org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent<?> event) |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher) |
void |
stop() |
public ZookeeperServiceWatch(org.apache.curator.framework.CuratorFramework curator, ZookeeperDiscoveryProperties properties)
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
setApplicationEventPublisher
in interface org.springframework.context.ApplicationEventPublisherAware
public org.apache.curator.framework.recipes.cache.TreeCache getCache()
public void onApplicationEvent(org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent<?> event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent<?>>
@PreDestroy public void stop() throws Exception
Exception
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.