@Override public Boolean call(final ICacheManager cacheManager, final CacheKey key) { if (logger.isDebugEnabled()) { logger.debug("Removing domain from cache: " + key); // $NON-NLS-1$ } cacheManager.removeFromRegionCache(CACHE_REGION, key); return true; // continue }
/** Remove domain ID cache for all sessions */ protected void clearDomainIdsFromCache() { try { Set<?> cachedObjects = cacheManager.getAllKeysFromRegionCache(CACHE_REGION); if (cachedObjects != null) { for (Object k : cachedObjects) { if (k instanceof String) { String key = (String) k; if (key != null && key.startsWith(DOMAIN_CACHE_KEY_PREDICATE)) { cacheManager.removeFromRegionCache(CACHE_REGION, key); } } } } } catch (Throwable e) { // due to a known issue in hibernate cache // the getAll* methods of ICacheManager throw a NullPointerException if // cache values are null (this can happen due to cache object timeouts) // please see: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3248 if (logger.isDebugEnabled()) { logger.debug("", e); // $NON-NLS-1$ } } }
/** * Remove domain ID cache for a given session * * @param session */ protected void clearDomainIdsFromCache(IPentahoSession session) { final String key = generateDomainIdCacheKeyForSession(session); if (cacheManager.getFromRegionCache(CACHE_REGION, key) != null) { cacheManager.removeFromRegionCache(CACHE_REGION, key); } }