Class ClientProgressManager
- java.lang.Object
- 
- com.inductiveautomation.ignition.client.util.gui.progress.ClientProgressManager
 
- 
- All Implemented Interfaces:
- ProgressManager
 
 public class ClientProgressManager extends java.lang.Object implements ProgressManager The ClientProgressManager handles asynchronous tasks in the client, and across the client/gateway boundary.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 TaskHandleis 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
 ClientOpThe 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 SummaryNested Classes Modifier and Type Class Description protected classClientProgressManager.ClientRunningTaskprotected classClientProgressManager.GatewayRunningTaskstatic interfaceClientProgressManager.ModelListenerprotected classClientProgressManager.RunningTask
 - 
Field Summary- 
Fields inherited from interface com.inductiveautomation.ignition.common.gui.progress.ProgressManagerPUSH_PROTOCOL_UPDATE
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ClientProgressManager.ModelListener listener)voidcancelAllTasks()voidcancelTask(java.lang.String uid)protected ExecutionManagergetExecutionManager()static ClientProgressManagergetInstance()protected org.apache.log4j.LoggergetLogger()java.util.List<TaskProgressState>getStates()TaskHandleregisterGatewayTask(java.lang.String taskId)protected voidregisterTask(ClientProgressManager.RunningTask task)voidremoveListener(ClientProgressManager.ModelListener listener)<T> voidrun(java.util.concurrent.CompletableFuture<T> cf, java.util.function.Consumer<T> handler, java.lang.Object owner)TaskHandlerunTask(AsyncClientTask task)Executes the provided task asynchronously.TaskHandlerunTask(AsyncClientTask task, boolean dominant)Executes a task.voidsetClientContext(ClientContext context)voidsetUIPaused(boolean value)voidshutdown()voidstartup()protected voidunregisterTask(ClientProgressManager.RunningTask task)protected voidupdateTask(TaskProgressState state)protected voidupdateUI()
 
- 
- 
- 
Method Detail- 
getInstancepublic static ClientProgressManager getInstance() 
 - 
startuppublic void startup() 
 - 
getExecutionManagerprotected ExecutionManager getExecutionManager() 
 - 
getLoggerprotected org.apache.log4j.Logger getLogger() 
 - 
addListenerpublic void addListener(ClientProgressManager.ModelListener listener) 
 - 
removeListenerpublic void removeListener(ClientProgressManager.ModelListener listener) 
 - 
setUIPausedpublic void setUIPaused(boolean value) 
 - 
shutdownpublic void shutdown() 
 - 
runTaskpublic TaskHandle runTask(AsyncClientTask task) 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. 
 - 
runTaskpublic TaskHandle runTask(AsyncClientTask task, boolean dominant) 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.
 
 - 
runpublic <T> void run(java.util.concurrent.CompletableFuture<T> cf, java.util.function.Consumer<T> handler, java.lang.Object owner)
 - 
cancelAllTaskspublic void cancelAllTasks() 
 - 
cancelTaskpublic void cancelTask(java.lang.String uid) 
 - 
updateTaskprotected void updateTask(TaskProgressState state) 
 - 
registerGatewayTaskpublic TaskHandle registerGatewayTask(java.lang.String taskId) 
 - 
registerTaskprotected void registerTask(ClientProgressManager.RunningTask task) 
 - 
unregisterTaskprotected void unregisterTask(ClientProgressManager.RunningTask task) 
 - 
updateUIprotected void updateUI() 
 - 
setClientContextpublic void setClientContext(ClientContext context) 
 - 
getStatespublic java.util.List<TaskProgressState> getStates() 
 
- 
 
-