Date:2007-09-18 18:24
Priority:2
Submitted By:Dean Wampler (deanwampler)
Assigned To:Dean Wampler (deanwampler)
Category:Advice handling
State:Open
Summary:Allow join points in an aspect to be "re-evaluated"
Detailed description
When an aspect is created, it finds the matching join points based on the state of the runtime at that moment. Types or objects are that are loaded or created later, which might also match, won't be advised.
This FR is to add the capability to have an aspect check again for possible join points. The behavior should be as follows:
If a previously-existing join point still exists, no changes are made.
If a new join point is found, it should be advised.
If a previously-existing join point appears to have "disappeared" (e.g., an object is no longer used), then the advise for it should be removed.
Note, the last point may never happen, as a reference to the join point in the aspect might keep it alive, even if all other references are gone. It would be nice to find a way to detect such a situation or use the equivalent of Java "weak references" so that aspect's reference to the object is ignored when the garbage collector is used.
A more sophisticated implementation of this feature (and one that is probably preferred) would be to observe the runtime for newly-loaded classes and newly-created objects and apply advise dynamically.
I know the FFI library/gem wrestled with garbage collection and Ruby Object's lifespans, etc. Something might be learned from their experinces?
http://github.com/ffi/ffi
Date:2007-09-18 18:24 Priority:2 Submitted By:Dean Wampler (deanwampler) Assigned To:Dean Wampler (deanwampler) Category:Advice handling State:Open Summary:Allow join points in an aspect to be "re-evaluated"
Detailed description
When an aspect is created, it finds the matching join points based on the state of the runtime at that moment. Types or objects are that are loaded or created later, which might also match, won't be advised.
This FR is to add the capability to have an aspect check again for possible join points. The behavior should be as follows:
Note, the last point may never happen, as a reference to the join point in the aspect might keep it alive, even if all other references are gone. It would be nice to find a way to detect such a situation or use the equivalent of Java "weak references" so that aspect's reference to the object is ignored when the garbage collector is used.
A more sophisticated implementation of this feature (and one that is probably preferred) would be to observe the runtime for newly-loaded classes and newly-created objects and apply advise dynamically.