use of org.apache.servicecomb.config.common.ConfigConverter in project java-chassis by ServiceComb.
the class KieConfigurationSourceImpl method init.
@Override
public void init(Configuration localConfiguration) {
configConverter = new ConfigConverter(KieConfig.INSTANCE.getFileSources());
KieAddressManager kieAddressManager = configKieAddressManager();
RequestConfig.Builder requestBuilder = HttpTransportFactory.defaultRequestConfig();
if (KieConfig.INSTANCE.enableLongPolling() && KieConfig.INSTANCE.getPollingWaitTime() >= 0) {
requestBuilder.setConnectionRequestTimeout(KieConfig.INSTANCE.getPollingWaitTime() * 2 * 1000);
requestBuilder.setSocketTimeout(KieConfig.INSTANCE.getPollingWaitTime() * 2 * 1000);
}
HttpTransport httpTransport = createHttpTransport(kieAddressManager, requestBuilder.build(), localConfiguration);
KieConfiguration kieConfiguration = createKieConfiguration();
KieClient kieClient = new KieClient(kieAddressManager, httpTransport, kieConfiguration);
EventManager.register(this);
kieConfigManager = new KieConfigManager(kieClient, EventManager.getEventBus(), kieConfiguration, configConverter);
kieConfigManager.firstPull();
kieConfigManager.startConfigKieManager();
updateConfiguration(WatchedUpdateResult.createIncremental(configConverter.getCurrentData(), null, null));
}
use of org.apache.servicecomb.config.common.ConfigConverter in project incubator-servicecomb-java-chassis by apache.
the class ConfigCenterConfigurationSourceImpl method init.
@Override
public void init(Configuration localConfiguration) {
configConverter = new ConfigConverter(ConfigCenterConfig.INSTANCE.getFileSources());
AddressManager kieAddressManager = configKieAddressManager();
HttpTransport httpTransport = createHttpTransport(kieAddressManager, HttpTransportFactory.defaultRequestConfig().build(), localConfiguration);
ConfigCenterClient configCenterClient = new ConfigCenterClient(kieAddressManager, httpTransport);
EventManager.register(this);
QueryConfigurationsRequest queryConfigurationsRequest = firstPull(configCenterClient);
configCenterManager = new ConfigCenterManager(configCenterClient, EventManager.getEventBus(), configConverter);
configCenterManager.setQueryConfigurationsRequest(queryConfigurationsRequest);
configCenterManager.startConfigCenterManager();
}
use of org.apache.servicecomb.config.common.ConfigConverter in project incubator-servicecomb-java-chassis by apache.
the class KieConfigurationSourceImpl method init.
@Override
public void init(Configuration localConfiguration) {
configConverter = new ConfigConverter(KieConfig.INSTANCE.getFileSources());
KieAddressManager kieAddressManager = configKieAddressManager();
RequestConfig.Builder requestBuilder = HttpTransportFactory.defaultRequestConfig();
if (KieConfig.INSTANCE.enableLongPolling() && KieConfig.INSTANCE.getPollingWaitTime() >= 0) {
requestBuilder.setConnectionRequestTimeout(KieConfig.INSTANCE.getPollingWaitTime() * 2 * 1000);
requestBuilder.setSocketTimeout(KieConfig.INSTANCE.getPollingWaitTime() * 2 * 1000);
}
HttpTransport httpTransport = createHttpTransport(kieAddressManager, requestBuilder.build(), localConfiguration);
KieConfiguration kieConfiguration = createKieConfiguration();
KieClient kieClient = new KieClient(kieAddressManager, httpTransport, kieConfiguration);
EventManager.register(this);
kieConfigManager = new KieConfigManager(kieClient, EventManager.getEventBus(), kieConfiguration, configConverter);
kieConfigManager.firstPull();
kieConfigManager.startConfigKieManager();
updateConfiguration(WatchedUpdateResult.createIncremental(configConverter.getCurrentData(), null, null));
}
use of org.apache.servicecomb.config.common.ConfigConverter in project java-chassis by ServiceComb.
the class ConfigCenterConfigurationSourceImpl method init.
@Override
public void init(Configuration localConfiguration) {
configConverter = new ConfigConverter(ConfigCenterConfig.INSTANCE.getFileSources());
AddressManager kieAddressManager = configKieAddressManager();
HttpTransport httpTransport = createHttpTransport(kieAddressManager, HttpTransportFactory.defaultRequestConfig().build(), localConfiguration);
ConfigCenterClient configCenterClient = new ConfigCenterClient(kieAddressManager, httpTransport);
EventManager.register(this);
QueryConfigurationsRequest queryConfigurationsRequest = firstPull(configCenterClient);
configCenterManager = new ConfigCenterManager(configCenterClient, EventManager.getEventBus(), configConverter);
configCenterManager.setQueryConfigurationsRequest(queryConfigurationsRequest);
configCenterManager.startConfigCenterManager();
}
Aggregations