public interface ServiceMonitor extends Disposable
ServiceMonitor
is a facility that keeps registered services
alive. It is bound to a ConfigurableCacheFactory
whilst alive
and should allow for ConfigurableCacheFactory
s to be changed and
reflected upon restart of the monitor.Modifier and Type | Method | Description |
---|---|---|
Thread |
getThread() |
Return the thread used by this ServiceMonitor.
|
boolean |
isMonitoring() |
Returns true iff the ServiceMonitor is monitoring a number of
services.
|
void |
registerServices(Map<Service,String> mapServices) |
Adds a set of
Service s to be monitored providing life support. |
void |
setConfigurableCacheFactory(ConfigurableCacheFactory ccf) |
Set the
ConfigurableCacheFactory a ServiceMonitor can
operate with. |
void |
stopMonitoring() |
Stop monitoring all registered services.
|
void |
unregisterServices(Set<Service> setServices) |
Removes the supplied set of
Service s from monitoring. |
close, dispose
void registerServices(Map<Service,String> mapServices)
Service
s to be monitored providing life support.
If any of the services are not running they are started either via the
configured ConfigurableCacheFactory
iff provided or the
provided Service
.mapServices
- a map of Service
s where values are non-scoped
service namesvoid unregisterServices(Set<Service> setServices)
Service
s from monitoring.
Note that the services are not being stopped; they are just removed
from the list of Service
s that are being monitored.setServices
- the set of Service
s to be removed from monitoringvoid stopMonitoring()
Service
s that are being monitored.boolean isMonitoring()
void setConfigurableCacheFactory(ConfigurableCacheFactory ccf)
ConfigurableCacheFactory
a ServiceMonitor
can
operate with. Setting the ConfigurableCacheFactory
should
be performed prior to registering services or requires a
stopMonitoring()
and registerServices(Map)
call.ccf
- the ConfigurableCacheFactory
used to start the
serviceThread getThread()