@Test public void returnJedisTest() { if(jedis == null) jedis = jedisConnectionObject.getJedisResource(); jedisConnectionObject.returnJedis(jedis); assertNotNull(jedisConnectionObject.getJedisPool()); }
public void returnJedis(Jedis jedisInstance) { if (JedisConnectionObject.pool != null) { try { if (null != jedisInstance && jedisInstance.isConnected()) { if (allotedJedis != null) allotedJedis.remove(jedisInstance); logger.info("[returnJedis] Returned jedis resource: " + jedisInstance); jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } catch (JedisConnectionException e) { logger.error("JedisConnectionException occurred..."); if (jedisInstance != null && jedisInstance.isConnected()) jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } }
JedisConnectionObject { public void returnJedis(Jedis jedisInstance) { if (JedisConnectionObject.pool != null) { try { if (null != jedisInstance && jedisInstance.isConnected()) { if (allotedJedis != null) allotedJedis.remove(jedisInstance); logger.info("[returnJedis] Returned jedis resource: " + jedisInstance); jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } catch (JedisConnectionException e) { logger.error("JedisConnectionException occurred..."); if (jedisInstance != null && jedisInstance.isConnected()) jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } } }
JedisConnectionObject { public void returnJedis(Jedis jedisInstance) { if (JedisConnectionObject.pool != null) { try { if (null != jedisInstance && jedisInstance.isConnected()) { if (allotedJedis != null) allotedJedis.remove(jedisInstance); logger.info("[returnJedis] Returned jedis resource: " + jedisInstance); jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } catch (JedisConnectionException e) { logger.error("JedisConnectionException occurred..."); if (jedisInstance != null && jedisInstance.isConnected()) jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } } JedisConnectionObject(final String host, final int port);  JedisConnectionObject();  JedisConnectionObject(final int port); }
JedisConnectionObject { public void returnJedis(Jedis jedisInstance) { if (JedisConnectionObject.pool != null) { try { if (null != jedisInstance && jedisInstance.isConnected()) { if (allotedJedis != null) allotedJedis.remove(jedisInstance); logger.info("[returnJedis] Returned jedis resource: " + jedisInstance); jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } catch (JedisConnectionException e) { logger.error("JedisConnectionException occurred..."); if (jedisInstance != null && jedisInstance.isConnected()) jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } } JedisConnectionObject(final String host, final int port);  JedisConnectionObject();  JedisConnectionObject(final int port); Jedis getJedisResource(); void setJedisSubscription(Jedis jedis, boolean patternFlag); boolean getJedisSubscription(Jedis jedis); void returnJedis(Jedis jedisInstance); JedisPool getJedisPool(); JedisPoolConfig getJedisPoolConfig(); String getRedisHost(); int getRedisPort(); boolean isPoolSetup(); boolean isConnectionSetup(); void closeAll(); }
JedisConnectionObject { public void returnJedis(Jedis jedisInstance) { if (JedisConnectionObject.pool != null) { try { if (null != jedisInstance && jedisInstance.isConnected()) { if (allotedJedis != null) allotedJedis.remove(jedisInstance); logger.info("[returnJedis] Returned jedis resource: " + jedisInstance); jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } catch (JedisConnectionException e) { logger.error("JedisConnectionException occurred..."); if (jedisInstance != null && jedisInstance.isConnected()) jedisInstance.close(); jedisInstance = null; connectionSetup = false; } } } JedisConnectionObject(final String host, final int port);  JedisConnectionObject();  JedisConnectionObject(final int port); Jedis getJedisResource(); void setJedisSubscription(Jedis jedis, boolean patternFlag); boolean getJedisSubscription(Jedis jedis); void returnJedis(Jedis jedisInstance); JedisPool getJedisPool(); JedisPoolConfig getJedisPoolConfig(); String getRedisHost(); int getRedisPort(); boolean isPoolSetup(); boolean isConnectionSetup(); void closeAll(); static ConcurrentHashMap<Jedis, Boolean> allotedJedis; static String redisHost; static int redisPort; }