Interface ServiceCache<T>

All Superinterfaces:
AutoCloseable, Closeable, InstanceProvider<T>, Listenable<ServiceCacheListener>
All Known Implementing Classes:
ServiceCacheImpl

public interface ServiceCache<T> extends Closeable, Listenable<ServiceCacheListener>, InstanceProvider<T>
  • Method Details

    • getInstances

      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:
      getInstances in interface InstanceProvider<T>
      Returns:
      the list
    • start

      void start() throws Exception
      The cache must be started before use
      Throws:
      Exception - errors
    • startImmediate

      CountDownLatch startImmediate() throws Exception
      Throws:
      Exception