public class RunnableTask extends AbstractRunnableTask implements RunnableInstance, RunnableInterface, ControlInterface, java.lang.Runnable
Task.ConnectionStatus
Modifier and Type | Field and Description |
---|---|
int |
packetsLeft
The count for the number of data packets still not output
|
execlisteners
DEFAULT_NODE_REQUIREMENT, DEPRECATED_GUI_XPOS, DEPRECATED_GUI_YPOS, ERROR_MESSAGE, ESSENTIAL, ESSENTIAL_IF_CONNECTED, EXECUTION_COUNT, EXECUTION_REQUEST_COUNT, EXECUTION_STATE, GUI_X, GUI_Y, NODE_PROPERTIES, NODE_REQUIREMENT, OPTIONAL, OUTPUT_TYPE
ANY_DATA_TYPE, CLONE_ALL_OUTPUT, CLONE_MULTIPLE_OUTPUT, COPY_OUTPUT, DEFAULT_IN_NODES, DEFAULT_INPUT_NODES, DEFAULT_MAX_NODES, DEFAULT_MIN_NODES, DEFAULT_OUT_NODES, DEFAULT_OUTPUT_NODES, DEFAULT_POP_UP_DESCRIPTION, DEFINITION_JAVA_CLASS, DEFINITION_METADATA, DEFINITION_TRIANA_XML, DEFINITION_UNKNOWN, GUI, GUI_BUILDER, HELP_FILE_PARAM, IMMEDIATE_UPDATE, INTERNAL, LATE_INITIALIZE, MAX_INPUT_NODES, MAX_OUTPUT_NODES, MIN_INPUT_NODES, MIN_OUTPUT_NODES, NO_UPDATE, OLD_GUI_BUILDER, ON_TASK_INSTANTIATION, ON_USER_ACCESS, OUTPUT_POLICY, PANEL_INSTANCE, PARAM_PANEL_CLASS, PARAM_PANEL_HIDE, PARAM_PANEL_INSTANTIATE, PARAM_PANEL_SHOW, PARAM_UPDATE_POLICY, POP_UP_DESCRIPTION, PROCESS_UPDATE, TOOL_VERSION, TRANSIENT, TRANSIENT_ACCESSIBLE, UNKNOWN_DATA_TYPE, UNKNOWN_TYPE, USER_ACCESSIBLE
Modifier | Constructor and Description |
---|---|
protected |
RunnableTask(Tool task,
TaskFactory factory,
boolean preserveinst) |
Modifier and Type | Method and Description |
---|---|
void |
afterProcess() |
void |
beforeProcess()
This function is called immediately before the unit's process() function is called
|
void |
dispose()
disposes of the running unit
|
ClipInStore |
extractClipInState() |
void |
finished()
Tells the Unit that an output node has finished sending the data.
|
java.lang.Object |
getClipIn(java.lang.Object data,
java.lang.String name) |
java.lang.Object |
getClipIn(java.lang.String name) |
ControlInterface |
getControlInterface() |
java.lang.Object |
getInput(int nodeNumber)
Returns the data at input node nodeNumber.
|
protected java.lang.Object |
getInput(RunnableNodeInterface node)
Returns the data at the specified input node.
|
Task |
getTask() |
ToolTable |
getToolTable() |
void |
initUnit()
Initializes the unit associated with this runnable task.
|
boolean |
isClipInName(java.lang.String name) |
boolean |
isInput(int nodeNumber) |
boolean |
isOutputSent(int outputNode) |
protected void |
notifyParameterSet(java.lang.String name,
java.lang.String type,
java.lang.Object oldval,
java.lang.Object newval)
Notifies all the task listeners that a parameter has been set.
|
void |
output(int outputNode,
java.lang.Object data,
boolean blocking)
Outputs the data to the given node outputNode.
|
void |
output(java.lang.Object data)
b Outputs the data from the unit.
|
void |
process()
Tries running the process() method.
|
void |
putClipIn(java.lang.String name,
java.lang.Object clipin)
Put the specified clip-in into this task's clip-in bucket
|
void |
queueClipIn(java.lang.String name,
java.lang.Object clipin)
Queue the specified clip-in to be inserted into the clip-in bucket when the task is next run
|
java.lang.Object |
removeClipIn(java.lang.String name)
Remove the clip-in with the specified name from this task.
|
void |
reset()
Order a unit to stop, resets the unit to its pre-run state
|
void |
restoreClipInState(ClipInStore store)
Restores a previously stored clip-in bucket state
|
void |
run()
This over-rides the RunnableUnit's run method so that we can display the data flow indicators on the icons when
we are processing data.
|
void |
runGroup()
Runs all the tasks within the group that this task belongs to.
|
void |
runTask(Task task)
Runs the specified task.
|
void |
startThread()
creates the thread to run the unit, or set a flag to re-run the existing thread
|
void |
wakeUp()
Tells a task to wake-up if data has been received on all of its essential nodes.
|
void |
wakeUp(Node node)
Tells the Task to wake up if data has been received on all of its essential nodes.
|
addExecutionListener, executionFinished, executionRequested, executionReset, executionStarting, getExecutionState, notifyError, pause, removeExecutionListener, resume, setParent, waitPause
addDataInputNode, addDataOutputNode, addDeclaredNodeProperty, addParameterInputNode, addParameterOutputNode, addTaskListener, getAbsoluteNodeIndex, getContext, getContextProperty, getDataInputNode, getDataInputNodeCount, getDataInputNodes, getDataOutputNode, getDataOutputNodeCount, getDataOutputNodes, getDeclaredNodeProperties, getDefaultNodeRequirement, getErrorMessage, getExecutionCount, getExecutionRequestCount, getInputNode, getInputNodes, getInstanceID, getNodeIndex, getNodeRequirement, getOutputNode, getOutputNodes, getParameterInputName, getParameterInputNode, getParameterInputNodeCount, getParameterInputNodes, getParameterOutputName, getParameterOutputNode, getParameterOutputNodeCount, getParameterOutputNodes, getParent, getQualifiedTaskName, getUltimateParent, init, isDataInputNode, isDataOutputNode, isParameterInputNode, isParameterOutputNode, isParameterTriggerNode, isRunContinuously, notifyNodeAdded, notifyNodeRemoved, notifyPropertyUpdate, notifyTaskDisposed, removeDataInputNode, removeDataOutputNode, removeNode, removeParameter, removeParameterInputNode, removeParameterOutputNode, removeProxy, removeTaskListener, setContextProperty, setDataInputNodeCount, setDataOutputNodeCount, setDeclaredNodeProperties, setDefaultNodeRequirement, setNodeRequirement, setParameter, setParameterInputs, setParameterOutputNames, setProxy, setRunContinuously, setSubTitle, setToolName, updateProxy
addExtension, addRenderingHint, getDataInputTypes, getDataInputTypes, getDataOutputTypes, getDataOutputTypes, getDefaultDataInputNodes, getDefaultDataOutputNodes, getDefinitionPath, getDefinitionType, getDisplayName, getDisplayPackage, getExtension, getExtensionNames, getHelpFile, getInputNodeCount, getMaxDataInputNodes, getMaxDataOutputNodes, getMinDataInputNodes, getMinDataOutputNodes, getOutputNodeCount, getParameter, getParameterNames, getParameterType, getPopUpDescription, getProperties, getProxy, getQualifiedToolName, getRenderingHint, getRenderingHints, getSubTitle, getToolBox, getToolName, getToolPackage, getUnitName, getUnitPackage, getVersion, isExtensionName, isParameterName, isRenderingHint, removeExtension, removeRenderingHint, setDataInputTypes, setDataInputTypes, setDataOutputTypes, setDataOutputTypes, setDefaultDataInputNodes, setDefaultDataOutputNodes, setDefinitionPath, setDefinitionType, setDisplayName, setDisplayPackage, setHelpFile, setMaxDataInputNodes, setMaxDataOutputNodes, setMinDataInputNodes, setMinDataOutputNodes, setParameterOutputs, setParameterType, setPopUpDescription, setProperties, setToolBox, setToolPackage, setVersion, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addExecutionListener, getExecutionState, pause, removeExecutionListener, resume
notifyError
addExtension, addRenderingHint, getDataInputTypes, getDataInputTypes, getDataOutputTypes, getDataOutputTypes, getDefaultDataInputNodes, getDefaultDataOutputNodes, getDefinitionPath, getDefinitionType, getDisplayName, getDisplayPackage, getExtension, getExtensionNames, getHelpFile, getInputNodeCount, getMaxDataInputNodes, getMaxDataOutputNodes, getMinDataInputNodes, getMinDataOutputNodes, getOutputNodeCount, getParameter, getParameterNames, getParameterType, getPopUpDescription, getProperties, getProxy, getQualifiedToolName, getRenderingHint, getRenderingHints, getSubTitle, getToolBox, getToolName, getToolPackage, getVersion, isExtensionName, isParameterName, isRenderingHint, removeExtension, removeRenderingHint, setDataInputTypes, setDataOutputTypes, setDefinitionPath, setDefinitionType, setHelpFile, setParameterOutputs, setParameterType, setPopUpDescription, setProperties, setToolBox, setToolPackage, setVersion
public int packetsLeft
protected RunnableTask(Tool task, TaskFactory factory, boolean preserveinst) throws TaskException
TaskException
public void initUnit() throws TaskException
TaskException
public Task getTask()
getTask
in interface RunnableInterface
public ControlInterface getControlInterface()
getControlInterface
in interface RunnableInterface
public ToolTable getToolTable()
getToolTable
in interface RunnableInterface
public java.lang.Object getClipIn(java.lang.String name)
getClipIn
in interface ClipableTaskInterface
public java.lang.Object getClipIn(java.lang.Object data, java.lang.String name)
getClipIn
in interface ClipableTaskInterface
public boolean isClipInName(java.lang.String name)
isClipInName
in interface ClipableTaskInterface
public void putClipIn(java.lang.String name, java.lang.Object clipin)
putClipIn
in interface ClipableTaskInterface
public void queueClipIn(java.lang.String name, java.lang.Object clipin)
queueClipIn
in interface ClipableTaskInterface
public java.lang.Object removeClipIn(java.lang.String name)
removeClipIn
in interface ClipableTaskInterface
public ClipInStore extractClipInState()
extractClipInState
in interface ClipableTaskInterface
public void restoreClipInState(ClipInStore store)
restoreClipInState
in interface ClipableTaskInterface
public final void finished()
finished
in interface RunnableInstance
finished
in class AbstractRunnableTask
public final void wakeUp()
wakeUp
in interface RunnableInstance
wakeUp
in class AbstractRunnableTask
public final void wakeUp(Node node)
wakeUp
in interface RunnableInstance
wakeUp
in class AbstractRunnableTask
public final void startThread()
public boolean isInput(int nodeNumber)
isInput
in interface RunnableInterface
public java.lang.Object getInput(int nodeNumber) throws OutOfRangeException, EmptyingException, NotCompatibleException
getInput
in interface RunnableInterface
nodeNumber
- the node you want to get the data from.OutOfRangeException
EmptyingException
NotCompatibleException
protected java.lang.Object getInput(RunnableNodeInterface node)
public void output(java.lang.Object data)
output
in interface RunnableInterface
data
- the data to be sentpublic void output(int outputNode, java.lang.Object data, boolean blocking)
output
in interface RunnableInterface
outputNode
- the output node you wish to setdata
- the data to be sentpublic boolean isOutputSent(int outputNode)
isOutputSent
in interface RunnableInterface
public void run()
run
in interface java.lang.Runnable
public void reset()
reset
in interface RunnableInstance
reset
in class AbstractRunnableTask
public void runTask(Task task) throws SchedulerException
runTask
in interface ControlInterface
SchedulerException
public void runGroup() throws SchedulerException
runGroup
in interface ControlInterface
SchedulerException
public void process()
public void beforeProcess()
public void afterProcess()
protected void notifyParameterSet(java.lang.String name, java.lang.String type, java.lang.Object oldval, java.lang.Object newval)
TaskImp
notifyParameterSet
in class TaskImp
public void dispose()
dispose
in interface Task
dispose
in class AbstractRunnableTask