org.globus.cog.karajan
Class KarajanWorkflow

java.lang.Object
  extended by org.globus.cog.karajan.KarajanWorkflow

public class KarajanWorkflow
extends Object

A basic interface to embedding workflows from Java


Constructor Summary
KarajanWorkflow()
          Default constructor
 
Method Summary
 Throwable getFailure()
          Get the throwable that caused the workflow to fail.
 boolean isDone()
          Checks if the workflow has finished executing
 boolean isFailed()
          Check if the workflow has failed
 void setSpecification(File spec)
          Sets and parses the workflow contained in the given file
 void setSpecification(String spec)
          Sets and parses the workflow contained in the given argument
 void start()
          Starts the workflow
 void waitFor()
          Waits for the workflow to finish
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KarajanWorkflow

public KarajanWorkflow()
Default constructor

Method Detail

setSpecification

public void setSpecification(String spec)
                      throws SpecificationException
Sets and parses the workflow contained in the given argument

Throws:
SpecificationException - if there is something wrong with the specification

setSpecification

public void setSpecification(File spec)
                      throws SpecificationException,
                             IOException
Sets and parses the workflow contained in the given file

Throws:
IOException - if an error occurs while reading the file
SpecificationException - if there is something wrong with the specification

start

public void start()
           throws IllegalStateException,
                  SpecificationException
Starts the workflow

Throws:
SpecificationException - if no specification was set
IllegaleStateException - if this workflow was started before
IllegalStateException

waitFor

public void waitFor()
             throws IllegalStateException,
                    InterruptedException
Waits for the workflow to finish

Throws:
IllegalStateException - if the workflow was never started
InterruptedException

isDone

public boolean isDone()
Checks if the workflow has finished executing


isFailed

public boolean isFailed()
Check if the workflow has failed


getFailure

public Throwable getFailure()
Get the throwable that caused the workflow to fail. Returns null if the workflow has not failed