ServiceManager.Listener
Date: 2016-05-24

com.google.common.util.concurrent

## Class ServiceManager.Listener

- java.lang.Object
- - com.google.common.util.concurrent.ServiceManager.Listener

- Enclosing class:
    ServiceManager

      @Beta
      public abstract static class ServiceManager.Listener
      extends java.lang.Object

  A listener for the aggregate state changes of the services that are under management. Users that need to listen to more fine-grained events (such as when each particular service starts, or terminates), should attach service listeners to each individual service.
  Since:
    15.0 (present as an interface in 14.0)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceManager.Listener()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `failure(Service service)` Called when a component service has failed.
    `void` | `healthy()` Called when the service initially becomes healthy.
    `void` | `stopped()` Called when the all of the component services have reached a terminal state, either terminated or failed.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServiceManager.Listener

          public ServiceManager.Listener()

  - ### Method Detail

    - #### healthy

          public void healthy()

      Called when the service initially becomes healthy.

      This will be called at most once after all the services have entered the running state. If any services fail during start up or fail/terminate before all other services have started running then this method will not be called.

    - #### stopped

          public void stopped()

      Called when the all of the component services have reached a terminal state, either terminated or failed.

    - #### failure

          public void failure(Service service)

      Called when a component service has failed.
      Parameters:
        `service` - The service that failed.