| java.lang.Object org.jruby.runtime.CacheMap
CacheMap | public class CacheMap (Code) | | This class represents mappings between methods that have been cached and the classes which
have cached them. Methods within RubyModule will update this cacheMap as needed. Here is
a list of scenarios when cached methods will become invalid:
1. Redefine a method in a base class
2. Add an alias in a superclass that is the same name as a cached method in a base class
3. Include a module that has a same-named method as one already caches in a base class
4. Remove a method definition
5. Add a same-named method in super class that has been cached in a super class
Concurrency is another concern with managing this structure. Rather than synchronize this
we are going to rely on synchronization further upstream. RubyModule methods that directly
call this is responsible for synchronization.
|
Method Summary | |
public void | add(DynamicMethod method, RubyModule module) Add another class to the list of classes which are caching the method. | public void | remove(String name, DynamicMethod method) Remove all method caches associated with the provided method. |
add | public void add(DynamicMethod method, RubyModule module)(Code) | | Add another class to the list of classes which are caching the method.
Parameters: method - which is cached Parameters: module - which is caching method |
remove | public void remove(String name, DynamicMethod method)(Code) | | Remove all method caches associated with the provided method. This signature
relies on having the methods valid name passed with it since the caching classes
store the cache by name.
Parameters: name - of the method to remove Parameters: method - to remove all caches of |
|
|