org.erights.e.elib.util
Class ClassCache

java.lang.Object
  |
  +--org.erights.e.elib.util.ClassCache

public class ClassCache
extends Object

Untamed: A performance optimizing hack: by hanging onto classes that are looked up by name, we can spare Java's overhead if they ever have to be looked up again.

Also recognizes the names for the scalar types and "void".

XXX The original motivation -- the surprising overhead of Java's Class.forName(String) may have been long fixed, in which case this implementation should do less.

Author:
Mark S. Miller

Field Summary
private static Hashtable OurCache
          Using java.util.Hashtables instead of ELib's tables in order to avoid circular dependencies, and in order to get the thread-safety necessary for static used globally shared across a JVM.
 
Constructor Summary
private ClassCache()
          prevent instantiation
 
Method Summary
static Class forName(String name)
          Enabled: Like Class.forName(String), but also accepts the string-names for the scalar types and "void".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OurCache

private static final Hashtable OurCache
Using java.util.Hashtables instead of ELib's tables in order to avoid circular dependencies, and in order to get the thread-safety necessary for static used globally shared across a JVM.

Constructor Detail

ClassCache

private ClassCache()
prevent instantiation

Method Detail

forName

public static Class forName(String name)
                     throws ClassNotFoundException
Enabled: Like Class.forName(String), but also accepts the string-names for the scalar types and "void".

ClassNotFoundException


comments?