|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.net.SimpleServiceMonitor
public class SimpleServiceMonitor
The SimpleServiceMonitor
starts and monitors services that are registered for monitoring.
Field Summary | |
---|---|
protected static java.lang.Integer |
DEFAULT_WAIT_MILLIS The default time interval by which we check the alive status. |
protected ConfigurableCacheFactory |
m_ccf ConfigurableCacheFactory instance used to start the service. |
protected long |
m_cWaitMillis The number of milliseconds between checking the status of the services. |
protected boolean |
m_fDisposed Indicates that this ServiceMonitor has been disposed. |
protected boolean |
m_fStarted Indicates that the ServiceMonitor has started. |
protected java.util.Map |
m_mapServicesByName A map of Service s by service name to be monitored. |
protected java.lang.Thread |
m_thread The Thread we are using for monitoring the services periodically. |
Constructor Summary | |
---|---|
SimpleServiceMonitor() Construct a SimpleServiceMonitor with the default interval to check that the registered services are running (). |
|
SimpleServiceMonitor(long cWaitMillis) Construct a SimpleServiceMonitor with the provided interval to check that the registered services are running. |
Method Summary | |
---|---|
protected void |
assertNotDisposed() Throws IllegalStateException if this monitor has been disposed via invocation of dispose() . |
void |
dispose() |
protected boolean |
isDisposed() Return true if this ServiceMonitor has been disposed via invocation of dispose() . |
boolean |
isMonitoring() Returns true iff the ServiceMonitor is monitoring a number of services. |
protected void |
monitorServices(long cWaitMillis) Check the service status periodically (keep alive interval), restarting any stopped services. |
void |
registerServices(java.util.Map 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. |
protected void |
start() Start monitoring the services. |
void |
stopMonitoring() Stop monitoring all registered services. |
void |
unregisterServices(java.util.Set setServices) Removes the supplied set of Service s from monitoring. |
Field Detail |
---|
protected static final java.lang.Integer DEFAULT_WAIT_MILLIS
protected volatile boolean m_fStarted
ServiceMonitor
has started.protected java.lang.Thread m_thread
Thread
we are using for monitoring the services periodically.protected boolean m_fDisposed
ServiceMonitor
has been disposed.protected ConfigurableCacheFactory m_ccf
ConfigurableCacheFactory
instance used to start the service.protected java.util.Map m_mapServicesByName
Service
s by service name to be monitored.protected final long m_cWaitMillis
Constructor Detail |
---|
public SimpleServiceMonitor()
public SimpleServiceMonitor(long cWaitMillis)
cWaitMillis
- the number of milliseconds in between checking that the registered services are runningMethod Detail |
---|
public void registerServices(java.util.Map 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
.registerServices
in interface ServiceMonitor
mapServices
- a map of Service
s by service namepublic void unregisterServices(java.util.Set 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.unregisterServices
in interface ServiceMonitor
setServices
- the set of Service
s to be removed from monitoringpublic void stopMonitoring()
Service
s that are being monitored.stopMonitoring
in interface ServiceMonitor
public boolean isMonitoring()
isMonitoring
in interface ServiceMonitor
public void setConfigurableCacheFactory(ConfigurableCacheFactory ccf)
ConfigurableCacheFactory
a ServiceMonitor
can operate with. Setting the ConfigurableCacheFactory
should be performed prior to registering services or requires a ServiceMonitor.stopMonitoring()
and ServiceMonitor.registerServices(Map)
call.setConfigurableCacheFactory
in interface ServiceMonitor
ccf
- the ConfigurableCacheFactory
used to start the servicepublic void dispose()
dispose
in interface com.oracle.common.base.Disposable
protected void start()
protected void monitorServices(long cWaitMillis)
cWaitMillis
- the number of milliseconds between checksprotected boolean isDisposed()
ServiceMonitor
has been disposed via invocation of dispose()
.protected void assertNotDisposed()
IllegalStateException
if this monitor has been disposed via invocation of dispose()
.java.lang.IllegalStateException
- if this monitor has been disposed
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |