@Test public void load() { ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); loader.load(ConfigLoader.Context::new, (context, config) -> { System.out.println("config:---->" + config); if (config != null) { if (StringUtils.isNotBlank(config.getConfigMode())) { String configMode = config.getConfigMode(); if (configMode.equals("local")) { new LocalConfigLoader().load(context, (context1, config1) -> System.out.println("config1:-->" + config1)); } } } }); HmilyServer server = ConfigEnv.getInstance().getConfig(HmilyServer.class); HmilyConfig config = ConfigEnv.getInstance().getConfig(HmilyConfig.class); HmilyDatabaseConfig databaseConfig = ConfigEnv.getInstance().getConfig(HmilyDatabaseConfig.class); HmilyFileConfig fileConfig = ConfigEnv.getInstance().getConfig(HmilyFileConfig.class); HmilyMetricsConfig metricsConfig = ConfigEnv.getInstance().getConfig(HmilyMetricsConfig.class); HmilyMongoConfig mongoConfig = ConfigEnv.getInstance().getConfig(HmilyMongoConfig.class); HmilyRedisConfig redisConfig = ConfigEnv.getInstance().getConfig(HmilyRedisConfig.class); HmilyZookeeperConfig zookeeperConfig = ConfigEnv.getInstance().getConfig(HmilyZookeeperConfig.class); System.out.println(server); System.out.println(config); System.out.println(databaseConfig); System.out.println(fileConfig); System.out.println(metricsConfig); System.out.println(mongoConfig); System.out.println(redisConfig); System.out.println(zookeeperConfig); }
@Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); }
LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); } }
LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); }  }
LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); }  @Override void load(final Supplier<Context> context, final LoaderHandler<Config> handler); }
LocalConfigLoader implements ConfigLoader<Config> { @Override public void load(final Supplier<Context> context, final LoaderHandler<Config> handler) { ConfigLoader<Config> original = context.get().getOriginal(); original.load(context, handler); }  @Override void load(final Supplier<Context> context, final LoaderHandler<Config> handler);  }