org.hibernate.cache.spi.CacheKeysFactory#org.redisson.connection.ConnectionManager源码实例Demo

下面列出了org.hibernate.cache.spi.CacheKeysFactory#org.redisson.connection.ConnectionManager 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: redisson   文件: LiveObjectInterceptor.java
public LiveObjectInterceptor(CommandAsyncExecutor commandExecutor, ConnectionManager connectionManager,
                             RedissonLiveObjectService service, Class<?> entityClass, String idFieldName) {
    this.service = service;
    this.commandExecutor = commandExecutor;
    this.connectionManager = connectionManager;
    this.originalClass = entityClass;
    this.idFieldName = idFieldName;

    namingScheme = connectionManager.getCommandExecutor().getObjectBuilder().getNamingScheme(entityClass);

    try {
        this.idFieldType = ClassUtils.getDeclaredField(originalClass, idFieldName).getType();
    } catch (Exception e) {
        throw new IllegalArgumentException(e);
    }
}
 
源代码2 项目: redisson   文件: ConfigSupport.java
public static ConnectionManager createConnectionManager(Config configCopy) {
    UUID id = UUID.randomUUID();
    
    if (configCopy.getMasterSlaveServersConfig() != null) {
        validate(configCopy.getMasterSlaveServersConfig());
        return new MasterSlaveConnectionManager(configCopy.getMasterSlaveServersConfig(), configCopy, id);
    } else if (configCopy.getSingleServerConfig() != null) {
        validate(configCopy.getSingleServerConfig());
        return new SingleConnectionManager(configCopy.getSingleServerConfig(), configCopy, id);
    } else if (configCopy.getSentinelServersConfig() != null) {
        validate(configCopy.getSentinelServersConfig());
        return new SentinelConnectionManager(configCopy.getSentinelServersConfig(), configCopy, id);
    } else if (configCopy.getClusterServersConfig() != null) {
        validate(configCopy.getClusterServersConfig());
        return new ClusterConnectionManager(configCopy.getClusterServersConfig(), configCopy, id);
    } else if (configCopy.getReplicatedServersConfig() != null) {
        validate(configCopy.getReplicatedServersConfig());
        return new ReplicatedConnectionManager(configCopy.getReplicatedServersConfig(), configCopy, id);
    } else if (configCopy.getConnectionManager() != null) {
        return configCopy.getConnectionManager();
    }else {
        throw new IllegalArgumentException("server(s) address(es) not defined!");
    }
}
 
源代码3 项目: redisson   文件: RedisExecutor.java
public RedisExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command,
        Object[] params, RPromise<R> mainPromise, boolean ignoreRedirect, 
        ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder) {
    super();
    this.readOnlyMode = readOnlyMode;
    this.source = source;
    this.codec = codec;
    this.command = command;
    this.params = params;
    this.mainPromise = mainPromise;
    this.ignoreRedirect = ignoreRedirect;
    this.connectionManager = connectionManager;
    this.objectBuilder = objectBuilder;
    
    this.attempts = connectionManager.getConfig().getRetryAttempts();
    this.retryInterval = connectionManager.getConfig().getRetryInterval();
    this.responseTimeout = connectionManager.getConfig().getTimeout();
}
 
源代码4 项目: redisson   文件: RedisCommonBatchExecutor.java
public RedisCommonBatchExecutor(NodeSource source, RPromise<Void> mainPromise, 
        ConnectionManager connectionManager, BatchOptions options, Entry entry, AtomicInteger slots) {
    super(entry.isReadOnlyMode(), source, null, null, null, mainPromise, true, connectionManager, null);
    this.options = options;
    this.entry = entry;
    this.slots = slots;
    
    if (options.getRetryAttempts() > 0) {
        this.attempts = options.getRetryAttempts();
    }
    if (options.getRetryInterval() > 0) {
        this.retryInterval  = options.getRetryInterval();
    }
    if (options.getResponseTimeout() > 0) {
        this.responseTimeout = options.getResponseTimeout();
    }
    
}
 
源代码5 项目: redisson   文件: BaseRegion.java
public BaseRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory, CacheDataDescription metadata, Properties properties, String defaultKey) {
    super();
    this.mapCache = mapCache;
    this.regionFactory = regionFactory;
    this.metadata = metadata;
    this.connectionManager = connectionManager;
    
    String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
    if (maxEntries != null) {
        mapCache.setMaxSize(Integer.valueOf(maxEntries));
    }
    String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
    if (timeToLive != null) {
        ttl = Integer.valueOf(timeToLive);
    }
    String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
    if (maxIdleTime != null) {
        maxIdle = Integer.valueOf(maxIdleTime);
    }

    String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
    fallback = Boolean.valueOf(fallbackValue);
}
 
