Class ScanProcess
java.lang.Object
org.eclipse.scanning.server.servlet.ScanProcess
- All Implemented Interfaces:
IBeanProcess<ScanBean>,IPublishable<ScanBean>
Object for running a scan.
TODO: DAQ-1960 - make ScanProcess solely responsible for updating the ScanBean at present this is split between
ScanProcess and AcquisitionDevice
-
Constructor Summary
ConstructorsConstructorDescriptionScanProcess(ScanBean scanBean, IPublisher<ScanBean> response, boolean blocking) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute the process, if an exception is thrown the process is set to failed and the message is the message of the exception.getBean()booleanisPaused()Returns whether the process is paused.voidpause()Call to pause the running process.voidresume()Call to resume the process.voidPlease provide a termination for the process by implementing this method.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.event.core.IBeanProcess
isBlocking, start
-
Constructor Details
-
ScanProcess
public ScanProcess(ScanBean scanBean, IPublisher<ScanBean> response, boolean blocking) throws EventException - Throws:
EventException
-
-
Method Details
-
pause
Description copied from interface:IBeanProcessCall to pause the running process.- Specified by:
pausein interfaceIBeanProcess<ScanBean>- Throws:
EventException
-
resume
Description copied from interface:IBeanProcessCall to resume the process.- Specified by:
resumein interfaceIBeanProcess<ScanBean>- Throws:
EventException
-
terminate
Description copied from interface:IBeanProcessPlease provide a termination for the process by implementing this method. If the process has a stop file, write it now; if it needs to be killed, get its pid and kill it; if it is running on a cluster, use the qdel or dramaa api.- Specified by:
terminatein interfaceIBeanProcess<ScanBean>- Throws:
EventException
-
execute
Description copied from interface:IBeanProcessExecute the process, if an exception is thrown the process is set to failed and the message is the message of the exception. This is the blocking method to run the process. The start method will be called by theIJobQueue's consumer thread running the process and by default terminate is called in the same thread.- Specified by:
executein interfaceIBeanProcess<ScanBean>- Throws:
EventException
-
isPaused
public boolean isPaused()Description copied from interface:IBeanProcessReturns whether the process is paused. If usingAbstractLockingPausableProcess, it will be automatically.- Specified by:
isPausedin interfaceIBeanProcess<ScanBean>- Returns:
trueif the process is paused,falseotherwise
-
getBean
- Specified by:
getBeanin interfaceIPublishable<ScanBean>- Returns:
- the bean which this process is currently running.
-
getPublisher
- Specified by:
getPublisherin interfaceIPublishable<ScanBean>- Returns:
- the bean which this process is currently running.
-