|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.workflow.NodeContainer
org.knime.core.node.workflow.SingleNodeContainer
public final class SingleNodeContainer
Holds a node in addition to some status information.
Nested Class Summary | |
---|---|
static class |
SingleNodeContainer.MemoryPolicy
Available policy how to handle output data. |
static class |
SingleNodeContainer.SingleNodeContainerSettings
Handles the settings specific to a SingleNodeContainer. |
Nested classes/interfaces inherited from class org.knime.core.node.workflow.NodeContainer |
---|
NodeContainer.NodeContainerSettings, NodeContainer.State |
Field Summary | |
---|---|
(package private) static String |
CFG_MEMORY_POLICY
Config key: What memory policy to use for a node outport. |
Fields inherited from class org.knime.core.node.workflow.NodeContainer |
---|
m_nodeMutex |
Constructor Summary | |
---|---|
SingleNodeContainer(WorkflowManager parent,
NodeID id,
SingleNodeContainerPersistor persistor)
Create new SingleNodeContainer from persistor. |
|
SingleNodeContainer(WorkflowManager parent,
Node n,
NodeID id)
Create new SingleNodeContainer based on existing Node. |
Method Summary | |
---|---|
boolean |
areDialogAndNodeSettingsEqual()
|
(package private) boolean |
areSettingsValid(NodeSettingsRO settings)
|
(package private) void |
cancelExecution()
Cancel execution of a marked, queued, or executing node. |
(package private) void |
cleanup()
Method that's called when the node is discarded. |
(package private) boolean |
configure(PortObjectSpec[] inObjectSpecs)
Configure underlying node and update state accordingly. |
ExecutionContext |
createExecutionContext()
|
SingleNodeContainerExecutionResult |
createExecutionResult(ExecutionMonitor exec)
Saves all internals that are necessary to mimic the computed result into a new execution result object. |
(package private) void |
enableReQueuing()
Queue underlying node for re-execution (= update state accordingly). |
protected NodeContainerPersistor |
getCopyPersistor(HashMap<Integer,ContainerTable> tableRep,
boolean preserveDeletableFlags)
Get a new persistor that is used to copy this node (copy&paste action). |
(package private) NodeDialogPane |
getDialogPane()
|
(package private) NodeDialogPane |
getDialogPaneWithSettings(PortObjectSpec[] inSpecs)
|
(package private) FlowObjectStack |
getFlowObjectStack()
|
URL |
getIcon()
|
NodeInPort |
getInPort(int index)
Return a port, which for the inputs really only holds the type and some other static information. |
BufferedDataTable[] |
getInternalHeldTables()
Get the tables that are kept by the underlying node. |
(package private) Node.LoopRole |
getLoopRole()
|
String |
getName()
|
(package private) Node |
getNode()
Get the underlying node. |
Node |
getNodeReferenceBug2136()
Deprecated. Method will be reduced to package scope in future version, currently public to enable workaround for bug #2136 (see also bug #2137) |
AbstractNodeView<NodeModel> |
getNodeView(int i)
Return the view with the specified index provided by the node. |
String |
getNodeViewName(int i)
|
int |
getNrInPorts()
|
int |
getNrNodeViews()
Returns the number of views provided by the node implementation. |
int |
getNrOutPorts()
|
(package private) SingleNodeContainer.MemoryPolicy |
getOutDataMemoryPolicy()
Get the policy for the data outports, that is, keep the output in main memory or write it to disc. |
NodeOutPort |
getOutPort(int index)
Returns the output port for the given portID . |
(package private) SingleNodeContainer.SingleNodeContainerSettings |
getSingleNodeContainerSettings()
|
NodeFactory.NodeType |
getType()
|
Element |
getXMLDescription()
|
boolean |
hasDialog()
|
protected boolean |
isLocalWFM()
Is this node a to be locally executed workflow. |
(package private) boolean |
isResetable()
check if node can be safely reset. |
(package private) NodeID[] |
loadContent(NodeContainerPersistor nodePersistor,
Map<Integer,BufferedDataTable> tblRep,
FlowObjectStack inStack,
ExecutionMonitor exec,
WorkflowPersistor.LoadResult loadResult,
boolean preserveNodeMessage)
Restore content from persistor. |
void |
loadExecutionResult(NodeContainerExecutionResult execResult,
ExecutionMonitor exec,
WorkflowPersistor.LoadResult loadResult)
Load information from execution result. |
(package private) void |
loadSettings(NodeSettingsRO settings)
|
(package private) void |
loadSNCSettings(NodeSettingsRO settings)
Loads the SingleNodeContainer settings from the argument. |
(package private) void |
markForExecution(boolean flag)
Enable (or disable) queuing of underlying node for execution. |
(package private) void |
mimicRemoteExecuted(NodeContainerExecutionStatus status)
Put this node into either the NodeContainer.State.EXECUTED or
NodeContainer.State.IDLE state depending on the argument. |
(package private) void |
mimicRemoteExecuting()
Marks this node as remotely executing. |
(package private) void |
mimicRemotePostExecute()
Puts this node (and all its children) into the NodeContainer.State.POSTEXECUTE
state. |
(package private) void |
mimicRemotePreExecute()
Puts this node (and all its children) into the NodeContainer.State.PREEXECUTE
state. |
NodeContainerExecutionStatus |
performExecuteNode(PortObject[] inObjects)
Execute underlying Node asynchronously. |
(package private) void |
performShutdown()
Called when the workflow is to be disposed. |
(package private) void |
performStateTransitionEXECUTED(NodeContainerExecutionStatus status)
This should be used to change the nodes states correctly (and likely needs to be synchronized with other changes visible to successors of this node as well!) AFTER the actual execution. |
(package private) void |
performStateTransitionEXECUTING()
This should be used to change the nodes states correctly (and likely needs to be synchronized with other changes visible to successors of this node as well!) BEFORE the actual execution. |
(package private) void |
performStateTransitionPOSTEXECUTE()
Called when the state of a node should switch from NodeContainer.State.EXECUTING (or NodeContainer.State.EXECUTINGREMOTELY ) to
NodeContainer.State.POSTEXECUTE . |
(package private) boolean |
performStateTransitionPREEXECUTE()
Called when the state of a node should switch from NodeContainer.State.QUEUED to NodeContainer.State.PREEXECUTE . |
(package private) void |
reset()
Reset underlying node and update state accordingly. |
(package private) void |
saveSettings(NodeSettingsWO settings)
|
(package private) void |
saveSNCSettings(NodeSettingsWO settings)
Saves the SingleNodeContainer settings such as the job executor to the argument node settings object. |
void |
setDirty()
Overridden to also ensure that outport tables are "open" (node directory is deleted upon save() - so the tables are better copied into temp). |
(package private) void |
setFlowObjectStack(FlowObjectStack st)
Set FlowObjectStack . |
(package private) void |
setInHiLiteHandler(int index,
HiLiteHandler hdl)
Set a new HiLiteHandler for an incoming connection. |
(package private) void |
setJobManager(NodeExecutionJobManager je)
Set a new NodeExecutionJobManager for this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final String CFG_MEMORY_POLICY
Constructor Detail |
---|
SingleNodeContainer(WorkflowManager parent, Node n, NodeID id)
parent
- the workflow manager holding this noden
- the underlying nodeid
- the unique identifierSingleNodeContainer(WorkflowManager parent, NodeID id, SingleNodeContainerPersistor persistor)
parent
- the workflow manager holding this nodeid
- the identifierpersistor
- to read fromMethod Detail |
---|
Node getNode()
@Deprecated public Node getNodeReferenceBug2136()
public int getNrOutPorts()
getNrOutPorts
in class NodeContainer
public int getNrInPorts()
getNrInPorts
in class NodeContainer
public NodeOutPort getOutPort(int index)
portID
. This port
is essentially a container for the underlying Node and the index and will
retrieve all interesting data from the Node.
getOutPort
in class NodeContainer
index
- The output port's ID.
IndexOutOfBoundsException
- If the index is out of range.public NodeInPort getInPort(int index)
getInPort
in class NodeContainer
index
- the index of the input port
final SingleNodeContainer.MemoryPolicy getOutDataMemoryPolicy()
void setInHiLiteHandler(int index, HiLiteHandler hdl)
index
- index of porthdl
- new HiLiteHandlerpublic AbstractNodeView<NodeModel> getNodeView(int i)
getNodeView
in class NodeContainer
i
- the view to create
public String getNodeViewName(int i)
getNodeViewName
in class NodeContainer
public int getNrNodeViews()
getNrNodeViews
in class NodeContainer
void cleanup()
cleanup
in class NodeContainer
void setJobManager(NodeExecutionJobManager je)
setJobManager
in class NodeContainer
je
- the new job manager.public ExecutionContext createExecutionContext()
boolean configure(PortObjectSpec[] inObjectSpecs)
inObjectSpecs
- input table specifications
IllegalStateException
- in case of illegal entry state.boolean isResetable()
isResetable
in class NodeContainer
void reset()
IllegalStateException
- in case of illegal entry state.void markForExecution(boolean flag)
markForExecution
in class NodeContainer
flag
- determines if node is marked or unmarked for execution
IllegalStateException
- in case of illegal entry state.void enableReQueuing()
IllegalStateException
- in case of illegal entry state.void cancelExecution()
cancelExecution
in class NodeContainer
void performShutdown()
performShutdown
in class NodeContainer
void mimicRemotePreExecute()
NodeContainer.State.PREEXECUTE
state. This method is used when a workflow is executed remotely.
mimicRemotePreExecute
in class NodeContainer
void mimicRemoteExecuting()
mimicRemoteExecuting
in class NodeContainer
void mimicRemotePostExecute()
NodeContainer.State.POSTEXECUTE
state. This method is used when a workflow is executed remotely.
mimicRemotePostExecute
in class NodeContainer
void mimicRemoteExecuted(NodeContainerExecutionStatus status)
NodeContainer.State.EXECUTED
or
NodeContainer.State.IDLE
state depending on the argument. This method is
applied recursively on all of this node's children (if a meta node).
mimicRemoteExecuted
in class NodeContainer
status
- Where to get the success flag from.boolean performStateTransitionPREEXECUTE()
NodeContainer.State.QUEUED
to NodeContainer.State.PREEXECUTE
. The method is to be
called from the node's parent in a synchronized environment.
performStateTransitionPREEXECUTE
in class NodeContainer
void performStateTransitionEXECUTING()
performStateTransitionEXECUTING
in class NodeContainer
void performStateTransitionPOSTEXECUTE()
NodeContainer.State.EXECUTING
(or NodeContainer.State.EXECUTINGREMOTELY
) to
NodeContainer.State.POSTEXECUTE
. The method is to be called from the node's
parent in a synchronized environment.
performStateTransitionPOSTEXECUTE
in class NodeContainer
void performStateTransitionEXECUTED(NodeContainerExecutionStatus status)
performStateTransitionEXECUTED
in class NodeContainer
status
- indicates if execution was successfulpublic NodeContainerExecutionStatus performExecuteNode(PortObject[] inObjects)
inObjects
- input data
IllegalStateException
- in case of illegal entry state.void loadSettings(NodeSettingsRO settings) throws InvalidSettingsException
loadSettings
in class NodeContainer
InvalidSettingsException
NodeID[] loadContent(NodeContainerPersistor nodePersistor, Map<Integer,BufferedDataTable> tblRep, FlowObjectStack inStack, ExecutionMonitor exec, WorkflowPersistor.LoadResult loadResult, boolean preserveNodeMessage) throws CanceledExecutionException
loadContent
in class NodeContainer
nodePersistor
- To load from.tblRep
- A table repository to restore BufferedDatTablesinStack
- Incoming FlowObjectStack
.exec
- For progressloadResult
- Where to report errors/warnings topreserveNodeMessage
- Whether possible node messages in the
persistor are to be preserved (parameter to configure method
that is called during load).
CanceledExecutionException
- If canceled.public void loadExecutionResult(NodeContainerExecutionResult execResult, ExecutionMonitor exec, WorkflowPersistor.LoadResult loadResult)
super.loadEx...
.
loadExecutionResult
in class NodeContainer
execResult
- The execution result (contains port objects, messages, etc)exec
- For progress information (no cancelation supported)loadResult
- A load result that contains, e.g. error messages.public SingleNodeContainerExecutionResult createExecutionResult(ExecutionMonitor exec) throws CanceledExecutionException
#loadExecutionResult(NodeContainerExecutionResult, ExecutionMonitor, LoadResult)
is called).
createExecutionResult
in class NodeContainer
exec
- For progress information (this method will copy port
objects).
CanceledExecutionException
- If canceled.void saveSettings(NodeSettingsWO settings)
saveSettings
in class NodeContainer
void saveSNCSettings(NodeSettingsWO settings)
settings
- To save to.loadSNCSettings(NodeSettingsRO)
void loadSNCSettings(NodeSettingsRO settings) throws InvalidSettingsException
saveSNCSettings(NodeSettingsWO)
.
settings
- To load from.
InvalidSettingsException
- If settings are invalid.SingleNodeContainer.SingleNodeContainerSettings getSingleNodeContainerSettings()
boolean areSettingsValid(NodeSettingsRO settings)
areSettingsValid
in class NodeContainer
void setFlowObjectStack(FlowObjectStack st)
FlowObjectStack
.
st
- new stackFlowObjectStack getFlowObjectStack()
Node.LoopRole getLoopRole()
public String getName()
getName
in class NodeContainer
public boolean hasDialog()
hasDialog
in class NodeContainer
NodeDialogPane getDialogPaneWithSettings(PortObjectSpec[] inSpecs) throws NotConfigurableException
getDialogPaneWithSettings
in class NodeContainer
NotConfigurableException
NodeDialogPane getDialogPane()
getDialogPane
in class NodeContainer
public boolean areDialogAndNodeSettingsEqual()
areDialogAndNodeSettingsEqual
in class NodeContainer
public BufferedDataTable[] getInternalHeldTables()
BufferedDataTableHolder
or (b) the node
is not executed.
BufferedDataTableHolder
,
Node.getInternalHeldTables()
public NodeFactory.NodeType getType()
getType
in class NodeContainer
public URL getIcon()
getIcon
in class NodeContainer
public Element getXMLDescription()
protected boolean isLocalWFM()
This method returns false for all single node container.
isLocalWFM
in class NodeContainer
public void setDirty()
setDirty
in class NodeContainer
protected NodeContainerPersistor getCopyPersistor(HashMap<Integer,ContainerTable> tableRep, boolean preserveDeletableFlags)
getCopyPersistor
in class NodeContainer
tableRep
- Table repository of the destination.preserveDeletableFlags
- Whether the "isdeleteable" annotation
should be copied also (false when individual nodes are copied
but true when an entire meta node is copied).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |