/** * Creates factory with default Redisson configuration */ public RedissonConnectionFactory() { this(Redisson.create()); }
@Override public void afterPropertiesSet() throws Exception { if (config != null) { redisson = Redisson.create(config); } }
@Override public void afterPropertiesSet() throws Exception { if (config != null) { redisson = Redisson.create(config); } }
/** * Creates factory with default Redisson configuration */ public RedissonConnectionFactory() { this(Redisson.create()); }
/** * Creates factory with default Redisson configuration */ public RedissonConnectionFactory() { this(Redisson.create()); }
@Override public void afterPropertiesSet() throws Exception { if (config != null) { redisson = Redisson.create(config); } }
@Override public void afterPropertiesSet() throws Exception { if (config != null) { redisson = Redisson.create(config); } }
/** * Creates factory with default Redisson configuration */ public RedissonConnectionFactory() { this(Redisson.create()); }
public RedissonStoreFactory() { this(Redisson.create()); }
protected RedissonClient buildClient(String configPath) throws NamingException { Config config = null; try { config = Config.fromJSON(new File(configPath), getClass().getClassLoader()); } catch (IOException e) { // trying next format try { config = Config.fromYAML(new File(configPath), getClass().getClassLoader()); } catch (IOException e1) { NamingException ex = new NamingException("Can't parse yaml config " + configPath); ex.initCause(e1); throw ex; } } try { return Redisson.create(config); } catch (Exception e) { NamingException ex = new NamingException(); ex.initCause(e); throw ex; } }
protected RedissonClient buildClient() throws LifecycleException { Config config = null; try { config = Config.fromJSON(new File(configPath), getClass().getClassLoader()); } catch (IOException e) { // trying next format try { config = Config.fromYAML(new File(configPath), getClass().getClassLoader()); } catch (IOException e1) { log.error("Can't parse json config " + configPath, e); throw new LifecycleException("Can't parse yaml config " + configPath, e1); } } try { return Redisson.create(config); } catch (Exception e) { throw new LifecycleException(e); } }
protected RedissonClient buildClient() throws LifecycleException { Config config = null; try { config = Config.fromJSON(new File(configPath), getClass().getClassLoader()); } catch (IOException e) { // trying next format try { config = Config.fromYAML(new File(configPath), getClass().getClassLoader()); } catch (IOException e1) { log.error("Can't parse json config " + configPath, e); throw new LifecycleException("Can't parse yaml config " + configPath, e1); } } try { return Redisson.create(config); } catch (Exception e) { throw new LifecycleException(e); } }
protected RedissonClient buildClient() throws LifecycleException { Config config = null; try { config = Config.fromJSON(new File(configPath), getClass().getClassLoader()); } catch (IOException e) { // trying next format try { config = Config.fromYAML(new File(configPath), getClass().getClassLoader()); } catch (IOException e1) { log.error("Can't parse json config " + configPath, e); throw new LifecycleException("Can't parse yaml config " + configPath, e1); } } try { return Redisson.create(config); } catch (Exception e) { throw new LifecycleException(e); } }
protected RedissonClient createRedissonClient(Properties properties) { Config config = null; if (!properties.containsKey(REDISSON_CONFIG_PATH)) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.json"); if (config == null) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.yaml"); } } else { String configPath = ConfigurationHelper.getString(REDISSON_CONFIG_PATH, properties); config = loadConfig(RedissonRegionFactory.class.getClassLoader(), configPath); if (config == null) { config = loadConfig(configPath); } } if (config == null) { throw new CacheException("Unable to locate Redisson configuration"); } return Redisson.create(config); }
protected RedissonClient createRedissonClient(Map properties) { Config config = null; if (!properties.containsKey(REDISSON_CONFIG_PATH)) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.json"); if (config == null) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.yaml"); } } else { String configPath = ConfigurationHelper.getString(REDISSON_CONFIG_PATH, properties); config = loadConfig(RedissonRegionFactory.class.getClassLoader(), configPath); if (config == null) { config = loadConfig(configPath); } } if (config == null) { throw new CacheException("Unable to locate Redisson configuration"); } return Redisson.create(config); }
protected RedissonClient createRedissonClient(Properties properties) { Config config = null; if (!properties.containsKey(REDISSON_CONFIG_PATH)) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.json"); if (config == null) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.yaml"); } } else { String configPath = ConfigurationHelper.getString(REDISSON_CONFIG_PATH, properties); config = loadConfig(RedissonRegionFactory.class.getClassLoader(), configPath); if (config == null) { config = loadConfig(configPath); } } if (config == null) { throw new CacheException("Unable to locate Redisson configuration"); } return Redisson.create(config); }
protected RedissonClient createRedissonClient(Properties properties) { Config config = null; if (!properties.containsKey(REDISSON_CONFIG_PATH)) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.json"); if (config == null) { config = loadConfig(RedissonRegionFactory.class.getClassLoader(), "redisson.yaml"); } } else { String configPath = ConfigurationHelper.getString(REDISSON_CONFIG_PATH, properties); config = loadConfig(RedissonRegionFactory.class.getClassLoader(), configPath); if (config == null) { config = loadConfig(configPath); } } if (config == null) { throw new CacheException("Unable to locate Redisson configuration"); } return Redisson.create(config); }
/** * Create sync/async Redisson instance with default config * * @return Redisson instance */ public static RedissonClient create() { Config config = new Config(); config.useSingleServer() .setTimeout(1000000) .setAddress("redis://127.0.0.1:6379"); // config.useMasterSlaveConnection().setMasterAddress("127.0.0.1:6379").addSlaveAddress("127.0.0.1:6389").addSlaveAddress("127.0.0.1:6399"); // config.useSentinelConnection().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26389", "127.0.0.1:26379"); // config.useClusterServers().addNodeAddress("127.0.0.1:7000"); return create(config); }
/** * Create sync/async Redisson instance with default config * * @return Redisson instance */ public static RedissonClient create() { Config config = new Config(); config.useSingleServer() .setTimeout(1000000) .setAddress("redis://127.0.0.1:6379"); // config.useMasterSlaveConnection().setMasterAddress("127.0.0.1:6379").addSlaveAddress("127.0.0.1:6389").addSlaveAddress("127.0.0.1:6399"); // config.useSentinelConnection().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26389", "127.0.0.1:26379"); // config.useClusterServers().addNodeAddress("127.0.0.1:7000"); return create(config); }
@Override public RedissonClient get() { // JDK serialization codec for now, but we can do better in speed and space final Codec codec = new SerializationCodec(); final Config redissonCfg = new Config(); redissonCfg.setCodec(codec) .useSingleServer() .setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize); return Redisson.create(redissonCfg); } }