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

com.zhuang.data.redis.RedisUtils Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package com.zhuang.data.redis;

import com.zhuang.data.config.MyDataProperties;

import redis.clients.jedis.Jedis;

public class RedisUtils {

    private static volatile Jedis jedis;

    public static Jedis getJedis() {
        if (jedis == null) {
            synchronized (Jedis.class) {
                if (jedis == null) {
                    MyDataProperties myDataProperties = MyDataProperties.getInstance();
                    jedis = new Jedis(myDataProperties.getRedisHost(), myDataProperties.getRedisPort());
                }
            }
        }
        return jedis;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy