Class ClassMetaCache<T>
- java.lang.Object
-
- org.apache.wicket.util.collections.ClassMetaCache<T>
-
- Type Parameters:
T- type of objects stored in cache
public class ClassMetaCache<T> extends java.lang.ObjectThis class wraps a WeakHashMap that holds one ConcurrentHashMap per ClassLoader. In the rare event of a previously unmapped ClassLoader, the WeakHashMap is replaced by a new one. This avoids any synchronization overhead, much like aCopyOnWriteArrayList
-
-
Constructor Summary
Constructors Constructor Description ClassMetaCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget(java.lang.Class<?> key)Gets value from cache or returnsnullif not in cacheTput(java.lang.Class<?> key, T value)Puts value into cache
-
-
-
Method Detail
-
put
public T put(java.lang.Class<?> key, T value)
Puts value into cache- Parameters:
key- the class that will be used as the value's keyvalue- the value that should be stored in cache- Returns:
- value previously stored in cache for this key, or
nullif none
-
get
public T get(java.lang.Class<?> key)
Gets value from cache or returnsnullif not in cache- Parameters:
key- the class that is the key for the value- Returns:
- value stored in cache or
nullif none
-
-