源代码6 项目: redisson   文件: BaseRegion.java
public BaseRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory, CacheDataDescription metadata, Properties properties, String defaultKey) {
    super();
    this.mapCache = mapCache;
    this.regionFactory = regionFactory;
    this.metadata = metadata;
    this.connectionManager = connectionManager;
    
    String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
    if (maxEntries != null) {
        mapCache.setMaxSize(Integer.valueOf(maxEntries));
    }
    String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
    if (timeToLive != null) {
        ttl = Integer.valueOf(timeToLive);
    }
    String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
    if (maxIdleTime != null) {
        maxIdle = Integer.valueOf(maxIdleTime);
    }

    String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
    fallback = Boolean.valueOf(fallbackValue);
}
 
源代码7 项目: redisson   文件: RedissonStorage.java
public RedissonStorage(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, Map<String, Object> properties, String defaultKey) {
    super();
    this.mapCache = mapCache;
    this.connectionManager = connectionManager;
    
    String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
    if (maxEntries != null) {
        mapCache.setMaxSize(Integer.valueOf(maxEntries));
    }
    String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
    if (timeToLive != null) {
        ttl = Integer.valueOf(timeToLive);
    }
    String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
    if (maxIdleTime != null) {
        maxIdle = Integer.valueOf(maxIdleTime);
    }

    String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
    fallback = Boolean.valueOf(fallbackValue);
}
 
源代码8 项目: redisson   文件: BaseRegion.java
public BaseRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory, CacheDataDescription metadata, Properties properties, String defaultKey) {
    super();
    this.mapCache = mapCache;
    this.regionFactory = regionFactory;
    this.metadata = metadata;
    this.connectionManager = connectionManager;
    
    String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
    if (maxEntries != null) {
        mapCache.setMaxSize(Integer.valueOf(maxEntries));
    }
    String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
    if (timeToLive != null) {
        ttl = Integer.valueOf(timeToLive);
    }
    String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
    if (maxIdleTime != null) {
        maxIdle = Integer.valueOf(maxIdleTime);
    }

    String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
    fallback = Boolean.valueOf(fallbackValue);
}
 
源代码9 项目: redisson   文件: PublishSubscribeService.java
public PublishSubscribeService(ConnectionManager connectionManager, MasterSlaveServersConfig config) {
    super();
    this.connectionManager = connectionManager;
    this.config = config;
    for (int i = 0; i < locks.length; i++) {
        locks[i] = new AsyncSemaphore(1);
    }
}
 
源代码10 项目: redisson   文件: RedissonSubSortedSet.java
RedissonSubSortedSet(RedissonSortedSet<V> redissonSortedSet, ConnectionManager connectionManager, V headValue, V tailValue) {
    super();
    this.headValue = headValue;
    this.tailValue = tailValue;

    this.connectionManager = connectionManager;
    this.redissonSortedSet = redissonSortedSet;
}
 
源代码11 项目: redisson   文件: MapReduceExecutor.java
MapReduceExecutor(RObject object, RedissonClient redisson, ConnectionManager connectionManager) {
    this.objectName = object.getName();
    this.objectCodec = object.getCodec();
    this.objectClass = object.getClass();

    this.redisson = redisson;
    UUID id = UUID.randomUUID();
    this.resultMapName = object.getName() + ":result:" + id;
    this.executorService = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME);
    this.connectionManager = connectionManager;
}
 
源代码12 项目: redisson   文件: BaseRedisBatchExecutor.java
@SuppressWarnings("ParameterNumber")
public BaseRedisBatchExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command,
        Object[] params, RPromise<R> mainPromise, boolean ignoreRedirect,
        ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, 
        ConcurrentMap<MasterSlaveEntry, Entry> commands,
        BatchOptions options, AtomicInteger index, AtomicBoolean executed) {
    
    super(readOnlyMode, source, codec, command, params, mainPromise, ignoreRedirect, connectionManager,
            objectBuilder);
    this.commands = commands;
    this.options = options;
    this.index = index;
    this.executed = executed;
}
 
源代码13 项目: redisson   文件: RedisBatchExecutor.java
@SuppressWarnings("ParameterNumber")
public RedisBatchExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command,
        Object[] params, RPromise<R> mainPromise, boolean ignoreRedirect, ConnectionManager connectionManager,
        RedissonObjectBuilder objectBuilder, ConcurrentMap<MasterSlaveEntry, Entry> commands,
        BatchOptions options, AtomicInteger index,
        AtomicBoolean executed) {
    super(readOnlyMode, source, codec, command, params, mainPromise, ignoreRedirect, connectionManager, objectBuilder,
            commands, options, index, executed);
}
 
