org.gcube.vremanagement.executor.state
Class TaskRuntime

java.lang.Object
  extended by org.gcube.vremanagement.executor.state.TaskRuntime

public class TaskRuntime
extends java.lang.Object

The runtime environment of the task.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
static class TaskRuntime.Entry
          A wrapper for named output to be used for bulk addition.
 
Constructor Summary
TaskRuntime()
          Creates an instance.
TaskRuntime(TaskResource resource)
          Creates an instance with an associated TaskResource
 
Method Summary
 java.lang.Object addOutput(java.lang.String name, java.lang.Object value)
          Adds an output.
 void addOutput(TaskRuntime.Entry... entries)
          Adds one or more outputs.
 ExecutorPluginContext getContext()
          Returns the context of the plugin's task.
 java.lang.Object getInput(java.lang.String name)
          Returns an input given its name.
 java.util.Map<java.lang.String,java.lang.Object> getInputs()
          Returns the task inputs.
 java.util.Calendar getStartTime()
          Returns the start time of the task.
 void removeOutput(java.lang.String... names)
          Removes one or more outputs.
 void throwException(java.lang.Exception e)
          Throws an exception shows as the value of the error RP.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskRuntime

public TaskRuntime()
Creates an instance.


TaskRuntime

public TaskRuntime(TaskResource resource)
Creates an instance with an associated TaskResource

Parameters:
resource -
Method Detail

getContext

public ExecutorPluginContext getContext()
Returns the context of the plugin's task.

Returns:
the context.

getStartTime

public java.util.Calendar getStartTime()
Returns the start time of the task.

Returns:
the start time.

getInputs

public java.util.Map<java.lang.String,java.lang.Object> getInputs()
Returns the task inputs.

Returns:
the inputs.

getInput

public java.lang.Object getInput(java.lang.String name)
Returns an input given its name.

Returns:
the input.

addOutput

public java.lang.Object addOutput(java.lang.String name,
                                  java.lang.Object value)
Adds an output.

Parameters:
name - the name of the output.
value - the output.
Returns:
any output previously stored with the same name.

addOutput

public void addOutput(TaskRuntime.Entry... entries)
Adds one or more outputs.

Parameters:
entries - the outputs.

removeOutput

public void removeOutput(java.lang.String... names)
Removes one or more outputs.

Parameters:
names - the name of the outputs

throwException

public void throwException(java.lang.Exception e)
Throws an exception shows as the value of the error RP.

Parameters:
e - the exception.