use of com.google.gerrit.server.plugins.DelegatingClassLoader in project gerrit by GerritCodeReview.
the class DynamicOptions method getMergedClassLoader.
protected ClassLoader getMergedClassLoader(ClassLoader beanCl, ClassLoader dynamicBeanCl) {
Map<ClassLoader, WeakReference<ClassLoader>> mergedClByCl = mergedClByCls.get(beanCl);
if (mergedClByCl == null) {
mergedClByCl = Collections.synchronizedMap(new WeakHashMap<>());
mergedClByCls.put(beanCl, mergedClByCl);
}
WeakReference<ClassLoader> mergedClRef = mergedClByCl.get(dynamicBeanCl);
ClassLoader mergedCl = null;
if (mergedClRef != null) {
mergedCl = mergedClRef.get();
}
if (mergedCl == null) {
mergedCl = new DelegatingClassLoader(beanCl, dynamicBeanCl);
mergedClByCl.put(dynamicBeanCl, new WeakReference<>(mergedCl));
}
return mergedCl;
}
Aggregations