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

org.xson.tangyuan.cache.helper.RedisCacheHelper Maven / Gradle / Ivy

Go to download

tangyuan-cache is a tangase component in the tangyuan framework that provides technical and functional support for caching.

The newest version!
package org.xson.tangyuan.cache.helper;

import org.xson.tangyuan.cache.CacheComponent;
import org.xson.tangyuan.cache.TangYuanCache;
import org.xson.tangyuan.cache.redis.RedisCache;
import org.xson.thirdparty.redis.JedisClient;

public class RedisCacheHelper {

	/**
	 * 从系统容器中获取JedisClient实例
	 */
	public static JedisClient getJedisClient(String cacheId) {
		TangYuanCache tangYuanCache = CacheComponent.getInstance().getCache(cacheId);
		if (null != tangYuanCache) {
			RedisCache redisCache = (RedisCache) tangYuanCache;
			return redisCache.getClient();
		}
		return null;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy