public class ExecutionMonitor extends Object
This monitor keeps a NodeProgressMonitor
and forwards the
progress, as well as the cancel request to it.
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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 |
setMessage(Supplier<String> messageSupplier)
Set a new message based on a supplier.
|
void |
setProgress(double progress) |
void |
setProgress(double progress,
String message) |
void |
setProgress(double progress,
Supplier<String> messageSupplier)
Set progress value and message as per arguments.
|
void |
setProgress(String message) |
public ExecutionMonitor()
public ExecutionMonitor(NodeProgressMonitor progress)
null
.progress
- The progress monitor can be null.public final NodeProgressMonitor getProgressMonitor()
boolean isCanceled()
true
if the execution has been canceled.NodeProgressMonitor.checkCanceled()
public void checkCanceled() throws CanceledExecutionException
CanceledExecutionException
- which indicated the execution will be
canceled by this call.NodeProgressMonitor.checkCanceled()
public void setProgress(double progress)
progress
- The progress values to set in the monitor.NodeProgressMonitor.setProgress(double)
public void setProgress(double progress, String message)
progress
- The progress values to set in the monitor.message
- The message to be shown in the progress monitor.NodeProgressMonitor.setProgress(double)
public void setProgress(double progress, Supplier<String> messageSupplier)
progress
- Progress in [0, 1] - invalid values are ignored.messageSupplier
- The message supplier, not null
(though the supplied value may be
null
).IllegalArgumentException
- If supplier argument is null
.NodeProgressMonitor.setProgress(double, Supplier)
public void setMessage(String message)
message
- The message to be shown in the progress monitor.NodeProgressMonitor.setMessage(String)
public void setMessage(Supplier<String> messageSupplier)
setProgress(double, Supplier)
.messageSupplier
- The non-null
message supplier.public void setProgress(String message)
message
- The message to be shown in the progress monitor.NodeProgressMonitor.setProgress(String)
public ExecutionMonitor createSubProgress(double maxProg)
maxProg
- The fraction of the progress this sub progress
contributes to the whole progressIllegalArgumentException
- If the argument is not in (0, 1].public ExecutionMonitor createSilentSubProgress(double maxProg)
createSubProgress(double)
message in that it
does not report any message but rather ignores any new string message.maxProg
- The fraction of the progress this sub progress
contributes to the whole progressIllegalArgumentException
- If the argument is not in (0, 1].NodeProgressMonitor createSubProgressMonitor(double maxProg)
maxProg
- The fraction of the progress this sub progress
contributes to the whole progressIllegalArgumentException
- If the argument is not in [0, 1].NodeProgressMonitor createSilentSubProgressMonitor(double maxProg)
maxProg
- The fraction of the progress this sub progress
contributes to the whole progress
KNIME GmbH, Konstanz, Germany
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.