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 ConfigurableCacheFactorys to be changed and reflected upon restart of the monitor.| Modifier and Type | Method and 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
Services 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
Services from monitoring. |
close, disposevoid registerServices(Map<Service,String> mapServices)
Services 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 Services where values are non-scoped service namesvoid unregisterServices(Set<Service> setServices)
Services from monitoring. Note that the services are not being stopped; they are just removed from the list of Services that are being monitored.setServices - the set of Services to be removed from monitoringvoid stopMonitoring()
Services 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()