redis.clients.util.Pool.close()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(90)

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

Pool.close介绍

暂无

代码示例

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

public void close() {
 pool.close();
}

代码示例来源:origin: youtongluan/sumk

void shutdown() {
    this.pool.close();
  }
}

代码示例来源:origin: AmadeusITGroup/HttpSessionReplacer

@Override
public void close() {
 jedisPool.close();
}

代码示例来源:origin: com.github.yamingd.argo/argo-redis

@Override
public void close() throws IOException {
  stopping = true;
  monitorThread.interrupt();
  if (null != this.jedisPool){
    this.jedisPool.close();
  }
}

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

public void closePool() {
  if (!jedisPool.isClosed()) {
    jedisPool.close();
  }
}

代码示例来源:origin: org.leapframework/jmms-modules-redis

@Destroy
public void destroy(){
  if (null != pool) {
    pool.close();
  }
}

代码示例来源:origin: org.datanucleus/datanucleus-cache

@Override
public void close()
{
  if (clearAtClose)
  {
    try
    {
      Jedis jedis = pool.getResource();
      jedis.flushDB();
      jedis.close();
      pool.close();
    }
    catch (Exception e)
    {
      throw new NucleusException("Error closing connection to Redis cache", e);
    }
  }
  else
  {
    try
    {
      pool.close();
    }
    catch (Exception e)
    {
      throw new NucleusException("Error closing connection to Redis cache", e);
    }
  }
}

代码示例来源:origin: org.datanucleus/datanucleus-cache

public void close()
{
  if (clearAtClose)
  {
    try
    {
      Jedis jedis = pool.getResource();
      jedis.flushDB();
      jedis.close();
      pool.close();
    }
    catch (Exception e)
    {
      throw new NucleusException("Could not close connection to Redis cache", e);
    }
  }
  else
  {
    try
    {
      pool.close();
    }
    catch (Exception e)
    {
      throw new NucleusException("Could not close connection to Redis cache", e);
    }
  }
}

代码示例来源:origin: net.oschina.j2cache/j2cache-core

/**
 * 退出 Redis 发布订阅频道
 */
@Override
public void disconnect() {
  try {
    this.publish(Command.quit());
    if(this.isSubscribed())
      this.unsubscribe();
  } finally {
    this.client.close();
    //subscribeThread will auto terminate
  }
}

相关文章