@Override public void close() throws DataAccessException { super.close(); closed = true; }
@Override public RedisSentinelConnection getSentinelConnection() { if (!hasRedisSentinelConfigured()) { throw new InvalidDataAccessResourceUsageException("No sentinels configured."); } RedisNode node = selectActiveSentinel(); RedisSentinelConnection connection = connectionCache.get(node); if (connection == null || !connection.isOpen()) { connection = getSentinelConnection(node); connectionCache.putIfAbsent(node, connection); } return connection; }
private RedisNode selectActiveSentinel() { Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing!"); for (RedisNode node : this.sentinelConfiguration.getSentinels()) { if (isActive(node)) { return node; } } throw new InvalidDataAccessApiUsageException("Could not find any active sentinels"); }
@Override public void close() throws DataAccessException { super.close(); closed = true; }
@Override public RedisSentinelConnection getSentinelConnection() { if (!hasRedisSentinelConfigured()) { throw new InvalidDataAccessResourceUsageException("No sentinels configured."); } RedisNode node = selectActiveSentinel(); RedisSentinelConnection connection = connectionCache.get(node); if (connection == null || !connection.isOpen()) { connection = getSentinelConnection(node); connectionCache.putIfAbsent(node, connection); } return connection; }
private RedisNode selectActiveSentinel() { Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing!"); for (RedisNode node : this.sentinelConfiguration.getSentinels()) { if (isActive(node)) { return node; } } throw new InvalidDataAccessApiUsageException("Could not find any active sentinels"); }
@Override public void close() throws DataAccessException { super.close(); closed = true; }
@Override public RedisSentinelConnection getSentinelConnection() { if (!hasRedisSentinelConfigured()) { throw new InvalidDataAccessResourceUsageException("No sentinels configured."); } RedisNode node = selectActiveSentinel(); RedisSentinelConnection connection = connectionCache.get(node); if (connection == null || !connection.isOpen()) { connection = getSentinelConnection(node); connectionCache.putIfAbsent(node, connection); } return connection; }
private RedisNode selectActiveSentinel() { Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing!"); for (RedisNode node : this.sentinelConfiguration.getSentinels()) { if (isActive(node)) { return node; } } throw new InvalidDataAccessApiUsageException("Could not find any active sentinels"); }
@Override public void close() throws DataAccessException { super.close(); closed = true; }
@Override public void close() throws DataAccessException { super.close(); // return the connection to the pool if (pool != null) { jedis.close(); return; } // else close the connection normally (doing the try/catch dance) Exception exc = null; try { jedis.quit(); } catch (Exception ex) { exc = ex; } try { jedis.disconnect(); } catch (Exception ex) { exc = ex; } if (exc != null) throw convertJedisAccessException(exc); }
@Override public void close() throws DataAccessException { super.close(); if (isClosed) { return; } isClosed = true; if (asyncDedicatedConn != null) { try { connectionProvider.release(asyncDedicatedConn); } catch (RuntimeException ex) { throw convertLettuceAccessException(ex); } } if (subscription != null) { if (subscription.isAlive()) { subscription.doClose(); } subscription = null; } this.dbIndex = defaultDbIndex; }
@Override public void close() throws DataAccessException { super.close(); if (isClosed) { return; } isClosed = true; if (asyncDedicatedConn != null) { try { connectionProvider.release(asyncDedicatedConn); } catch (RuntimeException ex) { throw convertLettuceAccessException(ex); } } if (subscription != null) { if (subscription.isAlive()) { subscription.doClose(); } subscription = null; } this.dbIndex = defaultDbIndex; }
@Override public void close() throws DataAccessException { super.close(); if (isClosed) { return; } isClosed = true; if (asyncDedicatedConn != null) { try { connectionProvider.release(asyncDedicatedConn); } catch (RuntimeException ex) { throw convertLettuceAccessException(ex); } } if (subscription != null) { if (subscription.isAlive()) { subscription.doClose(); } subscription = null; } this.dbIndex = defaultDbIndex; }
@Override public void close() throws DataAccessException { super.close(); // return the connection to the pool if (pool != null) { if (broken) { pool.returnBrokenResource(jedis); } else { jedis.close(); } return; } // else close the connection normally (doing the try/catch dance) Exception exc = null; try { jedis.quit(); } catch (Exception ex) { exc = ex; } try { jedis.disconnect(); } catch (Exception ex) { exc = ex; } if (exc != null) throw convertJedisAccessException(exc); }
@Override public void close() throws DataAccessException { super.close(); // return the connection to the pool if (pool != null) { if (broken) { pool.returnBrokenResource(jedis); } else { jedis.close(); } return; } // else close the connection normally (doing the try/catch dance) Exception exc = null; try { jedis.quit(); } catch (Exception ex) { exc = ex; } try { jedis.disconnect(); } catch (Exception ex) { exc = ex; } if (exc != null) throw convertJedisAccessException(exc); }