|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.collections.ClassMetaCache<T>
T
- type of objects stored in cachepublic class ClassMetaCache<T>
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
Constructor Summary | |
---|---|
ClassMetaCache()
|
Method Summary | |
---|---|
T |
get(java.lang.Class<?> key)
Gets value from cache or returns null if not in cache |
T |
put(java.lang.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 |
Constructor Detail |
---|
public ClassMetaCache()
Method Detail |
---|
public T put(java.lang.Class<?> key, T value)
key
- the class that will be used as the value's keyvalue
- the value that should be stored in cache
null
if nonepublic T get(java.lang.Class<?> key)
null
if not in cache
key
- the class that is the key for the value
null
if none
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |