Class AbstractWatchdog<T extends IDeviceWatchdogModel>
java.lang.Object
org.eclipse.scanning.sequencer.watchdog.AbstractWatchdog<T>
- All Implemented Interfaces:
IDeviceWatchdog<T>,IModelProvider<T>,INameable
- Direct Known Subclasses:
ExpressionWatchdog,TopupWatchdog
public abstract class AbstractWatchdog<T extends IDeviceWatchdogModel>
extends Object
implements IDeviceWatchdog<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Used by springvoidMake this device inactive, removes the watchdog from the service.getModel()getName()Name of the scannableprotected <S> IScannable<S> getScannable(String name) booleanisActive()booleanA disabled watch dog does not participate in a scan, but is not removed from the service.voidvoidvoidsetController(IDeviceController controller) Called by the framework when a device is created to run with a specific scan.voidsetEnabled(boolean enabled) A disabled watch dog does not participate in a scan, but is not removed from the service.voidThe model for some providers may be set but be warned that others throw an IllegalArgumentException.voidSet the name of the device.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.device.IDeviceWatchdog
getId, isPausingMethods inherited from interface org.eclipse.scanning.api.IModelProvider
updateModel
-
Field Details
-
model
-
controller
-
active
protected boolean active
-
-
Constructor Details
-
AbstractWatchdog
public AbstractWatchdog()
-
-
Method Details
-
getModel
- Specified by:
getModelin interfaceIModelProvider<T extends IDeviceWatchdogModel>- Returns:
- the model that we are providing
-
setModel
Description copied from interface:IModelProviderThe model for some providers may be set but be warned that others throw an IllegalArgumentException.- Specified by:
setModelin interfaceIModelProvider<T extends IDeviceWatchdogModel>- Parameters:
model-
-
getScannable
- Throws:
ScanningException
-
activate
public void activate()Used by spring- Specified by:
activatein interfaceIDeviceWatchdog<T extends IDeviceWatchdogModel>
-
deactivate
public void deactivate()Description copied from interface:IDeviceWatchdogMake this device inactive, removes the watchdog from the service.- Specified by:
deactivatein interfaceIDeviceWatchdog<T extends IDeviceWatchdogModel>
-
getController
-
setController
Description copied from interface:IDeviceWatchdogCalled by the framework when a device is created to run with a specific scan.- Specified by:
setControllerin interfaceIDeviceWatchdog<T extends IDeviceWatchdogModel>
-
scanStarted
public void scanStarted() -
scanFinally
public void scanFinally() -
isActive
public boolean isActive()- Specified by:
isActivein interfaceIDeviceWatchdog<T extends IDeviceWatchdogModel>- Returns:
- true if the watchdog is active in a scan and checking things.
-
getName
Description copied from interface:INameableName of the scannable -
setName
Description copied from interface:INameableSet the name of the device. -
isEnabled
public boolean isEnabled()Description copied from interface:IDeviceWatchdogA disabled watch dog does not participate in a scan, but is not removed from the service. *- Specified by:
isEnabledin interfaceIDeviceWatchdog<T extends IDeviceWatchdogModel>
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:IDeviceWatchdogA disabled watch dog does not participate in a scan, but is not removed from the service.- Specified by:
setEnabledin interfaceIDeviceWatchdog<T extends IDeviceWatchdogModel>- Parameters:
enabled-
-