| Summary: | [RFC 159] Support in core for WeavingHook | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Thomas Watson <tjwatson> | ||||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | jwross, mlippert | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | 3.7 M3 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 289124 | ||||||||
| Attachments: |
|
||||||||
|
Description
Thomas Watson
Created attachment 179991 [details]
work in progess
Untested work in progress.
There are two issues with the current work in progess. 1) The RFC mandates that the WeavingHook#weave method is called while holding no locks. Currently we hold the class loader lock (or on Java 7 we hold a class name lock). To do this outside of a lock we would need to call findLoadedClass multiple times in order to ensure that there is an atomic findLoadedClass/defineClass call. 2) The current support for adding new dynamic packages is very simplistic. Additional checks are needed to see if a dynamic wire can be established and we need to support matching attributes on the new imports that are added to WovenClass. (In reply to comment #0) +1 Great to see progress on a general weaving hook for OSGi in R4.3. Should definitely consider a reimplementation of Equinox Weaving based on this. The interesting question will be whether we can throw away the basic Equinox Weaving implementation and reimplement just the aspect weaving on top of the new hook. Also interesting: Does the new weaving hook consider caching of woven class files? Or is this done automatically somehow? (In reply to comment #3) > Also interesting: Does the new weaving hook consider caching of woven class > files? Or is this done automatically somehow? No, I think that would have to be left as value add for a framework implementation. Hopefully we could do that as an extension in equinox. I forget how you did that in equinox weaving. Created attachment 180613 [details]
updated patch
Here is a well tested patch which also has a snapshot of the current API being proposed by OSGi for the weaving hook.
I released the last patch with minor changes, to add copyrights and more comments. |