Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265565 - [api] provide access to progress monitor to allow monitoring submit job in progress
Summary: [api] provide access to progress monitor to allow monitoring submit job in pr...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 enhancement (vote)
Target Milestone: 3.2   Edit
Assignee: Thomas Ehrnhoefer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-19 18:06 EST by David Shepherd CLA
Modified: 2009-07-21 18:46 EDT (History)
3 users (show)

See Also:


Attachments
patch (6.72 KB, patch)
2009-05-07 21:06 EDT, Steffen Pingel CLA
no flags Details | Diff
mylyn/context/zip (8.17 KB, application/octet-stream)
2009-05-07 21:06 EDT, Steffen Pingel CLA
no flags Details
patch (8.10 KB, patch)
2009-05-20 15:24 EDT, Thomas Ehrnhoefer CLA
no flags Details | Diff
mylyn/context/zip (19.68 KB, application/octet-stream)
2009-05-20 15:25 EDT, Thomas Ehrnhoefer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Shepherd CLA 2009-02-19 18:06:50 EST
When scheduling a SynchronizeQueryJob from a UI component, such as a report, view, etc. there is no existing API available to access the progress of this synchronization which is relevant to the report, view, etc.  It would be helpful if SynchronizeQueryJob (and other sync jobs) had API to access the progress monitor of the job.  This way the view or page owner could report the progress to the user.
Comment 1 Steffen Pingel CLA 2009-05-07 20:54:03 EDT
Here is a proposal for a solution:

* Create a DelegatingProgressMonitor with the following interface:

/** Delegates to all attached monitors. */
IDelegatingProgressMonitor extends IProgressMonitor {

 /** Reporting progress to this monitor. */
 void attach(IProgressMonitor);

}

* Create a delegating progress monitor in the constructor of TaskSubmitJob and set the monitor that is passed to run() as the master.
* All progress reporting in the job needs to be passed to the delegating monitor
Comment 2 Steffen Pingel CLA 2009-05-07 21:06:49 EDT
Created attachment 134908 [details]
patch

The implementation does not currently handle the case when a progress monitor is attached after the job has already been started, i.e. some recording of past events would be necessary in order to provide accurate progress reporting and messaging.
Comment 3 Steffen Pingel CLA 2009-05-07 21:06:52 EDT
Created attachment 134909 [details]
mylyn/context/zip
Comment 4 Thomas Ehrnhoefer CLA 2009-05-08 13:00:37 EDT
This patch contains your patch + some recording of past events and setting them on a newly attached monitor.
Not sure if that's all this implementation needs (if so, thanks for doing all the work). Also, not too certain about the internalWorked, but I think it should be set and set before the worked is set...
Comment 5 Thomas Ehrnhoefer CLA 2009-05-12 14:47:13 EDT
Tried the patch in my current scenario and it seems to work fine for me.
Comment 6 Thomas Ehrnhoefer CLA 2009-05-20 15:24:57 EDT
Created attachment 136563 [details]
patch

Sorry for the delay, it seems I forgot to actually attach the patch for keeping the state consistent for all monitors...here it is.
Comment 7 Thomas Ehrnhoefer CLA 2009-05-20 15:25:00 EDT
Created attachment 136564 [details]
mylyn/context/zip
Comment 8 Steffen Pingel CLA 2009-05-20 23:45:15 EDT
Thanks Thomas. I have applied the patch with minor modifications: attach now invokes done() last and IDelegatingProgressMonitor supports detaching of listening progress monitors.