use of io.servicecomb.core.handler.config.Config in project java-chassis by ServiceComb.
the class HandlerConfigUtils method loadConfig.
private static Config loadConfig() throws Exception {
Config config = new Config();
List<Resource> resList = PaaSResourceUtils.getSortedResources("classpath*:config/cse.handler.xml", ".handler.xml");
for (Resource res : resList) {
Config tmpConfig = XmlLoaderUtils.load(res, Config.class);
config.mergeFrom(tmpConfig);
}
return config;
}
use of io.servicecomb.core.handler.config.Config in project java-chassis by ServiceComb.
the class UnitTestMeta method init.
@SuppressWarnings("unchecked")
public static synchronized void init() {
if (inited) {
return;
}
Config config = new Config();
Class<?> cls = SimpleLoadBalanceHandler.class;
config.getHandlerClassMap().put("simpleLB", (Class<Handler>) cls);
ProducerHandlerManager.INSTANCE.init(config);
ConsumerHandlerManager.INSTANCE.init(config);
ApplicationContext applicationContext = Mockito.mock(ApplicationContext.class);
BeanUtils.setContext(applicationContext);
inited = true;
}
use of io.servicecomb.core.handler.config.Config in project java-chassis by ServiceComb.
the class HandlerConfigUtils method init.
public static void init() throws Exception {
Config config = loadConfig();
ConsumerHandlerManager.INSTANCE.init(config);
ProducerHandlerManager.INSTANCE.init(config);
}
Aggregations