Example usage for org.springframework.data.redis.connection RedisConnection killClient

List of usage examples for org.springframework.data.redis.connection RedisConnection killClient

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection killClient.

Prototype

void killClient(String host, int port);

Source Link

Document

Closes a given client connection identified by host:port .

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Closes a given client connection identified by {@literal host:port}.
 * /*from w  ww .j av  a2s  . c o m*/
 * @param host of connection to close.
 * @param port of connection to close
 * @since 1.3
 */
public static void killClient(String host, int port) {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.killClient(host, port);
            return null;
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Closes a given client connection identified by {@literal host:port}.
 * /*w w w .  j  ava2 s .  c  om*/
 * @param host of connection to close.
 * @param port of connection to close
 * @since 1.3
 */
public void killClient(String host, int port) {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.killClient(host, port);
            return null;
        }
    });
}