Public Member Functions | |
int | getNumberOfMonitorTasks () |
void | suspend () |
void | resume () |
void | stopMonitoring (String resourceName) |
void | stopMonitoringAll () |
Public Attributes | |
final int | defaultDelaySeconds |
Package Functions | |
SubsysResourceMonitor (Logger logger, ThreadFactory threadFactory) | |
SubsysResourceMonitor (Logger logger, ThreadFactory threadFactory, int defaultDelaySeconds) | |
< T > void | monitorResource (ResourceChecker< T > checker, ResourceErrorHandler< T > err) |
< T > void | monitorResource (ResourceChecker< T > checker, ResourceErrorHandler< T > err, int delaySeconds) |
SubsysResourceMonitor.ResourceCheckRunner | getResourceCheckRunner (ResourceChecker checker) |
synchronized void | destroy (long timeout, TimeUnit unit) throws InterruptedException |
Private Attributes | |
final ScheduledThreadPoolExecutor | scheduler |
final Random | random |
final Logger | logger |
final ExecutorService | monitorCallThreadPool |
final Set< ResourceCheckRunner > | resourceRunners |
boolean | isShuttingDown |
boolean | isShutDown |
This class is used by MasterComponentImplBase
and should not be exposed to subsystem developers directly. However, the contained interfaces SubsysResourceMonitor.ResourceChecker and SubsysResourceMonitor.ResourceErrorHandler can be implemented by master components to supply customized checkers and error handlers for various resource types and error recovery strategies.
|
Ctor, with default value for |
|
|
|
Cancels monitoring of all resources and leaves this object in an unusable state. Impl note: this method is synchronized so that a second call can return immediately, but only if the first call has finished.
|
|
For testing only. Returns the number of actively running threads, plus the number of tasks in the queue that is used for scheduling the monitoring calls. |
|
For testing only!
Gets the
|
|
Starts to periodically monitor the resource that In order to randomize check times even if many resources get signed up for monitoring one after the other, the initial delay before the first check is run is taken randomly between 1 second and the period time.
|
|
Same as monitorResource(alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceChecker, alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceErrorHandler, int), but with the default delay instead of a delay parameter. |
|
Resumes monitoring of all resources. This method has no effect if monitoring has not been previously suspended.
|
|
Stops monitoring a given resource.
|
|
Stops monitoring all resources. |
|
Suspends monitoring of all resources until resume() is called. Currently running monitor calls do not get stopped, only future calls are prevented. Note that the monitoring queue remains intact, while the monitor call itself becomes a no-op. |
|
The delay between two monitoring calls to resource. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|