use of com.publiccms.common.redis.DatabaseRedisClient in project PublicCMS-preview by sanluan.
the class RedisRegionFactory method start.
@Override
public void start(SessionFactoryOptions option, Properties properties) throws CacheException {
log.debug("RedisRegionFactory is starting... ");
this.options = option;
try {
if (redisClient == null) {
String configurationResourceName = (String) properties.get("hibernate.redis.configurationResourceName");
if (null != configurationResourceName) {
Properties redisProperties = PropertiesLoaderUtils.loadAllProperties(configurationResourceName);
this.redisClient = new DatabaseRedisClient(RedisUtils.createJedisPool(redisProperties));
}
this.cacheTimestamper = createCacheTimestamper(redisClient, RedisRegionFactory.class.getName());
}
log.info("RedisRegionFactory is started.");
} catch (Exception e) {
log.error("Fail to start RedisRegionFactory.", e);
throw new CacheException(e);
}
}
use of com.publiccms.common.redis.DatabaseRedisClient in project PublicCMS-preview by sanluan.
the class SingletonRedisRegionFactory method start.
@Override
public void start(SessionFactoryOptions option, Properties properties) throws CacheException {
log.debug("SingletonRedisRegionFactory is starting...");
this.options = option;
try {
if (redisClient == null) {
String configurationResourceName = (String) properties.get("hibernate.redis.configurationResourceName");
if (CommonUtils.notEmpty(configurationResourceName)) {
Properties redisProperties = PropertiesLoaderUtils.loadAllProperties(configurationResourceName);
this.redisClient = new DatabaseRedisClient(RedisUtils.createJedisPool(redisProperties));
}
this.cacheTimestamper = createCacheTimestamper(redisClient, SingletonRedisRegionFactory.class.getName());
}
referenceCount.incrementAndGet();
log.info("RedisRegionFactory is started.");
} catch (Exception e) {
throw new CacheException(e);
}
}
Aggregations