Package org.apache.curator.x.discovery
Interface ServiceCache<T>
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,InstanceProvider<T>,org.apache.curator.framework.listen.Listenable<ServiceCacheListener>
- All Known Implementing Classes:
ServiceCacheImpl
public interface ServiceCache<T> extends java.io.Closeable, org.apache.curator.framework.listen.Listenable<ServiceCacheListener>, InstanceProvider<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ServiceInstance<T>>getInstances()Return the current list of instances.voidstart()The cache must be started before use
-
-
-
Method Detail
-
getInstances
java.util.List<ServiceInstance<T>> getInstances()
Return the current list of instances. NOTE: there is no guarantee of freshness. This is merely the last known list of instances. However, the list is updated via a ZooKeeper watcher so it should be fresh within a window of a second or two.- Specified by:
getInstancesin interfaceInstanceProvider<T>- Returns:
- the list
-
start
void start() throws java.lang.ExceptionThe cache must be started before use- Throws:
java.lang.Exception- errors
-
-