Search in sources :

Example 66 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonCodecTest method testSmile.

@Test
public void testSmile() {
    Config config = createConfig();
    config.setCodec(smileCodec);
    RedissonClient redisson = Redisson.create(config);
    test(redisson);
}
Also used : RedissonClient(org.redisson.api.RedissonClient) Config(org.redisson.config.Config) Test(org.junit.Test)

Example 67 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonCodecTest method testFst.

@Test
public void testFst() {
    Config config = createConfig();
    config.setCodec(fstCodec);
    RedissonClient redisson = Redisson.create(config);
    test(redisson);
}
Also used : RedissonClient(org.redisson.api.RedissonClient) Config(org.redisson.config.Config) Test(org.junit.Test)

Example 68 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonSessionManager method startInternal.

@Override
protected void startInternal() throws LifecycleException {
    super.startInternal();
    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 {
        redisson = Redisson.create(config);
    } catch (Exception e) {
        throw new LifecycleException(e);
    }
    setState(LifecycleState.STARTING);
}
Also used : LifecycleException(org.apache.catalina.LifecycleException) Config(org.redisson.config.Config) IOException(java.io.IOException) File(java.io.File) LifecycleException(org.apache.catalina.LifecycleException) IOException(java.io.IOException)

Aggregations

Config (org.redisson.config.Config)68 Test (org.junit.Test)51 RedissonClient (org.redisson.api.RedissonClient)44 RedisProcess (org.redisson.RedisRunner.RedisProcess)17 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)13 IOException (java.io.IOException)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 RedissonNodeConfig (org.redisson.config.RedissonNodeConfig)4 HashMap (java.util.HashMap)3 ExecutorService (java.util.concurrent.ExecutorService)3 Before (org.junit.Before)3 SerializationCodec (org.redisson.codec.SerializationCodec)3 File (java.io.File)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 LifecycleException (org.apache.catalina.LifecycleException)2 BeforeClass (org.junit.BeforeClass)2 BaseTest.createConfig (org.redisson.BaseTest.createConfig)2 RLock (org.redisson.api.RLock)2 JsonJacksonCodec (org.redisson.codec.JsonJacksonCodec)2