这样接口如何初始化,我现在总是为空
我想初始化redisManager,改使用什么方法
public class RedisUtil extends FileNameUtil{
private static Log logger = LogFactory.getLog(RedisLoginUtil.class);
private static XinHuaJedis redis;
private RedisManager redisManager;
private JedisUtil jedisUtil;
public JedisUtil getJedisUtil() {
return jedisUtil;
}
public void setJedisUtil(JedisUtil jedisUtil) {
this.jedisUtil = jedisUtil;
}
public RedisManager getRedisManager() {
return redisManager;
}
public void setRedisManager(RedisManager redisManager) {
this.redisManager = redisManager;
}
static{
XinHuaJedisFactory xhjf = new XinHuaJedisFactory();
redis = xhjf.createJedis(false, false, true, "vdisk");
}
}
------解决方案--------------------这个接口不能被new,在static中,可能会遇到无法连接的问题。