@Test(expected = DataSourceConnectorException.class) public void startCache_WithoutPreloading_Fails_WhenNoConnected() throws DataSourceConnectorException { when(client.isConnected()).thenReturn(false); testee = new ZkNodeCacheWrapper(client, "/test", cache); testee.start(false); }
@Override public void start(final boolean buildInitial) 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(buildInitial); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={} {}", path, e); } } }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void start(final boolean buildInitial) 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(buildInitial); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={} {}", path, e); } } } }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void start(final boolean buildInitial) 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(buildInitial); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={} {}", path, e); } } } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void start(final boolean buildInitial) 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(buildInitial); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={} {}", path, e); } } } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); @Override void start(final boolean buildInitial); @Override void addListener(NodeCacheListener listener); @Override void rebuild(); @Override void close(); @Override byte[] getCurrentData(); @Override int getCurrentDataVersion(); @Override String getPath(); boolean isUseCache(); }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void start(final boolean buildInitial) 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(buildInitial); allowUseCache(); log.debug("Successfully started cache for path={}", path); } catch (Exception e) { log.error("Failed to start cache for path={} {}", path, e); } } } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); @Override void start(final boolean buildInitial); @Override void addListener(NodeCacheListener listener); @Override void rebuild(); @Override void close(); @Override byte[] getCurrentData(); @Override int getCurrentDataVersion(); @Override String getPath(); boolean isUseCache();  }