Package | Description |
---|---|
com.google.common.util.concurrent |
Concurrency utilities.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractExecutionThreadService
Base class for services that can implement
AbstractExecutionThreadService.startUp() , AbstractExecutionThreadService.run() and AbstractExecutionThreadService.shutDown()
methods. |
class |
AbstractIdleService
Base class for services that do not need a thread while "running" but may need one during startup
and shutdown.
|
private class |
AbstractIdleService.DelegateService |
class |
AbstractScheduledService
Base class for services that can implement
AbstractScheduledService.startUp() and AbstractScheduledService.shutDown() but while in
the "running" state need to perform a periodic task. |
private class |
AbstractScheduledService.ServiceDelegate |
class |
AbstractService
Base class for implementing services that can handle
AbstractService.doStart() and AbstractService.doStop()
requests, responding to them with AbstractService.notifyStarted() and AbstractService.notifyStopped()
callbacks. |
private static class |
ServiceManager.NoOpService
A
Service instance that does nothing. |
Modifier and Type | Field and Description |
---|---|
private Service |
AbstractIdleService.delegate |
private Service |
AbstractExecutionThreadService.delegate |
(package private) Service |
ServiceManager.ServiceListener.service |
Modifier and Type | Field and Description |
---|---|
private ImmutableList<Service> |
ServiceManager.services |
(package private) SetMultimap<Service.State,Service> |
ServiceManager.ServiceManagerState.servicesByState |
(package private) java.util.Map<Service,Stopwatch> |
ServiceManager.ServiceManagerState.startupTimers |
Modifier and Type | Method and Description |
---|---|
Service |
AbstractScheduledService.startAsync() |
Service |
AbstractIdleService.startAsync() |
Service |
AbstractService.startAsync() |
Service |
Service.startAsync()
If the service state is
Service.State.NEW , this initiates service startup and returns
immediately. |
Service |
AbstractExecutionThreadService.startAsync() |
Service |
AbstractScheduledService.stopAsync() |
Service |
AbstractIdleService.stopAsync() |
Service |
AbstractService.stopAsync() |
Service |
Service.stopAsync()
|
Service |
AbstractExecutionThreadService.stopAsync() |
Modifier and Type | Method and Description |
---|---|
ImmutableMultimap<Service.State,Service> |
ServiceManager.servicesByState()
Provides a snapshot of the current state of all the services under management.
|
(package private) ImmutableMultimap<Service.State,Service> |
ServiceManager.ServiceManagerState.servicesByState() |
ImmutableMap<Service,java.lang.Long> |
ServiceManager.startupTimes()
Returns the service load times.
|
(package private) ImmutableMap<Service,java.lang.Long> |
ServiceManager.ServiceManagerState.startupTimes() |
Modifier and Type | Method and Description |
---|---|
void |
ServiceManager.Listener.failure(Service service)
Called when a component service has failed.
|
(package private) void |
ServiceManager.ServiceManagerState.fireFailedListeners(Service service) |
(package private) void |
ServiceManager.ServiceManagerState.transitionService(Service service,
Service.State from,
Service.State to)
Updates the state with the given service transition.
|
(package private) void |
ServiceManager.ServiceManagerState.tryStartTiming(Service service)
Attempts to start the timer immediately prior to the service being started via
startAsync() . |
Constructor and Description |
---|
ServiceListener(Service service,
java.lang.ref.WeakReference<ServiceManager.ServiceManagerState> state) |
Constructor and Description |
---|
ServiceManager(java.lang.Iterable<? extends Service> services)
Constructs a new instance for managing the given services.
|
ServiceManagerState(ImmutableCollection<Service> services)
It is implicitly assumed that all the services are NEW and that they will all remain NEW
until all the Listeners are installed and
ServiceManager.ServiceManagerState.markReady() is called. |