Package com.xebialabs.xlrelease.script
Class ScriptLifeCycle
- java.lang.Object
-
- com.xebialabs.xlrelease.script.ScriptLifeCycle
-
@Component public class ScriptLifeCycle extends java.lang.ObjectA Life cycle finite state machine for script execution.
Its role is to maintain execution states of scripts and interrupt them.
A script can be in one the following states :- UNREGISTERED : when the script is not registered, it can't be interrupted. It is the initial state
- REGISTERED : when its execution ID has been created, but the script is not started yet. If interruption is asked, an InterruptedException will be thrown when trying to enter STARTED state
- STARTED : when the script has started. If interruption is asked, the thread will be interrupted if possible
- DONE : when the script has terminated, it can't be interrupted any more.
Possible transitions : start() REGISTERED ---------------- STARTED ^ | | | | unregister() | end() register() | | | | v v UNREGISTERED ---------------- DONE unregister()
-
-
Constructor Summary
Constructors Constructor Description ScriptLifeCycle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend(java.lang.String executionId)voidregister(java.lang.String executionId)voidreset(java.lang.String executionId)voidstart(java.lang.String executionId)voidtryAborting(java.lang.String executionId)voidunregister(java.lang.String executionId)
-
-
-
Method Detail
-
tryAborting
public void tryAborting(java.lang.String executionId)
-
register
public void register(java.lang.String executionId)
-
start
public void start(java.lang.String executionId) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
reset
public void reset(java.lang.String executionId) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
end
public void end(java.lang.String executionId)
-
unregister
public void unregister(java.lang.String executionId)
-
-