JedisPoolWriper
public class JedisPoolWriper {
/** Redis连接池对象 */
private JedisPool jedisPool;
public JedisPoolWriper(final JedisPoolConfig poolConfig, final String host,
final int port) {
try {
jedisPool = new JedisPool(poolConfig, host, port);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取Redis连接池对象
* @return
*/
public JedisPool getJedisPool() {
return jedisPool;
}
/**
* 注入Redis连接池对象
* @param jedisPool
*/
public void setJedisPool(JedisPool jedisPool) {
this.jedisPool = jedisPool;
}
}
JedisUtil
public class JedisUtil {
/**
* 缓存生存时间
*/
private final int expire = 60000;
/** 操作Key的方法 */
public Keys KEYS;
/** 对存储结构为String类型的操作