[MAGNOLIA-2553] FactoryUtil: should return a proxy object for observed objects Created: 13/Jan/09 Updated: 23/Jan/13 Resolved: 17/Feb/10 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | None |
| Fix Version/s: | 4.3 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Philipp Bärfuss | Assignee: | Magnolia International |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
The problematic point is that code which keeps a reference to an object will never see an reloaded changes. It would be more convenient and saver if the factory would return and cache a proxy instead. Before this, code using such objects always had to get a fresh instance through the factory; once this is implemented, they can keep a reference (i.e get it in their constructor - potentially injected) |
| Comments |
| Comment by Philipp Bracher [ 13/Jan/09 ] |
|
I have attached a patch (I quick first attempt). While the change is simple I had to change the hacks we use for ServerConfiguration and IPSecurityManager. But after a bit of polishing I think we can apply it. |
| Comment by Magnolia International [ 15/Jan/09 ] |
|
Not too keen on pushing this for 4.0 - how about 4.1 ? |
| Comment by Philipp Bracher [ 15/Jan/09 ] |
|
No problem: can be part of 4.1 Here some notes about how to polish it:
|
| Comment by Philipp Bracher [ 15/Jan/09 ] |
|
I updated the patch. All points in the last comment are implemented. Cleaner and lesser changes needed. |
| Comment by Magnolia International [ 14/Jan/10 ] |
|
patch <finally> applied on trunk ! Leaving open for now, needs a little more testing |
| Comment by Magnolia International [ 18/Jan/10 ] |
|
The above comment is due to org.apache.commons.proxy.factory.cglib.CglibProxyFactory.PublicCallbackFilter, which was changed in the trunk of commons-proxy to a filter that only filters equals and hashcode methods. This could thus be different as from commons-proxy-1.1 |
| Comment by Magnolia International [ 17/Feb/10 ] |
|
See linked issues for further improvements |