org.knime.core.node.workflow
Interface NodeExecutionJobManager

All Known Implementing Classes:
ThreadNodeExecutionJobManager

public interface NodeExecutionJobManager

Main entry point for compute intensive jobs. Controls resource (thread) allocation...

Author:
M. Berthold & B. Wiswedel, University of Konstanz

Method Summary
 boolean canDisconnect(NodeExecutionJob job)
          Returns true, if a executing job continues running even after closing the workflow - and if this manager can reconnect to this job after re-opening the workflow again.
 boolean canSaveInternals()
           
 void closeAllViews()
          Close all open views.
 PortObjectSpec[] configure(PortObjectSpec[] inSpecs, PortObjectSpec[] nodeModelOutSpecs)
          In case the executor modifies the result of the underlying node it can create the appropriate output specs.
 void disconnect(NodeExecutionJob job)
          Disconnects the running job.
 URL getIcon()
           
 String getID()
          Returns a unique ID of this job manager implementations.
 NodeExecutionJobManagerPanel getSettingsPanelComponent(NodeContainer.NodeContainerSettings.SplitType nodeSplitType)
          Creates a new instance of a panel that holds components to display the job manager's settings and to allow the user to enter new values.
 NodeView<NodeModel> getView(NodeContainer nc)
          Return a new instance of a node view for the job of the provided node.
 String getViewName(NodeContainer nc)
          Creates a title for the corresponding view.
 boolean hasView()
          Returns true if this job manager provides a view.
 void load(NodeSettingsRO settings)
          Restores the properties of the specific job manager.
 NodeExecutionJob loadFromReconnectSettings(NodeSettingsRO settings, PortObject[] inports, NodeContainer nc)
          Read the information previously stored in the settings object and restore an executing job.
 void loadInternals(ReferencedFile directory)
          Restore the internals from a directory.
 void resetAllViews()
          Called when the underlying node is reset.
 void save(NodeSettingsWO settings)
          Saves parameters that customize this instance.
 void saveInternals(ReferencedFile directory)
          Save the internals of this instance to the target directory.
 void saveReconnectSettings(NodeExecutionJob job, NodeSettingsWO settings)
          Saves all the information necessary to reconnect to the specified job after it is disconnected.
 NodeExecutionJob submitJob(NodeContainer nc, PortObject[] data)
          Executes the given node container with this job manager.
 String toString()
          
 

Method Detail

submitJob

NodeExecutionJob submitJob(NodeContainer nc,
                           PortObject[] data)
Executes the given node container with this job manager.

Parameters:
nc - The node to execute (may be a single node container or a meta node)
data - The input data for that node.
Returns:
A job representing the pending execution.
Throws:
IllegalStateException - If this job manager is not able to execute the given argument node container (for instance a local thread executor will not allow an execution of a meta node).

getSettingsPanelComponent

NodeExecutionJobManagerPanel getSettingsPanelComponent(NodeContainer.NodeContainerSettings.SplitType nodeSplitType)
Creates a new instance of a panel that holds components to display the job manager's settings and to allow the user to enter new values. A new instance must be created every time this method is called.
Returns null if this job manager has no settings to adjust. The framework transfers the settings of the job manager in the panel. The returned panel can be un-initialized.

Parameters:
nodeSplitType - type of splitting permitted by the underlying node
Returns:
a new instance of the dialog component for this job manager

getID

String getID()
Returns a unique ID of this job manager implementations. Preferably this is the fully qualifying name of its package.
For a user readable label, see toString()

Returns:
a unique ID of this job manager implementations

toString

String toString()

Overrides:
toString in class Object

getIcon

URL getIcon()
Returns:
the URL of the decorating image for the implementing manager

canDisconnect

boolean canDisconnect(NodeExecutionJob job)
Returns true, if a executing job continues running even after closing the workflow - and if this manager can reconnect to this job after re-opening the workflow again.

