Search in sources :

Example 6 with CacheConfigException

use of com.alicp.jetcache.CacheConfigException in project jetcache by alibaba.

the class LutteceConnectionManager method reactiveCommands.

public Object reactiveCommands(AbstractRedisClient redisClient) {
    connection(redisClient);
    LutteceObjects lo = getLutteceObjectsFromMap(redisClient);
    if (lo.reactiveCommands == null) {
        if (lo.connection instanceof StatefulRedisConnection) {
            lo.reactiveCommands = ((StatefulRedisConnection) lo.connection).reactive();
        } else if (lo.connection instanceof StatefulRedisClusterConnection) {
            lo.reactiveCommands = ((StatefulRedisClusterConnection) lo.connection).reactive();
        } else {
            throw new CacheConfigException("type " + lo.connection.getClass() + " is not supported");
        }
    }
    return lo.reactiveCommands;
}
Also used : CacheConfigException(com.alicp.jetcache.CacheConfigException) StatefulRedisClusterConnection(com.lambdaworks.redis.cluster.api.StatefulRedisClusterConnection) StatefulRedisConnection(com.lambdaworks.redis.api.StatefulRedisConnection)

Aggregations

CacheConfigException (com.alicp.jetcache.CacheConfigException)6 StatefulRedisConnection (com.lambdaworks.redis.api.StatefulRedisConnection)3 StatefulRedisClusterConnection (com.lambdaworks.redis.cluster.api.StatefulRedisClusterConnection)3 Cache (com.alicp.jetcache.Cache)1 RefreshCache (com.alicp.jetcache.RefreshCache)1 EnableCache (com.alicp.jetcache.anno.EnableCache)1 EmbeddedCacheBuilder (com.alicp.jetcache.embedded.EmbeddedCacheBuilder)1 ExternalCacheBuilder (com.alicp.jetcache.external.ExternalCacheBuilder)1 Matcher (java.util.regex.Matcher)1