Class ProgressMonitorAwareExecutor
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.ProgressMonitorAwareExecutor
-
public final class ProgressMonitorAwareExecutor extends Object
Provides utility method to synchronously execute task with an ability to check provided progress monitor cancellation status. May be usefull for long-running operations that are not controlled by client, such as external processes execution, to provide an ability to cancel this operation from UI.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
syncExec(FailableRunnable task, org.eclipse.core.runtime.IProgressMonitor monitor)
Synchronously exectute the provided task with awaring of provided progress monitor state.
-
-
-
Method Detail
-
syncExec
public static void syncExec(FailableRunnable task, org.eclipse.core.runtime.IProgressMonitor monitor) throws ExecutionException
Synchronously exectute the provided task with awaring of provided progress monitor state.Provided
monitor
will be used to check cancellation status. If monitor will be cancelled then task execution will be also cancelled and execution will be returned to the caller thread. If monitor is already cancelled, then provided task will not be executed.May be usefull for long-running operations that are not controlled by client, such as external processes execution, to provide an ability to cancel this operation from UI.
- Parameters:
task
- the runnable to run with ability to throw an exception, cannot benull
monitor
- the progress monitor to check cancellation status, cannot benull
- Throws:
ExecutionException
- if providedtask
execution error occurred; thrown execution will be applied as cause to the execution excetion- See Also:
FailableRunnable
-
-