|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.util.collection.WeakTypeCache<T>
T - the cached typepublic abstract class WeakTypeCache<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
| Constructor Summary | |
|---|---|
WeakTypeCache()
|
|
| Method Summary | ||
|---|---|---|
protected abstract void |
generate(Class<?> clazz,
T result)
Fill in the result |
|
protected abstract void |
generate(ParameterizedType type,
T result)
Fill in the result |
|
T |
get(String name,
ClassLoader cl)
Get the information for a class |
|
T |
get(Type type)
Get the information for a type |
|
protected T |
getClass(Class<?> clazz)
Get the information for a class |
|
protected Map<String,T> |
getClassLoaderCache(ClassLoader cl)
Get the cache for the classloader |
|
protected T |
getGenericArrayType(GenericArrayType type)
Get the information for an array type |
|
protected T |
getParameterizedType(ParameterizedType type)
Get the information for a parameterized type |
|
protected
|
getTypeVariable(TypeVariable<D> type)
Get the information for a type variable |
|
protected T |
getWildcardType(WildcardType type)
Get the information for a wildcard type |
|
protected abstract T |
instantiate(Class<?> clazz)
Instantiate for a class |
|
protected abstract T |
instantiate(ParameterizedType type)
Instantiate for a parameterized type |
|
protected T |
peek(Class<?> clazz)
Peek into the cache |
|
protected T |
peek(ParameterizedType type)
Peek into the cache |
|
protected void |
put(Class<?> clazz,
T result)
Put a result into the cache |
|
protected void |
put(ParameterizedType type,
T result)
Put a result into the cache |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WeakTypeCache()
| Method Detail |
|---|
public T get(Type type)
type - the type
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 abstract T instantiate(ParameterizedType type)
type - the parameterized type
protected abstract void generate(ParameterizedType type,
T result)
type - the parameterized typeresult - the resultprotected T getParameterizedType(ParameterizedType type)
type - the parameterized type
protected T getWildcardType(WildcardType type)
type - the paremeterized type
protected <D extends GenericDeclaration> T getTypeVariable(TypeVariable<D> type)
D - the declarationtype - the type variable
protected T getGenericArrayType(GenericArrayType type)
type - the array type
protected T peek(ParameterizedType type)
type - the type
protected void put(ParameterizedType type,
T result)
type - the typeresult - the valueprotected T getClass(Class<?> clazz)
clazz - the class
protected T peek(Class<?> clazz)
clazz - the class
protected void put(Class<?> clazz,
T result)
clazz - the classresult - the valueprotected Map<String,T> getClassLoaderCache(ClassLoader cl)
cl - the classloader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||