org.jruby.util
Class ClassCache<T>

java.lang.Object
  extended by 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).


Nested Class Summary
static interface ClassCache.ClassGenerator
           
 
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.
 
Method Summary
 java.lang.Class<T> cacheClassByKey(java.lang.Object key, ClassCache.ClassGenerator classGenerator)
           
 java.lang.ClassLoader getClassLoader()
           
 int getMax()
           
 boolean isFull()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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)
Method Detail

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

isFull

public boolean isFull()


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