org.jboss.byteman.agent.check
Class LoadCache

java.lang.Object
  extended by org.jboss.byteman.agent.check.LoadCache

public class LoadCache
extends java.lang.Object

A cache used to allow the association between a class name and the corresponding class in the context of any given class loader to be cached. caching is used to improve performance of the transformer when checking the superclass hierarchy of a class which is a candidate for transformation to identify if it is a target for rules which inject into overriding methods. the cache is a map keyed by classloader whose value is itself a map. each nested map translates a fully qualified class name to an instance of Class. The outer map is a WeakHashMap ensuring that it doe snot hold on to loaders once all references to them have been dropped.


Field Summary
private  java.util.HashMap<java.lang.String,java.lang.Class> bootMap
           
private  java.lang.instrument.Instrumentation inst
           
private  java.util.WeakHashMap<java.lang.ClassLoader,java.util.HashMap<java.lang.String,java.lang.Class>> loaderMaps
           
 
Constructor Summary
LoadCache(java.lang.instrument.Instrumentation inst)
           
 
Method Summary
 java.lang.Class lookupClass(java.lang.String name, java.lang.ClassLoader baseLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inst

private java.lang.instrument.Instrumentation inst

loaderMaps

private java.util.WeakHashMap<java.lang.ClassLoader,java.util.HashMap<java.lang.String,java.lang.Class>> loaderMaps

bootMap

private java.util.HashMap<java.lang.String,java.lang.Class> bootMap
Constructor Detail

LoadCache

public LoadCache(java.lang.instrument.Instrumentation inst)
Method Detail

lookupClass

public java.lang.Class lookupClass(java.lang.String name,
                                   java.lang.ClassLoader baseLoader)