Search in sources :

Example 11 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

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 12 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project incubator-servicecomb-java-chassis by apache.

the class TestServiceCenterDefaultDeploymentProvider method testConfigurationEnvTwo.

@Test
public void testConfigurationEnvTwo() {
    System.setProperty("servicecomb.service.registry.address", "http://127.0.0.1:30100,http://127.0.0.2:30100");
    ServiceCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(ServiceCenterDefaultDeploymentProvider.SYSTEM_KEY_SERVICE_CENTER);
    Assert.assertEquals(info.getAccessURL().size(), 2);
    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30100");
    Assert.assertEquals(info.getAccessURL().get(1), "http://127.0.0.2:30100");
    System.getProperties().remove("servicecomb.service.registry.address");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 13 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class TestServiceCenterDefaultDeploymentProvider method testConfigurationEnv.

@Test
public void testConfigurationEnv() {
    System.setProperty("servicecomb.service.registry.address", "https://localhost:30100");
    ServiceCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(ServiceCenterDefaultDeploymentProvider.SYSTEM_KEY_SERVICE_CENTER);
    Assert.assertEquals(info.getAccessURL().get(0), "https://localhost:30100");
    System.getProperties().remove("servicecomb.service.registry.address");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 14 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class TestConfigCenterDefaultDeploymentProvider method testConfigurationEnvTwo.

@Test
public void testConfigurationEnvTwo() {
    System.setProperty("servicecomb.config.client.serverUri", "https://localhost:9988,https://localhost:9987");
    ConfigCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
    Assert.assertEquals(info.getAccessURL().size(), 2);
    Assert.assertEquals(info.getAccessURL().get(0), "https://localhost:9988");
    Assert.assertEquals(info.getAccessURL().get(1), "https://localhost:9987");
    System.getProperties().remove("servicecomb.config.client.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 15 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

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