public final class OperationRunner
extends com.sodius.mdw.internal.core.operations.InternalOperationRunner
Operation
, which might be decomposed into sub operations.
This class is not intended to be subclassed by clients.
Operation
,
StatusWriter.Factory.createHTML()
Constructor and Description |
---|
OperationRunner() |
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(StatusListener listener)
Register a listener to be notified when the status of an operation is modified.
|
void |
removeStatusListener(StatusListener listener)
Unregister a status listener.
|
<R> R |
run(Function<R> function,
org.eclipse.core.runtime.IProgressMonitor monitor)
Requests the execution of the specified function and returns the produced result, if any.
|
void |
run(Operation operation,
org.eclipse.core.runtime.IProgressMonitor monitor)
Requests the execution of the specified operation.
|
public void run(Operation operation, org.eclipse.core.runtime.IProgressMonitor monitor)
If an error occurs during the operation execution, the error is recorded in the operation status. Meaning this run()
call can
never fail.
When the operation execution is completed, a log can be generated by a StatusWriter
to have a complete execution trace.
operation
- the operation to execute.monitor
- the progress monitor used to report progress and to check for cancellation.StatusWriter.Factory.createHTML()
public <R> R run(Function<R> function, org.eclipse.core.runtime.IProgressMonitor monitor)
If an error occurs during the function execution, the error is recorded in the function status. Meaning this run()
call can never
fail.
When the function execution is completed, a log can be generated by a StatusWriter
to have a complete execution trace.
R
- the type of result produced by the function.function
- the function to execute.monitor
- the progress monitor used to report progress and to check for cancellation.null
if either no result was set by the function or the function was not
executed (e.g. a cancel was requested).StatusWriter.Factory.createHTML()
public void addStatusListener(StatusListener listener)
addStatusListener
in class com.sodius.mdw.internal.core.operations.InternalOperationRunner
listener
- the listener to register.public void removeStatusListener(StatusListener listener)
removeStatusListener
in class com.sodius.mdw.internal.core.operations.InternalOperationRunner
listener
- the listener to unregister.