Search in sources :

Example 1 with QueryCacheItem

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) {
    }
}
Also used : IOException(java.io.IOException) CacheEntry(lucee.commons.io.cache.CacheEntry) QueryCacheItem(lucee.runtime.cache.tag.query.QueryCacheItem)

Aggregations

IOException (java.io.IOException)1 CacheEntry (lucee.commons.io.cache.CacheEntry)1 QueryCacheItem (lucee.runtime.cache.tag.query.QueryCacheItem)1