Interface ServiceCache<T>

All Superinterfaces:
AutoCloseable, Closeable, InstanceProvider<T>, org.apache.curator.framework.listen.Listenable<ServiceCacheListener>
All Known Implementing Classes:
ServiceCacheImpl

public interface ServiceCache<T> extends Closeable, org.apache.curator.framework.listen.Listenable<ServiceCacheListener>, InstanceProvider<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the current list of instances.
    void
    The cache must be started before use
     

    Methods inherited from interface java.io.Closeable

    close

    Methods inherited from interface org.apache.curator.framework.listen.Listenable

    addListener, addListener, removeListener
  • 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