Parameters:
job - to check for dis/reconnect ability
Returns:
true, if a executing job continues running even after closing the workflow - and if this manager can reconnect to this job after re-opening the workflow again.

saveReconnectSettings

void saveReconnectSettings(NodeExecutionJob job,
                           NodeSettingsWO settings)
Saves all the information necessary to reconnect to the specified job after it is disconnected.

Parameters:
job - the job that is disconnected and must be restored later.
settings - stores the information in here
See Also:
loadFromReconnectSettings( NodeSettingsRO, PortObject[], NodeContainer)

loadFromReconnectSettings

NodeExecutionJob loadFromReconnectSettings(NodeSettingsRO settings,
                                           PortObject[] inports,
                                           NodeContainer nc)
                                           throws InvalidSettingsException,
                                                  NodeExecutionJobReconnectException
Read the information previously stored in the settings object and restore an executing job.

Parameters:
settings - reconnect information stored during saveReconnectSettings(NodeExecutionJob, NodeSettingsWO)
inports - port objects that were provided at execution start time.
nc - Node whose remote executing is to be continued.
Returns:
a new job restored and representing the running job
Throws:
InvalidSettingsException - if the information in the settings object is invalid
NodeExecutionJobReconnectException - if reconnect failed.
See Also:
saveReconnectSettings(NodeExecutionJob, NodeSettingsWO)

disconnect

void disconnect(NodeExecutionJob job)
Disconnects the running job.

Parameters:
job - The job to cancel.

save

void save(NodeSettingsWO settings)
Saves parameters that customize this instance. It does not save the general job manager ID (that happens elsewhere). Job managers that are represented by a singleton, leave this method empty.

Parameters:
settings - to save to.

load

void load(NodeSettingsRO settings)
          throws InvalidSettingsException
Restores the properties of the specific job manager. This is the reverse operation to save(NodeSettingsWO).

Parameters:
settings - To load from.
Throws:
InvalidSettingsException - If that fails.

configure

PortObjectSpec[] configure(PortObjectSpec[] inSpecs,
                           PortObjectSpec[] nodeModelOutSpecs)
                           throws InvalidSettingsException
In case the executor modifies the result of the underlying node it can create the appropriate output specs. Trivial implementations just return the nodeModelOutSpecs.

Parameters:
inSpecs - port object specs from predecessor node(s)
nodeModelOutSpecs - the output specs created by the underlying node
Returns:
the output specs actually delivered at the node's output ports
Throws:
InvalidSettingsException - if the node can't be executed.

hasView

boolean hasView()
Returns true if this job manager provides a view.

Returns:
true if this job manager provides a view.

getView

NodeView<NodeModel> getView(NodeContainer nc)
Return a new instance of a node view for the job of the provided node.

Parameters:
nc - the corresponding node container
Returns:
the view for the job if the node

getViewName

String getViewName(NodeContainer nc)
Creates a title for the corresponding view.

Parameters:
nc - the corresponding node container.
Returns:
the title for the view.

resetAllViews

void resetAllViews()
Called when the underlying node is reset. Clear all open views.


closeAllViews

void closeAllViews()
Close all open views.


canSaveInternals

boolean canSaveInternals()
Returns:
whether this job manager has meaningful internals, for instance log files of remote jobs that were run.
See Also:
saveInternals(ReferencedFile)

saveInternals

void saveInternals(ReferencedFile directory)
                   throws IOException
Save the internals of this instance to the target directory. This method is only called if canSaveInternals() returns true.

Parameters:
directory - To save to (guaranteed to be empty)
Throws:
IOException - If that fails for any reason.

loadInternals

void loadInternals(ReferencedFile directory)
                   throws IOException
Restore the internals from a directory. This is the reverse operation to saveInternals(ReferencedFile). Implementations should consider to keep a pointer to the referenced file and load the internals on demand (in order to speed up the load routines).

Parameters:
directory - To load from.
Throws:
IOException - If that fails for any reason.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.