Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Remote API changes

I'd like to make the following changes to the remote API's in 5.0 in order to address some issues with service initialization. Please let me know if you have any comments or feedback.

PROBLEM: The RSE service is very slow to start and it can be confusing to the user if the UI freezes while waiting for the initialization to complete. Also, if the initialization of RSE is attempted too early during Eclipse startup, the whole UI can lock up.

Currently, calling PTPRemoteCorePlugin#getAllRemoteServices() and getRemoteServices(String) will attempt to load the services plugin and initialize the services. These methods don't take a progress monitor, so there is no way to notify the user of progress. These methods also attempt to initialize the service by calling the initialize method twice, but initialization can still fail if it is called too early.

SOLUTION: 

The methods getAllRemoteServices() and getRemoteServices(String) will be modified so that they always return the services, but the services are uninitialized. Callers must call the #initialize() method on the services before they are used, however the following methods will also be provided to assist this:

getAllRemoteServices(IProgressMonitor) - Will return all available remote services and ensure that the services are initialized. The progress monitor is used to report progress to the user, but cancelling is not allowed.

getRemoteServices(String, IProgressMonitor) - Returns the requested service in an initialized state, or null if the service doesn't exist. The progress monitor is used to report progress to the user, but cancelling is not allowed.

getRemoteServices(URI, IProgressMonitor) - Same as above, but service is obtained from the URI.

In addition, the following methods will be provided in the PTPRemoteUIPlugin:

getRemoteServices(IRunnableContext) - Same as calling getAllRemoteServices(IProgressMonitor), however the method will use the IRunnableContext for reporting progress to the user. If the IRunnableContext is null, the method will use the workbench progress service busyCursorWhile method for progress reporting.

getRemoteServices(String, IRunnableContext) - Same as calling getRemoteServices(String, IProgressMonitor), however the method will use the IRunnableContext for reporting progress to the user. If the IRunnableContext is null, the method will use the workbench progress service busyCursorWhile method for progress reporting.

In most circumstances, the PTPRemoteUIPlugin methods should be used, as they will either use the IRunnableContext (e.g. a wizard page) for progress reporting, or put up a dialog so the user can see what is happening. This is the case for all of PTP except RDT.

RDT can be invoked very early in Eclipse startup (when projects are being opened), so the UI methods should not be used. Instead, those parts of RDT that might be affected should call the getAllRemoteServices() and getRemoteServices(String) methods (with no IProgressMonitor) arguments. RDT can then call the services #initialize method and decide what to do if the initialization fails.



Back to the top