redis.clients.jedis.Jedis.isConnected()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(360)

本文整理了Java中redis.clients.jedis.Jedis.isConnected()方法的一些代码示例,展示了Jedis.isConnected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.isConnected()方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:isConnected

Jedis.isConnected介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public boolean isAvailable() {
  for (JedisPool jedisPool : jedisPools.values()) {
    try (Jedis jedis = jedisPool.getResource()) {
      if (jedis.isConnected()) {
        return true; // At least one single machine is available.
      }
    } catch (Throwable t) {
    }
  }
  return false;
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public boolean isAvailable() {
  for (JedisPool jedisPool : jedisPools.values()) {
    try (Jedis jedis = jedisPool.getResource()) {
      if (jedis.isConnected()) {
        return true; // At least one single machine is available.
      }
    } catch (Throwable t) {
    }
  }
  return false;
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public boolean isOpen() {
  return jedis.isConnected();
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public boolean isClosed() {
  try {
    return !jedis.isConnected();
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: spring-projects/spring-data-redis

private void init() {
  if (!jedis.isConnected()) {
    doInit(jedis);
  }
}

代码示例来源:origin: apache/apex-malhar

@Override
public boolean isConnected()
{
 return jedis != null && jedis.isConnected();
}

代码示例来源:origin: org.apache.apex/malhar-contrib

@Override
public boolean isConnected()
{
 return jedis != null && jedis.isConnected();
}

代码示例来源:origin: io.leopard/leopard-redis

@Override
public boolean isConnected() {
  return jedis.isConnected();
}

代码示例来源:origin: x-hansong/RedisHttpSession

@Override
public Boolean isConnected() {
  return jedis.isConnected();
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public boolean isOpen() {
  return jedis.isConnected();
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public boolean isClosed() {
  try {
    return !jedis.isConnected();
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: com.intoverflow.booster/booster-core

public static void closeCurrentJedis() {
  Jedis jedis = jedisLocal.get();
  if (jedis != null) {
    jedisLocal.remove();
    if (jedis.isConnected()) {
      try {
        jedis.close();
      } catch (Exception e) {
      }
    }
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

private void init() {
  if (!jedis.isConnected()) {
    doInit(jedis);
  }
}

代码示例来源:origin: apache/servicemix-bundles

private void init() {
  if (!jedis.isConnected()) {
    doInit(jedis);
  }
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public boolean isConnected() {
 String command = "isConnected";
 return instrumented(command, () -> delegated.isConnected());
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public boolean isClosed() {
  try {
    return !jedis.isConnected();
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: com.intoverflow.booster/booster-core

public static Jedis getCurrentJedis() {
  Jedis jedis = jedisLocal.get();
  if (jedis == null || !jedis.isConnected()) {
    jedis = getInstance().getJedis();
    jedisLocal.set(jedis);
  }
  return jedis;
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public boolean isConnected() {
  Jedis jedis = getJedis();
  try {
    return jedis.isConnected();
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: vakinge/jeesuite-libs

public Jedis getRedisClient(){
  Jedis jedis = (Jedis) JedisProviderFactory.getJedisProvider(DLOCK_GROUP_NAME).get();
  if(!jedis.isConnected()){
    jedis.connect();
  }
  return jedis;
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-software-nosql

private Jedis getRedisClient(RedisStore redis) {
    int port = redis.getAttribute(RedisStore.REDIS_PORT);
    String host = redis.getAttribute(RedisStore.HOSTNAME);
    Jedis client = new Jedis(host, port);
    client.connect();
    assertTrue(client.isConnected());
    return client;
  }
}

相关文章

Jedis类方法