public class ClassLoaderRepository extends java.lang.Object implements Repository
Repository
Modifier and Type | Class and Description |
---|---|
static class |
ClassLoaderRepository.SoftHashMap |
Modifier and Type | Field and Description |
---|---|
static boolean |
useSharedCache |
Constructor and Description |
---|
ClassLoaderRepository(java.lang.ClassLoader loader) |
ClassLoaderRepository(ClassLoaderReference loaderRef) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all entries from the local cache
|
JavaClass |
findClass(java.lang.String className)
Find an already defined JavaClass in the local cache.
|
JavaClass |
loadClass(java.lang.Class clazz)
Find the JavaClass instance for the given run-time class object
|
JavaClass |
loadClass(java.lang.String className)
Lookup a JavaClass object from the Class Name provided.
|
void |
removeClass(JavaClass clazz)
Remove class from repository
|
java.lang.String |
report()
Produce a report on cache usage.
|
long[] |
reportStats()
Returns an array of the stats, for testing, the order is fixed: 0=time spent loading (static) 1=time spent manipulating URLs
(static) 2=classes loaded (static) 3=cache hits shared (static) 4=misses in shared due to eviction (static) 5=cache hits
local 6=misses in local due to eviction 7=shared cache size
|
void |
reset()
Reset statistics and clear all caches
|
void |
storeClass(JavaClass clazz)
Store a new JavaClass into this Repository.
|
public ClassLoaderRepository(java.lang.ClassLoader loader)
public ClassLoaderRepository(ClassLoaderReference loaderRef)
public void storeClass(JavaClass clazz)
storeClass
in interface Repository
public void removeClass(JavaClass clazz)
removeClass
in interface Repository
public JavaClass findClass(java.lang.String className)
findClass
in interface Repository
public JavaClass loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
loadClass
in interface Repository
java.lang.ClassNotFoundException
public java.lang.String report()
public long[] reportStats()
public void reset()
public JavaClass loadClass(java.lang.Class clazz) throws java.lang.ClassNotFoundException
Repository
loadClass
in interface Repository
java.lang.ClassNotFoundException
public void clear()
clear
in interface Repository