Search in sources :

Example 1 with Service

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

the class MantisWorker method shutdown.

@Override
public void shutdown() {
    logger.info("Shutting down Mantis Worker");
    for (Service service : mantisServices) {
        service.shutdown();
    }
    blockUntilShutdown.countDown();
}
Also used : CuratorService(io.mantisrx.server.core.zookeeper.CuratorService) MetricsPublisherService(io.mantisrx.server.core.metrics.MetricsPublisherService) BaseService(io.mantisrx.server.core.BaseService) MetricsServerService(io.mantisrx.server.core.metrics.MetricsServerService) Service(io.mantisrx.server.core.Service)

Example 2 with Service

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

the class MantisWorker method start.

@Override
public void start() {
    logger.info("Starting Mantis Worker");
    RxNetty.useMetricListenersFactory(new MantisNettyEventsListenerFactory());
    for (Service service : mantisServices) {
        logger.info("Starting service: " + service.getClass().getName());
        try {
            service.start();
        } catch (Throwable e) {
            logger.error(String.format("Failed to start service %s: %s", service, e.getMessage()), e);
            throw e;
        }
    }
    try {
        blockUntilShutdown.await();
    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
}
Also used : MantisNettyEventsListenerFactory(io.mantisrx.common.metrics.netty.MantisNettyEventsListenerFactory) CuratorService(io.mantisrx.server.core.zookeeper.CuratorService) MetricsPublisherService(io.mantisrx.server.core.metrics.MetricsPublisherService) BaseService(io.mantisrx.server.core.BaseService) MetricsServerService(io.mantisrx.server.core.metrics.MetricsServerService) Service(io.mantisrx.server.core.Service)

Aggregations

BaseService (io.mantisrx.server.core.BaseService)2 Service (io.mantisrx.server.core.Service)2 MetricsPublisherService (io.mantisrx.server.core.metrics.MetricsPublisherService)2 MetricsServerService (io.mantisrx.server.core.metrics.MetricsServerService)2 CuratorService (io.mantisrx.server.core.zookeeper.CuratorService)2 MantisNettyEventsListenerFactory (io.mantisrx.common.metrics.netty.MantisNettyEventsListenerFactory)1