Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-dd-dev] Need Sequence.getProgressMonitor() API

Title: Need Sequence.getProgressMonitor() API
Hi Ling,
I briefly wondered why this method was added when I first looked at the patch.  This explains it :-)

I'm somewhat uneasy about simply making this internal variable available through the public method without thinking it through.  A more comprehensive solution I think would be:

1) Create a new RequestMonitor type, which implements IProgressMonitor: (e.g. RequestMonitorWithProgress)
2) Extend the Sequence.Step class with something like:

    abstract public static class StepWithProgress {
        final public void execute(RequestMonitor rm) {
            throw new NotSupportedException(...);
        }

        final public void rollBack(RequestMonitor rm) {
            throw new NotSupportedException(...);
        }

        final public void executeWithProgress(RequestMonitorWithProgress rm) {
            rm.done();
        }

        final public void rollBackWithProgress(RequestMonitorWithProgress rm) {
            rm.done();
        }
    }
3) Add instanceof checks in Sequence implementation to see if the step accepts progress, and create a progress request monitor for those cases.

4) For those custom steps that require a progress monitor, extend StepWithProgress.

Does this approach make sense or will it not work for your use case?

Cheers,
Pawel

Ling.5.Wang@xxxxxxxxx wrote:

Hi, Pawel and Marc,

In my patch to bug 240092, I added this method to Sequence.java:

        public IProgressMonitor getProgressMonitor() { return fProgressMonitor; }

I see you ignored it in your revised patch which I understand as it's not used in the DSF project code. But it's needed in our debugger and other conceivable cases. In our version of FinalLaunchSequence, I added two more steps, one is to downloading files to device and the other to start gdbserver on device. Both the steps are time consuming and need a progress monitor which should be a submonitor of the progress monitor of the Sequence object. So access to the Sequence progress monitor is needed.

What do you think ?  As you are freezing API now, I'm looking forward to squeezing my request in if it's appropriate.
Thanks.

- Ling


_______________________________________________ dsdp-dd-dev mailing list dsdp-dd-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dsdp-dd-dev


Back to the top