/** * {@inheritDoc} */ public Class<?> insert(ClassLoader classLoader, S key, Class<?> type) { try { return super.insert(classLoader, key, type); } finally { expungeStaleEntries(); } }
/** * Finds an existing type or inserts a new one if the previous type was not found. * * @param classLoader The class loader for which this type is stored. * @param key The key for the type in question. * @param lazy A lazy creator for the type to insert of no previous type was stored in the cache. * @return The lazily created type or a previously submitted type for the same class loader and key combination. */ public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy) { Class<?> type = find(classLoader, key); if (type != null) { return type; } else { try { return insert(classLoader, key, lazy.call()); } catch (Throwable throwable) { throw new IllegalArgumentException("Could not create type", throwable); } } }
.load(classLoader, ClassLoadingStrategy.Default.INJECTION).getLoaded(); DATASTORE_PROXY_CACHE.insert(classLoader, proxyName, proxy);