Search in sources :

Example 1 with BaseService

use of io.mantisrx.server.core.BaseService in project mantis by Netflix.

the class ServiceLifecycle method start.

void start() {
    for (BaseService service : servicesList) {
        try {
            logger.info("Starting service " + service.getMyServiceCount() + ": " + service);
            service.start();
            logger.info("Successfully started service " + service.getMyServiceCount() + ": " + service);
        } catch (Exception e) {
            logger.error(String.format("Failed to start service %d: %s: %s", service.getMyServiceCount(), service, e.getMessage()), e);
            throw e;
        }
    }
}
Also used : BaseService(io.mantisrx.server.core.BaseService)

Example 2 with BaseService

use of io.mantisrx.server.core.BaseService in project mantis by Netflix.

the class ServiceLifecycle method shutdown.

void shutdown() {
    if (!servicesList.isEmpty()) {
        Iterator<BaseService> iterator = servicesList.descendingIterator();
        while (iterator.hasNext()) {
            BaseService service = iterator.next();
            logger.info("Shutting down service " + service.getMyServiceCount() + ": " + service);
            service.shutdown();
            logger.info("Successfully shut down service " + service.getMyServiceCount() + ": " + service);
        }
    }
}
Also used : BaseService(io.mantisrx.server.core.BaseService)

Aggregations

BaseService (io.mantisrx.server.core.BaseService)2