IProgressReporter
Any process wishing to participate in providing global progress indication can instantiate this class and simply use the available methods so set values or issue a command
When ever any state changes in this reporter a notification will be sent to the global reporting manager {@link ProgressReportingManager} followed by a notification to allregistered listeners of this reporter
The listeners will be passed an immutable progress report {@link ProgressReporter.ProgressReport} whichrepresents a snapshot of all the public properties contained in this reporter; inspecting the ProgressReport is the only way a listener can query the properties of this reporter. This pattern allows the ProgressReporter to continue and process requests by not having to thread lock all public methods. Additionally, the listeners are guaranteed a consistent snapshot of the reporter.This reporter also has the capability to receive loop back commands from a listener for actions such like {@link #cancel()} and {@link #retry()}. These commands are enabled by calling {@link ProgressReporter#setCancelAllowed(boolean)} or {@link ProgressReporter#setRetryAllowed(boolean)}. The listener only initiates these actions by sending a notification back to the owner of the reporter; it is up the to owner to perform the actual act of canceling or retrying.
A typical life cycle of the ProgresReporter as seen from an owner is as follows (an owner is defined as the process that created the reporter):
In addition to internal clean-ups, calling dispose(Object) will effectively remove the reporter from the history stack of the reporting manager and no more messages from this reporter will be processed.
Once a reporter is created and any property in the reporter is set the global reporting manager is notified; at which point any listener listening to the manager is forwarded this reporter. The manager listener may decide to display this reporter in a UI element, may register specific listeners to this reporter, may query its properties and take action, or can simply monitor it for such functions as logging.
This implementation is non-intrusive to the owner process and so provides existing processes the ability to participate in global progress indication without significant modification to the underlying processes. @author knguyen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|