Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RubyForge-14054] Allow join points in an aspect to be "re-evaluated" #19

Open
hedgehog opened this issue Jan 29, 2010 · 1 comment
Open

Comments

@hedgehog
Copy link

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.

@hedgehog
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant