org.sapia.taskman
Class TaskContext

java.lang.Object
  |
  +--org.sapia.taskman.TaskContext

public class TaskContext
extends Object

Models the execution context of a Task.

Author:
Yanick Duchesne 15-Apr-2003

Method Summary
 void execAsyncNestedTask(String name, Task t)
          Triggers the asynchronous execution of the passed-in task.
 void execSyncNestedTask(String name, Class taskClass, TaskContext ctx)
          Triggers the synchronous execution of the task whose class is given.
 void execSyncNestedTask(String name, Task t)
          Triggers the synchronous execution of the passed-in task.
 TaskContext exportVal(Object key, Object value)
          "Exports" the given value to this context - binding it to the given key.
 TaskOutput getTaskOutput()
          Returns a TaskOutput.
 Object importVal(Object key)
          "Imports" the value corresponding to the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTaskOutput

public TaskOutput getTaskOutput()
Returns a TaskOutput.

Returns:
a TaskOutput.

exportVal

public TaskContext exportVal(Object key,
                             Object value)
"Exports" the given value to this context - binding it to the given key.

Parameters:
key - the key under which to import the given value.
value - the Object to export - if an object is already bound to the given key, it is overwritten.
Returns:
this instance, to allow for chained invocations.

importVal

public Object importVal(Object key)
"Imports" the value corresponding to the given key.

Parameters:
key - the key for which to retrieve the value.
Returns:
the Object that was bound to the given key, or null if no object could be found.
See Also:
exportVal(Object, Object)

execSyncNestedTask

public void execSyncNestedTask(String name,
                               Task t)
Triggers the synchronous execution of the passed-in task.

Parameters:
name - the name of the task to execute.
t - the Task to execute.

execAsyncNestedTask

public void execAsyncNestedTask(String name,
                                Task t)
Triggers the asynchronous execution of the passed-in task.

Parameters:
name - the name of the task to execute.
t - the Task to execute.

execSyncNestedTask

public void execSyncNestedTask(String name,
                               Class taskClass,
                               TaskContext ctx)
                        throws IllegalAccessException,
                               InstantiationException
Triggers the synchronous execution of the task whose class is given.

Parameters:
name - the name of the task to execute.
ctx - the TaskContext that will be passed to the task in its execution.
Throws:
IllegalAccessException - if the current thread does not have access to the class' no-arg constructor, or if the class is not public.
InstantiationException - if the task instance corresponding to the class could not be created.


Copyright © 2002 Sapia Open Community, Inc. All Rights Reserved.