@Test public void testStartWithUseCacheNoConnection() throws Exception { PathChildrenCache.StartMode startMode = PathChildrenCache.StartMode.POST_INITIALIZED_EVENT; setupCacheThrowsExceptionOnStart(new KeeperException.ConnectionLossException()); testee = new ZkPathChildrenCacheWrapper(client, "/test", false, cache); testee.start(startMode); }
@Override public void start(final PathChildrenCache.StartMode startMode) throws DataSourceConnectorException { if (useCache || useCacheWhenNotConnectedToDataSource) { if (! connector.isConnected()) { throw new DataSourceConnectorException("Failed to start cache for path=" + path + " due to no connection"); } try { cache.start(startMode); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={}", path, e); } } }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public void start(final PathChildrenCache.StartMode startMode) throws DataSourceConnectorException { if (useCache || useCacheWhenNotConnectedToDataSource) { if (! connector.isConnected()) { throw new DataSourceConnectorException("Failed to start cache for path=" + path + " due to no connection"); } try { cache.start(startMode); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={}", path, e); } } } }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public void start(final PathChildrenCache.StartMode startMode) throws DataSourceConnectorException { if (useCache || useCacheWhenNotConnectedToDataSource) { if (! connector.isConnected()) { throw new DataSourceConnectorException("Failed to start cache for path=" + path + " due to no connection"); } try { cache.start(startMode); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={}", path, e); } } } ZkPathChildrenCacheWrapper(IDataSourceConnector connector,
                                      String path,
                                      boolean dataIsCompressed,
                                      PathChildrenCache cache); }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public void start(final PathChildrenCache.StartMode startMode) throws DataSourceConnectorException { if (useCache || useCacheWhenNotConnectedToDataSource) { if (! connector.isConnected()) { throw new DataSourceConnectorException("Failed to start cache for path=" + path + " due to no connection"); } try { cache.start(startMode); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={}", path, e); } } } ZkPathChildrenCacheWrapper(IDataSourceConnector connector,
                                      String path,
                                      boolean dataIsCompressed,
                                      PathChildrenCache cache); @Override void start(final PathChildrenCache.StartMode startMode); @Override void addListener(PathChildrenCacheListener listener); @Override void rebuild(); @Override void close(); @Override void rebuildNode(final String path); @Override Map<String, byte[]> getNodeIdToDataMap(); @Override byte[] getCurrentData(String fullPath); boolean isUseCache(); }
ZkPathChildrenCacheWrapper extends BaseCacheWrapper implements IPathChildrenCacheWrapper { @Override public void start(final PathChildrenCache.StartMode startMode) throws DataSourceConnectorException { if (useCache || useCacheWhenNotConnectedToDataSource) { if (! connector.isConnected()) { throw new DataSourceConnectorException("Failed to start cache for path=" + path + " due to no connection"); } try { cache.start(startMode); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={}", path, e); } } } ZkPathChildrenCacheWrapper(IDataSourceConnector connector,
                                      String path,
                                      boolean dataIsCompressed,
                                      PathChildrenCache cache); @Override void start(final PathChildrenCache.StartMode startMode); @Override void addListener(PathChildrenCacheListener listener); @Override void rebuild(); @Override void close(); @Override void rebuildNode(final String path); @Override Map<String, byte[]> getNodeIdToDataMap(); @Override byte[] getCurrentData(String fullPath); boolean isUseCache();  }