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