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

com.weicoder.nosql.redis.factory.RedisFactory Maven / Gradle / Ivy

There is a newer version: 2.5.5
Show newest version
package com.weicoder.nosql.redis.factory;

import com.weicoder.common.factory.FactoryKey;
import com.weicoder.nosql.redis.Redis;
import com.weicoder.nosql.redis.impl.RedisJedis;

/**
 * RedisPool工厂
 * @author WD  
 */
public final class RedisFactory extends FactoryKey {
	// 工厂
	private final static RedisFactory FACTORY = new RedisFactory();

	/**
	 * 获得Redis
	 * @return Redis
	 */
	public static Redis getRedis() {
		return FACTORY.getInstance();
	}

	/**
	 * 获得Redis
	 * @param key 键
	 * @return Redis
	 */
	public static Redis getRedis(String key) {
		return FACTORY.getInstance(key);
	}

	/**
	 * 实例化一个新对象
	 * @param key 键
	 * @return Redis
	 */
	public Redis newInstance(String key) {
		return new RedisJedis(key);
	}

	private RedisFactory() {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy