org.springsource.loaded.ri
Class JavaMethodCache

java.lang.Object
  extended by org.springsource.loaded.ri.JavaMethodCache

public class JavaMethodCache
extends java.lang.Object

Creating Java Method objects for a given MethodMember is rather expensive because it typically involves getting. The declared methods of a Class and searching for one that matches the method signature. This is most problematic when we are trying to get a Method for an array of MethodMembers, because in this case we will end up repeating the process multiple times. A JavaMethodCache instance can cache Method objects from the first time we iterate the declared methods of a class so subsequently we can just get the other methods from the cache.

Since:
0.5.0

Nested Class Summary
static class JavaMethodCache.Initializer
          This class is used to initialise the cache in a thread safe manner.
 
Constructor Summary
JavaMethodCache()
           
 
Method Summary
 java.lang.reflect.Method get(MethodMember methodMember)
           
 void initialize(JavaMethodCache.Initializer init)
          This method should be called to put all entries into the map.
 boolean isInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMethodCache

public JavaMethodCache()
Method Detail

isInitialized

public boolean isInitialized()

initialize

public void initialize(JavaMethodCache.Initializer init)
This method should be called to put all entries into the map.


get

public java.lang.reflect.Method get(MethodMember methodMember)