@Override public void removePrecompiledPage(GroovyPageCompiledScriptSource scriptSource) { super.removePrecompiledPage(scriptSource); // remove the entry from uriResolveCache for (Map.Entry<GroovyPageLocatorCacheKey, CacheEntry<GroovyPageScriptSource>> entry : new HashSet<Map.Entry<GroovyPageLocatorCacheKey, CacheEntry<GroovyPageScriptSource>>>(uriResolveCache.entrySet())) { GroovyPageScriptSource ss=entry.getValue().getValue(); if (ss == scriptSource || (ss instanceof GroovyPageCompiledScriptSource && scriptSource.getURI().equals(((GroovyPageCompiledScriptSource)ss).getURI()))) { uriResolveCache.remove(entry.getKey()); } } }
@Override protected boolean shouldUpdate(long beforeLockingCreatedMillis, Object cacheRequestObject) { // Never expire GroovyPageCompiledScriptSource entry in cache if (getValue() instanceof GroovyPageCompiledScriptSource) { resetTimestamp(true); return false; } else { return super.shouldUpdate(beforeLockingCreatedMillis, cacheRequestObject); } } }
@SuppressWarnings("rawtypes") protected GroovyPageScriptSource lookupCache(final GroovyPageLocatorCacheKey cacheKey, Callable<GroovyPageScriptSource> updater) { GroovyPageScriptSource scriptSource = null; if (cacheTimeout == 0) { try { scriptSource = updater.call(); } catch (Exception e) { throw new CacheEntry.UpdateException(e); } } else { scriptSource = CacheEntry.getValue(uriResolveCache, cacheKey, cacheTimeout, updater, new Callable<CacheEntry>() { @Override public CacheEntry call() throws Exception { return new CustomCacheEntry(); } }, true, null); } return scriptSource == NULL_SCRIPT ? null : scriptSource; }
return CacheEntry.getValue(templateCache, cacheKey, reloadEnabled ? GroovyPageMetaInfo.LASTMODIFIED_CHECK_INTERVAL : -1, null, new Callable<CacheEntry<Template>>() { public CacheEntry<Template> call() {