com.abiquo.api.Workflow Class Reference

Job aggregation facility. More...

Inherits AbstractTask.

List of all members.

Public Member Functions

 Workflow ()
 Creates a new empty workflow.
 Workflow (Object callbackHandler)
 Constructs a new empty workflow.
 Workflow (WorkflowConfiguration configur)
 Constructs a new workflow.
void add (AbstractTask task)
 Adds a job to the workflow.
IXMLMessage call () throws FrameworkException
 Workflow as task, starting all task and blocking until all are done.
void chain (AbstractTask task1, AbstractTask task2)
 Add two tasks and make first start at the end of the second.
void connect (AbstractTask task, AbstractTask.State state, Method callback)
 Runs a callback when the job reach the given state.
void destroyAllResources (Workflow workflow)
 Cause the unprovisioning of all resources used on the workflow.
WorkflowConfiguration getConfiguration ()
 Obtains the used configuration.
List< AbstractTask > getWorks ()
 Returns all the jobs associated to workflow.
boolean isFinish ()
 Return the workflow state is finish.
void launch () throws FrameworkException
 The jobs composing the workflow are started.
void launch (boolean isBlocking) throws FrameworkException
 All the jobs and other workflows composed on the workflow are started.
void setConfiguration (WorkflowConfiguration con)
 Changes the default workflow configuration.


Detailed Description

Job aggregation facility.

It can compose tasks (jobs and another workflows).

Assistant class that helps to manage the job states. Natural way of treat more than one job on no blocking way. It's the class that initialize the job submit (waiting if necessary the end of its dependencies).


Constructor & Destructor Documentation

com.abiquo.api.Workflow.Workflow ( Object  callbackHandler  ) 

Constructs a new empty workflow.

Parameters:
callingClass the task callback handler

com.abiquo.api.Workflow.Workflow ( WorkflowConfiguration  configur  ) 

Constructs a new workflow.

Parameters:
config workflow behavior (exceptions and exceptions handler)


Member Function Documentation

void com.abiquo.api.Workflow.add ( AbstractTask  task  ) 

Adds a job to the workflow.

All the jobs in a workflow added throw this call are started in parallel.

Parameters:
task the task to be added without dependences
TODO assert task is unstarted

IXMLMessage com.abiquo.api.Workflow.call (  )  throws FrameworkException

Workflow as task, starting all task and blocking until all are done.

Returns:
null. The result list can not be combined in a single result.
Exceptions:
FrameworkException When some exception can not be resolved at exception handler.
Todo:
Reduce results and return

void com.abiquo.api.Workflow.chain ( AbstractTask  task1,
AbstractTask  task2 
)

Add two tasks and make first start at the end of the second.

transition from task states task1.FINISH --> task2.START

Parameters:
task1 the initial task
task2 the final task

void com.abiquo.api.Workflow.connect ( AbstractTask  task,
AbstractTask.State  state,
Method  callback 
)

Runs a callback when the job reach the given state.

Defines transactions to task callback handler at certain job state. Callback method take task as input parameter.

Parameters:
task the task whose state is being inquired
state the state that trigger the callback
callback method to call when the transaction appears

void com.abiquo.api.Workflow.destroyAllResources ( Workflow  workflow  ) 

Cause the unprovisioning of all resources used on the workflow.

Parameters:
workflow the workflow whose resources instances will be destroyed

WorkflowConfiguration com.abiquo.api.Workflow.getConfiguration (  ) 

Obtains the used configuration.

Returns:
the configuration containing exception and callback handlers

List<AbstractTask> com.abiquo.api.Workflow.getWorks (  ) 

Returns all the jobs associated to workflow.

Returns:
a list of abstract work (jobs or workflow)

boolean com.abiquo.api.Workflow.isFinish (  ) 

Return the workflow state is finish.

Returns:
true if all the jobs aggregate by "add" and "chain" are at finish state.

void com.abiquo.api.Workflow.launch (  )  throws FrameworkException

The jobs composing the workflow are started.

Blocking until all jobs arrive at finish state.

Exceptions:
FrameworkException when some task exception can not be resolved at exception handler.

void com.abiquo.api.Workflow.launch ( boolean  isBlocking  )  throws FrameworkException

All the jobs and other workflows composed on the workflow are started.

It make start from all the jobs added without dependence (using add method). At some finish, try to start its dependent tasks.

Parameters:
isBlocking - denotes if this call block until all its jobs have FINISH state, or if the programmer consult workflow.isFinish()
Exceptions:
FrameworkException when some task exception can not be resolved at exception handler.

void com.abiquo.api.Workflow.setConfiguration ( WorkflowConfiguration  con  ) 

Changes the default workflow configuration.

Parameters:
con the new configuration


The documentation for this class was generated from the following file:

Generated on Mon Sep 15 20:13:10 2008 for FrameworkAPI by  doxygen 1.5.5