use of org.apache.wicket.util.collections.ClassMetaCache in project wicket by apache.
the class NonContextual method getCache.
private static ClassMetaCache<NonContextual<?>> getCache() {
ClassMetaCache<NonContextual<?>> meta = cache.get(BeanManagerLookup.lookup());
if (meta == null) {
synchronized (lock) {
BeanManager manager = BeanManagerLookup.lookup();
meta = cache.get(manager);
if (meta == null) {
meta = new ClassMetaCache<NonContextual<?>>();
// copy-on-write the cache
Map<BeanManager, ClassMetaCache<NonContextual<?>>> newCache = new WeakHashMap<BeanManager, ClassMetaCache<NonContextual<?>>>(cache);
newCache.put(manager, meta);
cache = Collections.unmodifiableMap(newCache);
}
}
}
return meta;
}
Aggregations