|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.collection.WeakClassCache<T>
T
- exact value typepublic abstract class WeakClassCache<T>
A weak class cache that instantiates does not a hold a strong reference to either the classloader or class.
It creates the class specific data in two stages to avoid recursion.
instantiate - creates the data
generate - fills in the details
Field Summary | |
---|---|
protected Map<ClassLoader,Map<String,WeakReference<T>>> |
cache
The cache |
Constructor Summary | |
---|---|
WeakClassCache()
|
Method Summary | |
---|---|
protected abstract void |
generate(Class<?> clazz,
T result)
Fill in the result |
T |
get(Class<?> clazz)
Get the information for a class |
T |
get(String name,
ClassLoader cl)
Get the information for a class |
protected Map<String,WeakReference<T>> |
getClassLoaderCache(ClassLoader cl)
Get the cache for the classloader |
protected abstract T |
instantiate(Class<?> clazz)
Instantiate for a class |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Map<ClassLoader,Map<String,WeakReference<T>>> cache
Constructor Detail |
---|
public WeakClassCache()
Method Detail |
---|
public T get(Class<?> clazz)
clazz
- the class
public T get(String name, ClassLoader cl) throws ClassNotFoundException
name
- the namecl
- the classloader
ClassNotFoundException
- when the class cannot be foundprotected abstract T instantiate(Class<?> clazz)
clazz
- the class
protected abstract void generate(Class<?> clazz, T result)
clazz
- the classresult
- the resultprotected Map<String,WeakReference<T>> getClassLoaderCache(ClassLoader cl)
cl
- the classloader
|
JBoss Common Classes 2.2.17.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |