| Summary: | Remove unnecessary UI dependencies from org.eclipse.jst.ws.consumption | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Webservices | Reporter: | Troy Bishop <tjbishop> | ||||
| Component: | jst.ws | Assignee: | Mark Hutchinson <mahutch> | ||||
| Status: | CLOSED FIXED | QA Contact: | Kathy Chan <kathy> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | kathy, keith.chong.ca | ||||
| Version: | 3.0 | Keywords: | plan | ||||
| Target Milestone: | 3.1 M6 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | other | ||||||
| Attachments: |
|
||||||
|
Description
Troy Bishop
We were using IRunnableWithProgress to call the facet API on a different thread to avoid possible deadlock issues. We should look into another mechanism for achieving this. One possible alternative would be to use jobs or other mechanisms used by J2EE or server team Over to you Mark. *** Bug 231928 has been marked as a duplicate of this bug. *** Created attachment 127371 [details] proposed patch The UI dependencies were originally added as part of a fix for bug 126757 as a way of running certain Facets API code in a different thread to avoid deadlocks. The fix was to run the facets code in an IRunnableWithProgress that was run by an IProgressService. This would create another thread and display a modal progress dialog while the thread was run. Users could not perform other operations until the runnable completed and the modal dialog closed. (i.e. the facet operations are run synchronously) IProgressService and IRunnableWithProgress come from UI plugins. If no UI was present then the facet operations were run in the current thread. Using another mechanism to create a new thread, such as a Job, is not appropriate since it is desirable to display progress to the user while the facet operation runs. The facet operation can not be run asynchronously so we would have to join() the job immediately after scheduling it which could cause the UI thread to block. To be able to use the Progress Service if a UI is present without adding UI dependencies to the org.eclipse.jst.ws.consumption plugin the UI specific code will be moved into the org.eclipse.consumption.ui plugin. This is done by defining a new extension point in the org.eclipse.jst.ws.consumption plugin that allows an IFacetOperationDelegate to be plugged in. This extension point is called org.eclipse.jst.ws.consumption.internalFacetOperationDelegate. If the FacetUtils class detects that a facetOperationDelegate extension has been plugged in then it will delegate certain operations to the facetOperationDelegate. If no extension is present, then the facet operation will be run in the current thread. This extension point is internal and should not be implemented by adopters. The org.eclipse.jst.ws.consumption.ui plugin will provide a internalFacetOperationDelegate extension that implements IFacetOperationDelegate. This will run the Facet code in a new thread in an IProgressService if the UI is present, otherwise it will run the operation in the current thread. This is identical to what FacetUtils did before the UI dependencies were removed. I've released the changes for 3.1 M6. Verified and closed. |