Search in sources :

Example 1 with TurboClient

use of rpc.turbo.client.TurboClient 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);
    }
}
Also used : TurboClient(rpc.turbo.client.TurboClient) ClientConfig(rpc.turbo.config.client.ClientConfig) BeansException(org.springframework.beans.BeansException)

Aggregations

BeansException (org.springframework.beans.BeansException)1 TurboClient (rpc.turbo.client.TurboClient)1 ClientConfig (rpc.turbo.config.client.ClientConfig)1