Progress Pane

Purpose

This extension provides developers with a flexible and extensible framework for monitoring longer running tasks that execute on the server-side using a progress bar, for example.

progresspane-screenshot

One can assemble a list of tasks to be executed by a task controlling instance and visualize the progress on the client-side using a progress bar, a percentage value field and/or a status label. The task controller is independent from the visualization and thus, any component can be used for visualizing the progress. This contribution contains an ULCProgressPane component that can be configured and/or extended for custom usage.

The ULCProgressPane contribution both supports the execution of synchronous and asynchronous server-side running tasks and provides controlling facilities for starting and cancelling a running task.

If the client running the ULCProgressPane extension is using JRE 1.4 or higher, the ULCIndeterminateProgressBar can be used to display long running tasks whose percentage completed value can not be tracked (e.g. external report generation). The ULCIndeterminateProgressBar is configured by overwriting the ULCProgressPane.createProgressBar() method.

How to use

Several sample usages for the ULCProgressPane extension are included in the resource file in the com.canoo.ulc.progresspane.server.sample package.:
  • Execution of multiple synchronous running tasks
  • Execution of multiple asynchronous running tasks
  • Execution of a long-running, non-trackable tasks using an indeterminate progress bar
  • Server-side downloading a large file from a Web server using a long-running, asynchronous tasks
An ULCProgressPane is simply configured with a list of tasks and a value that indicates the update interval for the progress pane. In addition, the components displayed on the progress pane (such as cancel button, percentage completed value and status label) can be configured using the appropriate show...() methods.

...

long updateInterval = 1000; MyTaskList taskList = new MyTaskList();

ULCProgressPane progressPane = new ULCProgressPane(taskList, updateInterval); progressPane.setShowCancelButton(true); progressPane.setShowPercent(true); progressPane.setShowStatus(true);

...

Multiple ITaskControllerListener instances can be registered that are notified on events such as starting or stopping the task execution, completion and exceptions, and status / percentage completed changes.

...

progressPane.addTaskControllerListener(new ITaskControllerListener() { … });

...

The task execution is started using the ULCProgressPane.start() method. This starts the underlying TaskController that works on the task list configured for the progress pane.

...

progressPane.start();

...

How it is implemented

The ULCProgressPane observes the task execution controlled by the TaskController that uses a non-repeated ULCPollingTimer to periodically trigger the client to perform a server round-trip. During the request processing, the TaskController monitors the execution of the currently running task, starts a new task if required and notifies any registered listeners on status changes.

Resources