Class ScriptLifeCycle

java.lang.Object
com.xebialabs.xlrelease.script.ScriptLifeCycle

@Component public class ScriptLifeCycle extends Object

A 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()