public class ServiceCacheImpl<T> extends Object implements ServiceCache<T>, org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ServiceCacheListener listener) |
void |
addListener(ServiceCacheListener listener,
Executor executor) |
void |
childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event) |
void |
close() |
List<ServiceInstance<T>> |
getInstances()
Return the current list of instances.
|
void |
removeListener(ServiceCacheListener listener) |
void |
start()
The cache must be started before use
|
public List<ServiceInstance<T>> getInstances()
ServiceCachegetInstances in interface InstanceProvider<T>getInstances in interface ServiceCache<T>public void start()
throws Exception
ServiceCachestart in interface ServiceCache<T>Exception - errorspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void addListener(ServiceCacheListener listener)
addListener in interface org.apache.curator.framework.listen.Listenable<ServiceCacheListener>public void addListener(ServiceCacheListener listener, Executor executor)
addListener in interface org.apache.curator.framework.listen.Listenable<ServiceCacheListener>public void removeListener(ServiceCacheListener listener)
removeListener in interface org.apache.curator.framework.listen.Listenable<ServiceCacheListener>public void childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)
throws Exception
childEvent in interface org.apache.curator.framework.recipes.cache.PathChildrenCacheListenerExceptionCopyright © 2011–2016 The Apache Software Foundation. All rights reserved.