use of lucee.runtime.cache.tag.query.QueryCacheItem in project Lucee by lucee.
the class CacheHandlerCollectionImpl method clear.
public static void clear(PageContext pc, Cache cache, CacheHandlerFilter filter) {
try {
Iterator<CacheEntry> it = cache.entries().iterator();
CacheEntry ce;
Object obj;
while (it.hasNext()) {
ce = it.next();
if (filter == null) {
cache.remove(ce.getKey());
continue;
}
obj = ce.getValue();
if (obj instanceof QueryCacheItem)
obj = ((QueryCacheItem) obj).getQuery();
if (filter.accept(obj))
cache.remove(ce.getKey());
}
} catch (IOException e) {
}
}
Aggregations