All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gccloud.starter.plugins.cache.redis.ctg.common.CtgRedisPoolImpl Maven / Gradle / Ivy

There is a newer version: 2.3.0.RELEASE
Show newest version
package com.gccloud.starter.plugins.cache.redis.ctg.common;

import com.ctg.itrdc.cache.pool.CtgJedisPool;
import com.gccloud.starter.common.exception.GlobalException;
import com.gccloud.starter.plugins.cache.redis.common.IRedisPool;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;

/**
 * @author liuchengbiao
 * @date 2020-09-11 19:00
 */
@Service
@Slf4j
public class CtgRedisPoolImpl implements IRedisPool {

    @Autowired
    private CtgJedisPool ctgJedisPool;

    @Override
    public Jedis getResource() {
        try {
            return ctgJedisPool.getResource();
        } catch (Exception e) {
            log.error(ExceptionUtils.getStackTrace(e));
            throw new GlobalException("ctg-redis连接失败", e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy