Class ClientProgressManager
- All Implemented Interfaces:
ProgressManager
It can be accessed through the static getInstance function as well as through the ClientContext.
The way the progress system works is that long running tasks (that is, any task that takes long enough that progress
might be desired) are wrapped up as a AsyncClientTask
, and are run through this manager.
When a task is registered, a TaskHandle
is returned, which can be used to monitor status, wait for a result,
and get the return value of the asynchronous operation. It can also be used to cancel the task.
The class registering the operation does not need to worry about displaying status, as that is handled by the system. However, it is possible to "pause" the UI in situations where having a pop up display open is undesirable. Calling setUIPaused affects all outstanding progress operations, and should therefore be called very carefully.
Tasks executing against the gateway
It's important to note that the gateway has a separate notion of asynchronous tasks. For the best results, the
progress system should be used on both sides, but they are fundamentally separate. As a result, operations on the
gateway get their own UID. Asynchronous gateway operations, triggered from the designer (even if not through the
progress system!), can publish updates to the designer progress manager. Thus it's possible that a progress dialog
might be shown even when you are not using the client progress manager to run a task.
In a normal, fully async setup, you would end up with the following progress updates:
ClientOp
GatewayOp
GatewayOp
GatewayOp
ClientOp
The client operation and gateway operations are seen as two seperate tasks. Which is displayed is based on whether the first task is dominant. If the client task is dominant, it will stay displayed, and its progress will be updated. If not, the display will switch to the gateway task when it comes in, and will stay on that until it's finished.
More information about the way the gateway progress system works can be found on the GatewayProgressManager page.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
protected class
static interface
protected class
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.gui.progress.ProgressManager
PUSH_PROTOCOL_UPDATE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
cancelTask
(String uid) protected ExecutionManager
static ClientProgressManager
protected org.apache.log4j.Logger
registerGatewayTask
(String taskId) protected void
void
<T> void
run
(CompletableFuture<T> cf, Consumer<T> handler, Object owner) runTask
(AsyncClientTask task) Executes the provided task asynchronously.runTask
(AsyncClientTask task, boolean dominant) Executes a task.void
setClientContext
(ClientContext context) void
setUIPaused
(boolean value) void
shutdown()
void
startup()
protected void
protected void
updateTask
(TaskProgressState state) protected void
updateUI()
-
Method Details
-
getInstance
-
startup
public void startup() -
getExecutionManager
-
getLogger
protected org.apache.log4j.Logger getLogger() -
addListener
-
removeListener
-
setUIPaused
public void setUIPaused(boolean value) -
shutdown
public void shutdown() -
runTask
Executes the provided task asynchronously. Displays progress as appropriate, and will display an error box if the task execution throws an exception.Returns a TaskHandle that can be used to wait for the task to finish, cancel the task, etc.
-
runTask
Executes a task. See runTask(task) for more info.- Parameters:
dominant
- true indicates that this task should be favored for display, and will spawn subtasks that it will account for in its progress.
-
run
-
cancelAllTasks
public void cancelAllTasks() -
cancelTask
-
updateTask
-
registerGatewayTask
-
registerTask
-
unregisterTask
-
updateUI
protected void updateUI() -
setClientContext
-
getStates
-