Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346089

Summary: Consider to bypass AdapterManager in Widget#getAdapter for Widget LCA
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ruediger.herrmann
Version: 1.4   
Target Milestone: 1.5 M3   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch
none
Patch #2 none

Description Ralf Sternberg CLA 2011-05-17 09:44:21 EDT
Performance measurements have shown that calling the AdapterManager consumes a considerable amount of time in Widget#getAdapter(). Since the AdapterManager is currently used only to manage lifecycle adapters, we suggest the following improvement:
In Widget#getAdapter(), we could directly consult the LifeCycleAdapterFactory in order to find the corresponding LCA.
Furthermore, this result could be buffered in the widget.
Comment 1 Rüdiger Herrmann CLA 2011-05-18 07:14:52 EDT
Created attachment 195949 [details]
Patch

This patch converts the LifeCycleAdapterFactory from an IAdapterFactory that was registered at the AdapterManager to a member of the RWTFactory.
The implementation of Display#getAdapter() and Widget#getAdapter() was changed to consult the LifeCycleAdapterFactory if an ILifeCycleAdapter is requested. 
Despite that RWT itself registers no more adapter factories at the AdapterManager, AdapterManager#getAdapter() is still called as a last resort in getAdapter().
Comment 2 Rüdiger Herrmann CLA 2011-05-19 04:21:56 EDT
Created attachment 196083 [details]
Patch #2

Same as patch #1, plus it introduces SharedInstanceBuffer from bug 345933 in LifeCycleAdapterFactory
Comment 3 Rüdiger Herrmann CLA 2011-10-17 06:53:42 EDT
Converted the LifeCycleAdapterFactory from an AdapterFactory that was registered at the AdapterManager to a member of the RWTFactory.
The implementation of Display#getAdapter() and Widget#getAdapter() was changed to consult the LifeCycleAdapterFactory if an ILifeCycleAdapter is requested. 
Despite that RWT itself registers no more adapter factories at the AdapterManager, AdapterManager#getAdapter() is still called as a last resort in getAdapter().