Search in sources :

Example 21 with SystemBootstrapInfo

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.");
    }
}
Also used : ArrayList(java.util.ArrayList) SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Example 22 with SystemBootstrapInfo

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;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Example 23 with SystemBootstrapInfo

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;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Example 24 with SystemBootstrapInfo

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"));
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 25 with SystemBootstrapInfo

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;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Aggregations

SystemBootstrapInfo (org.apache.servicecomb.deployment.SystemBootstrapInfo)30 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)2