org.syrup
Interface WorkSpace

All Known Implementing Classes:
SQLWorkSpace

public interface WorkSpace

Provides a client API to store and manage executions of PTasks. This is the main entry point for all functionality provided by Syrup and used by Workers.

Author:
Robbert van Dalen

Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 PTask execute(PTask task)
          Executes a single Task.
 Data get_out_1()
          Get the first output.
 Data get_out_2()
          Get the second output.
 Context[] get(PTaskTemplate template)
          Get the Contexts of PTasks that match the PTaskTemplate.
 LogEntry[] match(LogEntryTemplate template)
           
 PTask[] match(PTaskTemplate template)
          Get PTasks matching the PTaskTemplate.
 PTask[] remove(PTask[] tasks)
          Remove PTasks that are done.
 void reset()
          Resets the WorkSpace to the initial state.
 void set_in_1(Data data)
          Set the first input.
 void set_in_2(Data data)
          Set the second input.
 PTask stop(PTask task)
          Stop the possible non-progressing execution of a PTask.
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

reset

public void reset()
           throws java.lang.Exception
Resets the WorkSpace to the initial state.

Throws:
java.lang.Exception

set_in_1

public void set_in_1(Data data)
              throws java.lang.Exception
Set the first input.

Parameters:
data - The Data that is set on the first input.
Throws:
java.lang.Exception

set_in_2

public void set_in_2(Data data)
              throws java.lang.Exception
Set the second input.

Parameters:
data - The Data that is set on the second input.
Throws:
java.lang.Exception

get_out_1

public Data get_out_1()
               throws java.lang.Exception
Get the first output.

Returns:
The Data removed from the first output.
Throws:
java.lang.Exception

get_out_2

public Data get_out_2()
               throws java.lang.Exception
Get the second output.

Returns:
The Data removed from the second output.
Throws:
java.lang.Exception

match

public PTask[] match(PTaskTemplate template)
              throws java.lang.Exception
Get PTasks matching the PTaskTemplate.

Parameters:
template - The PTaskTemplate to be matched.
Returns:
An array of PTasks that match the PTaskTemplate.
Throws:
java.lang.Exception

get

public Context[] get(PTaskTemplate template)
              throws java.lang.Exception
Get the Contexts of PTasks that match the PTaskTemplate.

Parameters:
template - The PTaskTemplate to be matched.
Returns:
An array of Contexts surrounding the PTasks that match the PTaskTemplate.
Throws:
java.lang.Exception

execute

public PTask execute(PTask task)
              throws java.lang.Exception
Executes a single Task.

Parameters:
task - The PTask to be executed.
Returns:
The PTask that has been executed.
Throws:
java.lang.Exception

stop

public PTask stop(PTask task)
           throws java.lang.Exception
Stop the possible non-progressing execution of a PTask.

Parameters:
task - The PTask to be stopped.
Returns:
The stopped PTask.
Throws:
java.lang.Exception

remove

public PTask[] remove(PTask[] tasks)
               throws java.lang.Exception
Remove PTasks that are done.

Parameters:
tasks - The array of PTasks to remove.
Returns:
The array of PTasks that are removed.
Throws:
java.lang.Exception

match

public LogEntry[] match(LogEntryTemplate template)
                 throws java.lang.Exception
Parameters:
template - The LogEntryTemplate to be matched.
Returns:
An array of LogEntries that match the template.
Throws:
java.lang.Exception