Bug 148427 - Need ability to extend ElementSelectionService for transaction support
Summary: Need ability to extend ElementSelectionService for transaction support
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0   Edit
Hardware: PC Linux
: P3 major
Target Milestone: 1.0.1   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-06-23 14:11 EDT by Christian Damus CLA
Modified: 2010-07-19 21:55 EDT (History)
0 users

See Also:


Attachments
Patch for selection service extensibility (7.42 KB, patch)
2006-06-23 14:17 EDT, Christian Damus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2006-06-23 14:11:41 EDT
I have an application using GMF that uses the ElementSelectionService to find elements in EMF models.  My selection provider jobs use the EMFT Transaction API to lock the editing domain for read access.  This works well as long as the dialog in which I embed the ElementSelectionComposite is not launched while the UI thread has an active transaction.

When the UI thread does have a transaction (read-only or, in some cases, read-write because an AbstractEMFOperation is executing), then the selection composite never returns results because the jobs that are feeding it are blocked waiting for the editing domain lock that the UI is holding.  In read-write cases, yielding does not help, because the UI thread is busily waiting for the selection jobs to finish.  The current implementation of the service cannot be extended to provide the necessary transaction support.

I will attach a patch that tweaks the selection service API ever so slightly, by factoring a couple of key behaviours into protected methods that an extension could override to show what is required.
Comment 1 Christian Damus CLA 2006-06-23 14:17:00 EDT
Created attachment 45195 [details]
Patch for selection service extensibility

As promised, find attached a patch that makes the following small changes:

  - in ElementSelectionService and AbstractElementSelectionProvider,
    factors out the creation of ElementSelectionServiceJobs to allow a
    subclass to create a custom job implementation
  - in ElementSelectionService, factors out the scheduling of jobs so that
    a subclass can customize the scheduling of provider jobs
  - in ElementSelectionComposite, adds a constructor that allows clients
    to configure the composite with a custom selection service implementation
Comment 2 Anthony Hunter CLA 2006-07-12 14:40:48 EDT
Committed the patch to R1_0_maintenance.

I ran the JUnit tests for the element selection service and they pass.
I also ran the clients application and it works as required.
Comment 3 Eclipse Webmaster CLA 2010-07-19 21:55:59 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Common was the original product and component for this bug