DefaultRedisHealthCheckInstanceFactory implements RedisHealthCheckInstanceFactory { @Override public RedisHealthCheckInstance create(RedisMeta redisMeta) { DefaultRedisHealthCheckInstance instance = new DefaultRedisHealthCheckInstance(); RedisInstanceInfo info = createRedisInstanceInfo(redisMeta); Endpoint endpoint = endpointFactory.getOrCreateEndpoint(redisMeta); HealthCheckConfig config = new CompositeHealthCheckConfig(info, consoleConfig); instance.setEndpoint(endpoint) .setHealthCheckConfig(config) .setRedisInstanceInfo(info) .setSession(redisSessionManager.findOrCreateSession(endpoint)); initActions(instance); try { LifecycleHelper.initializeIfPossible(instance); LifecycleHelper.startIfPossible(instance); } catch (Exception e) { logger.error("[create]", e); } return instance; } @Autowired(required = false)  DefaultRedisHealthCheckInstanceFactory(ConsoleConfig consoleConfig, HealthCheckEndpointFactory endpointFactory,
                                                  RedisSessionManager redisSessionManager, List<HealthCheckActionFactory<?>> factories,
                                                  ConsoleLeaderElector clusterServer, MetaCache metaCache); @Autowired(required = false)  DefaultRedisHealthCheckInstanceFactory(ConsoleConfig consoleConfig, HealthCheckEndpointFactory endpointFactory,
                                                  RedisSessionManager redisSessionManager, List<HealthCheckActionFactory<?>> factories,
                                                  MetaCache metaCache); @Override RedisHealthCheckInstance create(RedisMeta redisMeta);  }
@Test public void create() throws Exception { Server server = startServer("+PONG\r\n"); crossDcServer.start(); factory.setClusterServer(crossDcServer); RedisHealthCheckInstance instance = instanceManager.getOrCreate(newRandomFakeRedisMeta().setPort(server.getPort())); for(HealthCheckAction action : instance.getHealthCheckActions()) { logger.info("[action] {}", action); for(Object listener : ((AbstractHealthCheckAction) action).getListeners()) { logger.info(" [listener] {}", listener); } } logger.info("=====================splitter======================================="); sleep(100); for(HealthCheckAction action : instance.getHealthCheckActions()) { logger.info("[action] {}", action); for(Object listener : ((AbstractHealthCheckAction) action).getListeners()) { logger.info(" [listener] {}", listener); } } logger.info("{}", controller.getHealthCheckInstance(instance.getEndpoint().getHost(), instance.getEndpoint().getPort())); }