Search in sources :

Example 1 with ComposerService

use of org.ballerinalang.composer.server.spi.ComposerService in project ballerina by ballerina-lang.

the class Server method start.

public void start() {
    // create services
    for (ComposerServiceProvider serviceProvider : serviceProviderLoader) {
        ComposerService service = serviceProvider.createService(serverConfig);
        if (service != null) {
            serviceList.add(service);
        }
    }
    // deploy services
    for (ComposerService service : serviceList) {
        if (service.getServiceInfo().getType() == ServiceType.HTTP) {
            microservicesRunner.deploy(service);
        } else if (service.getServiceInfo().getType() == ServiceType.WS) {
            microservicesRunner.deployWebSocketEndpoint(service);
        }
    }
    // deploy ep info service
    microservicesRunner.deploy(new ConfigService(serverConfig, serviceList));
    // deploy public content service
    microservicesRunner.deploy(new PublicContentService(serverConfig));
    microservicesRunner.start();
}
Also used : ConfigService(org.ballerinalang.composer.server.service.ConfigService) ComposerService(org.ballerinalang.composer.server.spi.ComposerService) PublicContentService(org.ballerinalang.composer.server.service.PublicContentService) ComposerServiceProvider(org.ballerinalang.composer.server.spi.ComposerServiceProvider)

Aggregations

ConfigService (org.ballerinalang.composer.server.service.ConfigService)1 PublicContentService (org.ballerinalang.composer.server.service.PublicContentService)1 ComposerService (org.ballerinalang.composer.server.spi.ComposerService)1 ComposerServiceProvider (org.ballerinalang.composer.server.spi.ComposerServiceProvider)1