org.apache.wicket.util.collections
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 Object
This 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 a CopyOnWriteArrayList
Method Summary |
T |
get(Class<?> key)
Gets value from cache or returns null if not in cache |
T |
put(Class<?> key,
T value)
Puts value into cache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassMetaCache
public ClassMetaCache()
put
public T put(Class<?> key,
T value)
- Puts value into cache
- Parameters:
key
- value
-
- Returns:
- value previously stored in cache for this key, or
null
if none
get
public T get(Class<?> key)
- Gets value from cache or returns
null
if not in cache
- Parameters:
key
-
- Returns:
- value stored in cache or
null
if none
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.