org.knime.base.node.io.filereader
Class FileReaderExecutionMonitor

java.lang.Object
  extended by org.knime.core.node.ExecutionMonitor
      extended by org.knime.base.node.io.filereader.FileReaderExecutionMonitor

public class FileReaderExecutionMonitor
extends ExecutionMonitor

Execution monitor used by the FileAnalyzer. Supports immediate interruption of execution (in contrast to user cancellation, which finishes fast - but not immediate).

IMPORTANT NOTE: In contrast to the default implementation cancel and interrupt requests must be set with the execution monitor, not the progress monitor!

Author:
ohl, University of Konstanz

Constructor Summary
FileReaderExecutionMonitor()
          Creates a new object with a default progress monitor.
FileReaderExecutionMonitor(NodeProgressMonitor progressMonitor)
          Creates a new object with the specified NodeProgressMonitor.
 
Method Summary
 void checkCanceled()
          
 void checkInterrupted()
          Throws an exception if the execution was interrupted.
 ExecutionMonitor createSubProgress(double maxProg)
          Creates an execution monitor with a partial progress range.
 void setExecuteCanceled()
          Causes execution to finish fast (with a - more or less - usable result).
 void setExecuteInterrupted()
          Called when the execution should be interrupted immediately without result.
 boolean wasCanceled()
          Checks the cancel flag.
 boolean wasInterrupted()
          Checks if the execution was interrupted.
 
Methods inherited from class org.knime.core.node.ExecutionMonitor
createSilentSubProgress, getProgressMonitor, setMessage, setProgress, setProgress, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReaderExecutionMonitor

FileReaderExecutionMonitor()
Creates a new object with a default progress monitor.


FileReaderExecutionMonitor

FileReaderExecutionMonitor(NodeProgressMonitor progressMonitor)
Creates a new object with the specified NodeProgressMonitor.

Parameters:
progressMonitor - the progress monitor to use.
Method Detail

checkCanceled

public void checkCanceled()
                   throws CanceledExecutionException

Overrides:
checkCanceled in class ExecutionMonitor
Throws:
CanceledExecutionException - which indicated the execution will be canceled by this call.
See Also:
NodeProgressMonitor.checkCanceled()

setExecuteCanceled

public void setExecuteCanceled()
Causes execution to finish fast (with a - more or less - usable result).


wasCanceled

public boolean wasCanceled()
Checks the cancel flag. If this is a sub exec, it also checks with the parent.

NOTE: if the cancellation was triggered in the progress monitor, this method will return false. Always cancel execution through this execution monitor.

Returns:
true, if execution was canceled.

checkInterrupted

public void checkInterrupted()
                      throws InterruptedExecutionException
Throws an exception if the execution was interrupted. Doesn't throw an exception, if it was canceled.

Throws:
InterruptedExecutionException - if execution was interrupted

setExecuteInterrupted

public void setExecuteInterrupted()
Called when the execution should be interrupted immediately without result.


wasInterrupted

public boolean wasInterrupted()
Checks if the execution was interrupted. In sub execs it also checks with the parent.

Returns:
true, if execution was interrupted

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.

Overrides:
createSubProgress in class ExecutionMonitor
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.


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.