use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.
the class DefaultMonitorDataPublisher method init.
@Override
public void init() {
try {
List<String> addresses = new ArrayList<>();
SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE);
if (info != null && info.getAccessURL() != null) {
addresses.addAll(info.getAccessURL());
}
addressManager = new AddressManager(addresses, EventManager.getEventBus());
deployMonitorClient();
} catch (Exception e) {
LOGGER.warn("Deploy monitor data publisher failed will not send monitor data.");
}
}
use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.
the class ServiceCenterDefaultDeploymentProvider method getSystemBootStrapInfo.
@Override
public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
if (!systemKey.equals(SYSTEM_KEY_SERVICE_CENTER)) {
return null;
}
SystemBootstrapInfo sc = new SystemBootstrapInfo();
List<String> urls = ConfigUtil.parseArrayValue(configuration.getString("servicecomb.service.registry.address"));
if (urls.isEmpty()) {
urls = Arrays.asList("http://127.0.0.1:30100");
}
sc.setAccessURL(urls);
return sc;
}
use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.
the class ConfigCenterConfigurationSourceImpl method isValidSource.
@Override
public boolean isValidSource(Configuration localConfiguration) {
ConfigCenterConfig.setConcurrentCompositeConfiguration((ConcurrentCompositeConfiguration) localConfiguration);
SystemBootstrapInfo address = Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
if (address == null) {
LOGGER.info("config center server is not configured.");
return false;
}
return true;
}
use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.
the class TestConfigCenterDefaultDeploymentProvider method testConfiguration.
@Test
public void testConfiguration() {
ConfigCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
Assert.assertEquals(info.getAccessURL().get(0), "https://172.16.8.7:30103");
Assert.assertNull(Deployment.getSystemBootStrapInfo("wrong"));
}
use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.
the class KieCenterDefaultDeploymentProvider method getSystemBootStrapInfo.
@Override
public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
if (!systemKey.equals(SYSTEM_KEY_KIE_CENTER)) {
return null;
}
List<String> kieAddresses = ConfigUtil.parseArrayValue(configuration.getString("servicecomb.kie.serverUri"));
if (kieAddresses.isEmpty()) {
return null;
}
SystemBootstrapInfo kie = new SystemBootstrapInfo();
kie.setAccessURL(kieAddresses);
return kie;
}
Aggregations