public boolean evict(Fqn fqn) { // eviction code may also try and evict the fqn of a buddy. If the Fqn is that of a buddy we need to ensure that // this call is ignored since a proper remove will happen on the data owner when the data is evicted, and that // remove will propagate here. if (BuddyFqnTransformer.isBackupFqn(fqn)) return true; try { return cache.removeNode(fqn); } catch (Exception e) { if (log.isDebugEnabled()) log.debug("Unable to evict " + fqn, e); return false; } } }
@Override public void deleteAll() { getCache().removeNode(Fqn.fromString(_cacheName)); }
/** * Performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any * exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void removeAll(Cache cache, Fqn region, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.removeNode(region); } catch (Exception e) { throw new CacheException(e); } }
/** * Performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any * exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void removeAll(Cache cache, Fqn region, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.removeNode(region); } catch (Exception e) { throw new CacheException(e); } }
/** * Performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any * exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void removeNode(Cache cache, Fqn region, Object key, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.removeNode(new Fqn(region, key)); } catch (Exception e) { throw new CacheException(e); } }
/** * Performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any * exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void removeNode(Cache cache, Fqn region, Object key, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.removeNode(new Fqn(region, key)); } catch (Exception e) { throw new CacheException(e); } }
/** * Builds an {@link Fqn} from <code>region</code> and <code>key</code> * and performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any * exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param key * specific key to append to the <code>region</code> to form * the full Fqn * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void remove(Cache cache, Fqn region, Object key, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.removeNode(new Fqn(region, key)); } catch (Exception e) { throw new CacheException(e); } }
/** * Builds an {@link Fqn} from <code>region</code> and <code>key</code> * and performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any * exception in a {@link CacheException}. * * @param cache * the cache to invoke on * @param region * base Fqn for the cache region * @param key * specific key to append to the <code>region</code> to form * the full Fqn * @param option * invocation Option to set for this invocation. May be * <code>null</code>. */ public static void remove(Cache cache, Fqn region, Object key, Option option) throws CacheException { try { setInvocationOption(cache, option); cache.removeNode(new Fqn(region, key)); } catch (Exception e) { throw new CacheException(e); } }
public void destroy() throws CacheException { try { // NOTE : this is being used from the process of shutting down a // SessionFactory. Specific things to consider: // (1) this clearing of the region should not propagate to // other nodes on the cluster (if any); this is the // cache-mode-local option bit... // (2) really just trying a best effort to cleanup after // ourselves; lock failures, etc are not critical here; // this is the fail-silently option bit... Option option = new Option(); option.setCacheModeLocal(true); option.setFailSilently(true); if (optimistic) { option.setDataVersion(NonLockingDataVersion.INSTANCE); } jbcCache.getInvocationContext().setOptionOverrides(option); jbcCache.removeNode(regionFqn); deactivateLocalNode(); } catch (Exception e) { throw new CacheException(e); } // finally { // if (listener != null) // jbcCache.removeCacheListener(listener); // } }
public void destroy() throws CacheException { try { // NOTE : this is being used from the process of shutting down a // SessionFactory. Specific things to consider: // (1) this clearing of the region should not propagate to // other nodes on the cluster (if any); this is the // cache-mode-local option bit... // (2) really just trying a best effort to cleanup after // ourselves; lock failures, etc are not critical here; // this is the fail-silently option bit... Option option = new Option(); option.setCacheModeLocal(true); option.setFailSilently(true); if (optimistic) { option.setDataVersion(NonLockingDataVersion.INSTANCE); } jbcCache.getInvocationContext().setOptionOverrides(option); jbcCache.removeNode(regionFqn); deactivateLocalNode(); } catch (Exception e) { throw new CacheException(e); } finally { jbcCache.removeCacheListener(this); } }