java.lang.Object
dev.mccue.guava.concurrent.ServiceManager.Listener
- Enclosing class:
- ServiceManager
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 service starts, or terminates), should attach Service.Listener service
listeners to each individual service.- Since:
- 15.0 (present as an interface in 14.0)
- Author:
- Luke Sandberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a component service hasState#FAILED failed.voidhealthy()Called when the service initially becomes healthy.voidstopped()Called when the all of the component services have reached a terminal state, eitherState#TERMINATED terminatedorState#FAILED failed.
-
Constructor Details
-
Listener
public Listener()
-
-
Method Details
-
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
State#RUNNING runningstate. If any services fail during start up orState#FAILED fail/State#TERMINATED terminatebefore all other services have startedState#RUNNING runningthen this method will not be called. -
stopped
public void stopped()Called when the all of the component services have reached a terminal state, eitherState#TERMINATED terminatedorState#FAILED failed. -
failure
Called when a component service hasState#FAILED failed.- Parameters:
service- The service that failed.
-