Class ZooCacheFactory


  • public class ZooCacheFactory
    extends Object
    A factory for ZooCache instances.
    • Constructor Detail

      • ZooCacheFactory

        public ZooCacheFactory()
    • Method Detail

      • getZooCache

        public ZooCache getZooCache​(String zooKeepers,
                                    int sessionTimeout)
        Gets a ZooCache. The same object may be returned for multiple calls with the same arguments.
        Parameters:
        zooKeepers - comma-separated list of ZooKeeper host[:port]s
        sessionTimeout - session timeout
        Returns:
        cache object
      • getZooCache

        public ZooCache getZooCache​(String zooKeepers,
                                    int sessionTimeout,
                                    org.apache.zookeeper.Watcher watcher)
        Gets a watched ZooCache. If the watcher is null, then the same (unwatched) object may be returned for multiple calls with the same remaining arguments.
        Parameters:
        zooKeepers - comma-separated list of ZooKeeper host[:port]s
        sessionTimeout - session timeout
        watcher - watcher (optional)
        Returns:
        cache object