T
- exact value typepublic abstract class WeakClassCache<T> extends Object
It creates the class specific data in two stages to avoid recursion.
instantiate - creates the data
generate - fills in the details
Modifier and Type | Field and Description |
---|---|
protected Map<ClassLoader,Map<String,WeakReference<T>>> |
cache
The cache
|
Constructor and Description |
---|
WeakClassCache() |
Modifier and Type | Method and Description |
---|---|
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
|
protected final Map<ClassLoader,Map<String,WeakReference<T>>> cache
public T get(Class<?> clazz)
clazz
- the classpublic T get(String name, ClassLoader cl) throws ClassNotFoundException
name
- the namecl
- the classloaderClassNotFoundException
- when the class cannot be foundprotected abstract T instantiate(Class<?> clazz)
clazz
- the classprotected abstract void generate(Class<?> clazz, T result)
clazz
- the classresult
- the resultprotected Map<String,WeakReference<T>> getClassLoaderCache(ClassLoader cl)
cl
- the classloaderCopyright © 2018 JBoss by Red Hat. All rights reserved.