org.jruby.runtime
Class CacheMap

java.lang.Object
  extended by org.jruby.runtime.CacheMap

public class CacheMap
extends java.lang.Object

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.


Constructor Summary
CacheMap(Ruby runtime)
           
 
Method Summary
 void add(DynamicMethod method, RubyModule module)
          Add another class to the list of classes which are caching the method.
 void remove(java.lang.String name, DynamicMethod method)
          Remove all method caches associated with the provided method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheMap

public CacheMap(Ruby runtime)
Method Detail

add

public void add(DynamicMethod method,
                RubyModule module)
Add another class to the list of classes which are caching the method.

Parameters:
method - which is cached
module - which is caching method

remove

public void remove(java.lang.String name,
                   DynamicMethod method)
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
method - to remove all caches of


Copyright © 2002-2007 JRuby Team. All Rights Reserved.