Package hudson.node_monitors
Class AbstractAsyncNodeMonitorDescriptor<T>
- java.lang.Object
-
- hudson.model.Descriptor<NodeMonitor>
-
- hudson.node_monitors.AbstractNodeMonitorDescriptor<T>
-
- hudson.node_monitors.AbstractAsyncNodeMonitorDescriptor<T>
-
- Type Parameters:
T
- represents the result of the monitoring.
- Direct Known Subclasses:
ArchitectureMonitor.DescriptorImpl
,ClockMonitor.DescriptorImpl
,DiskSpaceMonitorDescriptor
,SwapSpaceMonitor.DescriptorImpl
public abstract class AbstractAsyncNodeMonitorDescriptor<T> extends AbstractNodeMonitorDescriptor<T>
Sophisticated version ofAbstractNodeMonitorDescriptor
that performs monitoring on all agents concurrently and asynchronously.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractAsyncNodeMonitorDescriptor.Result<T>
Result object formonitorDetailed()
to facilitate extending information returned in the future.-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAsyncNodeMonitorDescriptor()
protected
AbstractAsyncNodeMonitorDescriptor(long interval)
protected
AbstractAsyncNodeMonitorDescriptor(Class<? extends NodeMonitor> clazz)
protected
AbstractAsyncNodeMonitorDescriptor(Class<? extends NodeMonitor> clazz, long interval)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract hudson.remoting.Callable<T,IOException>
createCallable(Computer c)
Creates aCallable
that performs the monitoring when executed.protected Map<Computer,T>
monitor()
Performs all monitoring concurrently.protected T
monitor(Computer c)
Performs monitoring of the given computer object.protected AbstractAsyncNodeMonitorDescriptor.Result<T>
monitorDetailed()
Perform monitoring with detailed reporting.-
Methods inherited from class hudson.node_monitors.AbstractNodeMonitorDescriptor
get, getMonitoringTimeOut, getTimestamp, getTimestampString, isIgnored, markOffline, markOffline, markOnline
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Constructor Detail
-
AbstractAsyncNodeMonitorDescriptor
protected AbstractAsyncNodeMonitorDescriptor()
-
AbstractAsyncNodeMonitorDescriptor
protected AbstractAsyncNodeMonitorDescriptor(long interval)
-
AbstractAsyncNodeMonitorDescriptor
protected AbstractAsyncNodeMonitorDescriptor(Class<? extends NodeMonitor> clazz)
-
AbstractAsyncNodeMonitorDescriptor
protected AbstractAsyncNodeMonitorDescriptor(Class<? extends NodeMonitor> clazz, long interval)
-
-
Method Detail
-
createCallable
@CheckForNull protected abstract hudson.remoting.Callable<T,IOException> createCallable(Computer c)
Creates aCallable
that performs the monitoring when executed.
-
monitor
protected T monitor(Computer c) throws IOException, InterruptedException
Description copied from class:AbstractNodeMonitorDescriptor
Performs monitoring of the given computer object. This method is invoked periodically to perform the monitoring of the computer.- Specified by:
monitor
in classAbstractNodeMonitorDescriptor<T>
- Returns:
- Application-specific value that represents the observed monitoring value
on the given node. This value will be returned from the
AbstractNodeMonitorDescriptor.get(Computer)
method. If null is returned, it will be interpreted as "no observed value." This is convenient way of abandoning the observation on a particular computer, whereasIOException
is useful for indicating a hard error that needs to be corrected. - Throws:
IOException
InterruptedException
-
monitor
protected Map<Computer,T> monitor() throws InterruptedException
Performs all monitoring concurrently.- Overrides:
monitor
in classAbstractNodeMonitorDescriptor<T>
- Returns:
- Mapping from computer to monitored value. The map values can be null for several reasons, see
AbstractAsyncNodeMonitorDescriptor.Result
for more details. - Throws:
InterruptedException
-
monitorDetailed
@NonNull protected final AbstractAsyncNodeMonitorDescriptor.Result<T> monitorDetailed() throws InterruptedException
Perform monitoring with detailed reporting.- Throws:
InterruptedException
-
-