Package org.apache.curator.framework.recipes.cache

Examples of org.apache.curator.framework.recipes.cache.PathChildrenCacheListener


                    }
                }
            };
            String id = entry.addThing(cache, closer);

            PathChildrenCacheListener listener = new PathChildrenCacheListener()
            {
                @Override
                public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws RpcException
                {
                    entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
View Full Code Here


      synchronized (cacheRef) {
        if (cacheRef.get() == null) {
          CuratorFramework client = zkConnection.getClient();
          PathChildrenCache cache = new PathChildrenCache(client, Paths.CONTAINERS,
              true, ThreadUtils.newThreadFactory("ContainerCache"));
          cache.getListenable().addListener(new PathChildrenCacheListener() {

            @Override
            public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) {
              // shut down the cache if ZooKeeper connection goes away
              if (event.getType() == PathChildrenCacheEvent.Type.CONNECTION_SUSPENDED ||
View Full Code Here

                LOG.warn("Tried to create path " + path + " but got: " + e, e);
            }
        }

        apiCache = new PathChildrenCache(curatorFramework, path, false);
        apiCache.getListenable().addListener(new PathChildrenCacheListener() {
            @Override
            public void childEvent(CuratorFramework curatorFramework, PathChildrenCacheEvent event) throws Exception {
                try {
                    LOG.debug("event: " + event);
                    ChildData childData = event.getData();
View Full Code Here

            config2.start();

            final Semaphore     cacheUpdate2 = new Semaphore(0);
            config2.getPathChildrenCache().getListenable().addListener
            (
                new PathChildrenCacheListener()
                {
                    @Override
                    public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
                    {
                        cacheUpdate2.release();
View Full Code Here

TOP

Related Classes of org.apache.curator.framework.recipes.cache.PathChildrenCacheListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.