org.knime.core.node
Class ExecutionMonitor

java.lang.Object
  extended by org.knime.core.node.ExecutionMonitor
Direct Known Subclasses:
ExecutionContext, FileReaderExecutionMonitor

public class ExecutionMonitor
extends Object

This node's execution monitor handles the progress and later also memory management for each node model's execution.

This monitor keeps a NodeProgressMonitor and forwards the progress, as well as the cancel request to it.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
ExecutionMonitor()
          Creates a new execution monitor with an empty default progress monitor.
ExecutionMonitor(NodeProgressMonitor progress)
          Creates a new execution monitor with the given progress monitor which can be null.
 
Method Summary
 void checkCanceled()
           
 ExecutionMonitor createSilentSubProgress(double maxProg)
          Creates an execution monitor with a partial progress range, which ignores any message set.
(package private)  NodeProgressMonitor createSilentSubProgressMonitor(double maxProg)
          Factory method to create a new silent sub progress monitor.
 ExecutionMonitor createSubProgress(double maxProg)
          Creates an execution monitor with a partial progress range.
(package private)  NodeProgressMonitor createSubProgressMonitor(double maxProg)
          Factory method to create a new sub progress monitor.
 NodeProgressMonitor getProgressMonitor()
           
(package private)  boolean isCanceled()
           
 void setMessage(String message)
           
 void setProgress(double progress)
           
 void setProgress(double progress, String message)
           
 void setProgress(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionMonitor

public ExecutionMonitor()
Creates a new execution monitor with an empty default progress monitor.


ExecutionMonitor

public ExecutionMonitor(NodeProgressMonitor progress)
Creates a new execution monitor with the given progress monitor which can be null.

Parameters:
progress - The progress monitor can be null.
Method Detail

getProgressMonitor

public final NodeProgressMonitor getProgressMonitor()
Returns:
The progress monitor used here.

isCanceled

boolean isCanceled()
Returns:
true if the execution has been canceled.
See Also:
NodeProgressMonitor.checkCanceled()

checkCanceled

public void checkCanceled()
                   throws CanceledExecutionException
Throws:
CanceledExecutionException - which indicated the execution will be canceled by this call.
See Also:
NodeProgressMonitor.checkCanceled()

setProgress

public void setProgress(double progress)
Parameters:
progress - The progress values to set in the monitor.
See Also:
NodeProgressMonitor.setProgress(double)

setProgress

public void setProgress(double progress,
                        String message)
Parameters:
progress - The progress values to set in the monitor.
message - The message to be shown in the progress monitor.
See Also:
NodeProgressMonitor.setProgress(double)

setMessage

public void setMessage(String message)
Parameters:
message - The message to be shown in the progress monitor.
See Also:
NodeProgressMonitor.setMessage(String)

setProgress

public void setProgress(String message)
Parameters:
message - The message to be shown in the progress monitor.
See Also:
NodeProgressMonitor.setProgress(String)

createSubProgress

public ExecutionMonitor createSubProgress(double maxProg)
Creates an execution monitor with a partial progress range. Classes that use a progress monitor and report in the range of [0,1] should get such a sub-progress monitor when their job is only partially contributing to the entire progress. The progress of such sub-jobs is then automatically scaled to the "right" range.

Parameters:
maxProg - The fraction of the progress this sub progress contributes to the whole progress
Returns:
A new execution monitor ready to use in sub jobs.
Throws:
IllegalArgumentException - If the argument is not in (0, 1].

createSilentSubProgress

public ExecutionMonitor createSilentSubProgress(double maxProg)
Creates an execution monitor with a partial progress range, which ignores any message set. Classes that use a progress monitor and report in the range of [0,1] should get such a sub-progress monitor when their job is only partially contributing to the entire progress. The progress of such sub-jobs is then automatically scaled to the "right" range. This method differs from the createSubProgress(double) message in that it does not report any message but rather ignores any new string message.

Parameters:
maxProg - The fraction of the progress this sub progress contributes to the whole progress
Returns:
A new execution monitor ready to use in sub jobs.
Throws:
IllegalArgumentException - If the argument is not in (0, 1].

createSubProgressMonitor

NodeProgressMonitor createSubProgressMonitor(double maxProg)
Factory method to create a new sub progress monitor. Only for internal use (i.e. here and in ExecutionContext).

Parameters:
maxProg - The fraction of the progress this sub progress contributes to the whole progress
Returns:
A new sub node progress monitor.
Throws:
IllegalArgumentException - If the argument is not in [0, 1].

createSilentSubProgressMonitor

NodeProgressMonitor createSilentSubProgressMonitor(double maxProg)
Factory method to create a new silent sub progress monitor. Only for internal use (i.e. here an in ExecutionContext).

Parameters:
maxProg - The fraction of the progress this sub progress contributes to the whole progress
Returns:
A new silent sub node progress monitor.


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.