org.jruby.util
Class ClassCache<T>
java.lang.Object
org.jruby.util.ClassCache<T>
public class ClassCache<T>
- extends java.lang.Object
A Simple cache which maintains a collection of classes that can potentially be shared among
multiple runtimes (or whole JVM).
Constructor Summary |
ClassCache(java.lang.ClassLoader classLoader)
|
ClassCache(java.lang.ClassLoader classLoader,
int max)
The ClassLoader this class cache will use for any classes generated through it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassCache
public ClassCache(java.lang.ClassLoader classLoader,
int max)
- The ClassLoader this class cache will use for any classes generated through it. It is
assumed that the classloader provided will be a parent loader of any runtime using it.
- Parameters:
classLoader
- to use to generate shared classes
ClassCache
public ClassCache(java.lang.ClassLoader classLoader)
getClassLoader
public java.lang.ClassLoader getClassLoader()
getMax
public int getMax()
cacheClassByKey
public java.lang.Class<T> cacheClassByKey(java.lang.Object key,
ClassCache.ClassGenerator classGenerator)
throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
flush
public void flush()
isFull
public boolean isFull()
getClassLoadCount
public int getClassLoadCount()
getLiveClassCount
public int getLiveClassCount()
getClassReuseCount
public int getClassReuseCount()
Copyright © 2002-2007 JRuby Team. All Rights Reserved.