源代码14 项目: redisson   文件: RedisQueuedBatchExecutor.java
@SuppressWarnings("ParameterNumber")
public RedisQueuedBatchExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command,
        Object[] params, RPromise<R> mainPromise, boolean ignoreRedirect, ConnectionManager connectionManager,
        RedissonObjectBuilder objectBuilder, ConcurrentMap<MasterSlaveEntry, Entry> commands,
        ConcurrentMap<MasterSlaveEntry, ConnectionEntry> connections, BatchOptions options, AtomicInteger index,
        AtomicBoolean executed, AsyncSemaphore semaphore) {
    super(readOnlyMode, source, codec, command, params, mainPromise, ignoreRedirect, connectionManager, objectBuilder,
            commands, options, index, executed);
    
    this.connections = connections;
    this.semaphore = semaphore;
}
 
源代码15 项目: skywalking   文件: ConnectionManagerInterceptor.java
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
                          Object ret) throws Throwable {
    try {
        ConnectionManager connectionManager = (ConnectionManager) objInst;
        Config config = connectionManager.getCfg();

        Object singleServerConfig = ClassUtil.getObjectField(config, "singleServerConfig");
        Object sentinelServersConfig = ClassUtil.getObjectField(config, "sentinelServersConfig");
        Object masterSlaveServersConfig = ClassUtil.getObjectField(config, "masterSlaveServersConfig");
        Object clusterServersConfig = ClassUtil.getObjectField(config, "clusterServersConfig");
        Object replicatedServersConfig = ClassUtil.getObjectField(config, "replicatedServersConfig");

        StringBuilder peer = new StringBuilder();
        EnhancedInstance retInst = (EnhancedInstance) ret;

        if (singleServerConfig != null) {
            Object singleAddress = ClassUtil.getObjectField(singleServerConfig, "address");
            peer.append(getPeer(singleAddress));
            retInst.setSkyWalkingDynamicField(PeerFormat.shorten(peer.toString()));
            return ret;
        }
        if (sentinelServersConfig != null) {
            appendAddresses(peer, (Collection) ClassUtil.getObjectField(sentinelServersConfig, "sentinelAddresses"));
            retInst.setSkyWalkingDynamicField(PeerFormat.shorten(peer.toString()));
            return ret;
        }
        if (masterSlaveServersConfig != null) {
            Object masterAddress = ClassUtil.getObjectField(masterSlaveServersConfig, "masterAddress");
            peer.append(getPeer(masterAddress));
            appendAddresses(peer, (Collection) ClassUtil.getObjectField(masterSlaveServersConfig, "slaveAddresses"));
            retInst.setSkyWalkingDynamicField(PeerFormat.shorten(peer.toString()));
            return ret;
        }
        if (clusterServersConfig != null) {
            appendAddresses(peer, (Collection) ClassUtil.getObjectField(clusterServersConfig, "nodeAddresses"));
            retInst.setSkyWalkingDynamicField(PeerFormat.shorten(peer.toString()));
            return ret;
        }
        if (replicatedServersConfig != null) {
            appendAddresses(peer, (Collection) ClassUtil.getObjectField(replicatedServersConfig, "nodeAddresses"));
            retInst.setSkyWalkingDynamicField(PeerFormat.shorten(peer.toString()));
            return ret;
        }
    } catch (Exception e) {
        logger.warn("redisClient set peer error: ", e);
    }
    return ret;
}
 
源代码16 项目: redisson   文件: RedissonReactiveSubscription.java
public RedissonReactiveSubscription(ConnectionManager connectionManager) {
    this.subscribeService = connectionManager.getSubscribeService();
}
 
源代码17 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码18 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码19 项目: redisson   文件: RedissonReactiveSubscription.java
public RedissonReactiveSubscription(ConnectionManager connectionManager) {
    this.subscribeService = connectionManager.getSubscribeService();
}
 
源代码20 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码21 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码22 项目: redisson   文件: RedissonReactiveSubscription.java
public RedissonReactiveSubscription(ConnectionManager connectionManager) {
    this.subscribeService = connectionManager.getSubscribeService();
}
 
源代码23 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码24 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码25 项目: redisson   文件: RedissonSubscription.java
public RedissonSubscription(ConnectionManager connectionManager, PublishSubscribeService subscribeService, MessageListener listener) {
    super(listener, null, null);
    this.connectionManager = connectionManager;
    this.subscribeService = subscribeService;
}
 
源代码26 项目: redisson   文件: RedissonBaseNodes.java
public RedissonBaseNodes(ConnectionManager connectionManager) {
    this.connectionManager = connectionManager;
}
 
public RedissonSentinelMasterSlaveNodes(ConnectionManager connectionManager) {
    super(connectionManager);
}
 
源代码28 项目: redisson   文件: RedissonClusterNodes.java
public RedissonClusterNodes(ConnectionManager connectionManager) {
    super(connectionManager);
}
 
源代码29 项目: redisson   文件: RedissonMasterSlaveNodes.java
public RedissonMasterSlaveNodes(ConnectionManager connectionManager) {
    super(connectionManager);
}
 
源代码30 项目: redisson   文件: RedissonSingleNode.java
public RedissonSingleNode(ConnectionManager connectionManager) {
    super(connectionManager);
}