use of rpc.turbo.config.client.ClientConfig in project turbo-rpc by hank-whu.
the class TurboClientStarter method postProcessBeanFactory.
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
this.beanFactory = beanFactory;
try {
ClientConfig clientConfig = ClientConfig.parse("turbo-client.conf");
turboClient = new TurboClient(clientConfig);
} catch (com.typesafe.config.ConfigException configException) {
if (logger.isErrorEnabled()) {
logger.error("turbo-client.conf 格式错误,无法开启TurboClient!", configException);
}
throw configException;
} catch (Exception e) {
if (logger.isErrorEnabled()) {
logger.error("类路径中找不到 turbo-client.conf,无法开启TurboClient!", e);
}
throw e;
}
Collection<Class<?>> turboClassList = extractTurboServiceClassList(beanFactory);
for (Class<?> turboClass : turboClassList) {
registerTurboService(turboClass);
}
}
Aggregations