Interface IBeanProcess<T>
- Type Parameters:
T- the type of bean this process is for
- All Superinterfaces:
IPublishable<T>
- All Known Implementing Classes:
AbstractLockingPausableProcess,CommandProcess,ScanProcess
A bean process is a process that can be created from a bean which defines it. For example
a
ScanBean defines a scan process.-
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.default booleanbooleanisPaused()Returns whether the process is paused.voidpause()Call to pause the running process.voidresume()Call to resume the process.default voidstart()If the process is non-blocking this method will start a thread which calls execute (and the method will return).voidPlease provide a termination for the process by implementing this method.Methods inherited from interface org.eclipse.scanning.api.event.core.IPublishable
getBean, getPublisher
-
Method Details
-
execute
Execute 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. -
start
If the process is non-blocking this method will start a thread which calls execute (and the method will return). By default a process blocks until it is done. isBlocking() and start() may be overridden to redefine this.- Throws:
EventExceptionInterruptedException
-
isBlocking
default boolean isBlocking() -
terminate
Please 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.- Throws:
EventException
-
pause
Call to pause the running process.- Throws:
EventException
-
resume
Call to resume the process.- Throws:
EventException
-
isPaused
boolean isPaused()Returns whether the process is paused. If usingAbstractLockingPausableProcess, it will be automatically.- Returns:
trueif the process is paused,falseotherwise
-