Example usage for com.google.common.base Service isRunning

List of usage examples for com.google.common.base Service isRunning

Introduction

In this page you can find the example usage for com.google.common.base Service isRunning.

Prototype

boolean isRunning();

Source Link

Document

Returns true if this service is State#RUNNING running .

Usage

From source file:fathom.Services.java

public synchronized void stop() {
    // stop the services in the reverse order
    Collections.reverse(instances);
    for (Service service : instances) {
        if (service.isRunning()) {
            log.info("Stopping service '{}'", service.getClass().getName());
            try {
                service.stop();/*  ww  w . jav  a 2s .c o m*/
            } catch (Exception e) {
                log.error("Failed to stop '{}'", service.getClass().getName(), e);
            }
        }
    }
}