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,ResponseTimeMonitor.DescriptorImpl,SwapSpaceMonitor.DescriptorImpl
public abstract class AbstractAsyncNodeMonitorDescriptor<T> extends AbstractNodeMonitorDescriptor<T>
Sophisticated version ofAbstractNodeMonitorDescriptorthat performs monitoring on all agents concurrently and asynchronously.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractAsyncNodeMonitorDescriptor.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 protectedAbstractAsyncNodeMonitorDescriptor()protectedAbstractAsyncNodeMonitorDescriptor(long interval)protectedAbstractAsyncNodeMonitorDescriptor(Class<? extends NodeMonitor> clazz)protectedAbstractAsyncNodeMonitorDescriptor(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 aCallablethat performs the monitoring when executed.protected Map<Computer,T>monitor()Performs all monitoring concurrently.protected Tmonitor(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
canTakeOffline, get, getConfigPage, 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, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, 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 aCallablethat performs the monitoring when executed.
-
monitor
protected T monitor(Computer c) throws IOException, InterruptedException
Description copied from class:AbstractNodeMonitorDescriptorPerforms monitoring of the given computer object. This method is invoked periodically to perform the monitoring of the computer.- Specified by:
monitorin 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, whereasIOExceptionis useful for indicating a hard error that needs to be corrected. - Throws:
IOExceptionInterruptedException
-
monitor
protected Map<Computer,T> monitor() throws InterruptedException
Performs all monitoring concurrently.- Overrides:
monitorin classAbstractNodeMonitorDescriptor<T>- Returns:
- Mapping from computer to monitored value. The map values can be null for several reasons, see
AbstractAsyncNodeMonitorDescriptor.Resultfor more details. - Throws:
InterruptedException
-
monitorDetailed
@NonNull protected final AbstractAsyncNodeMonitorDescriptor.Result<T> monitorDetailed() throws InterruptedException
Perform monitoring with detailed reporting.- Throws:
InterruptedException
-
-