/** * Remove all mappings without regard to transactional safety * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#evictAll() * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#evictAll() */ public final void evictAll() throws CacheException { region.clear(); } }
/** * Read lock the entry for the given key if internal cache locks will not provide correct exclusion. */ private void readLockIfNeeded(Object key) { if (region.locksAreIndependentOfCache()) { region.readLock(key); } }
/** * Read unlock the entry for the given key if internal cache locks will not provide correct exclusion. */ private void readUnlockIfNeeded(Object key) { if (region.locksAreIndependentOfCache()) { region.readUnlock(key); } }
/** * Since this is a non-strict read/write strategy item locking is not used. */ public void unlockItem(Object key, SoftLock lock) throws CacheException { region.remove(key); }
/** * Map the given value to the given key, replacing any existing mapping for this key * this unpins the key in the cache should it be currently pinned */ public final void put(Object key, Object value) throws CacheException { put(key, value, false); }
/** * {@inheritDoc} */ @Override public void remove(Object key) throws CacheException { region.remove(key); } }
/** * {@inheritDoc} */ public Object get(Object key, long txTimestamp) throws CacheException { return region.get(key); }
/** * {@inheritDoc} */ public Object get(Object key, long txTimestamp) throws CacheException { return region.get(key); }
/** * {@inheritDoc} */ public boolean afterInsert(Object key, Object value, Object version) throws CacheException { region.put(key, value); return true; }
/** * Remove the given mapping without regard to transactional safety * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#evict(java.lang.Object) * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#evict(java.lang.Object) */ public final void evict(Object key) throws CacheException { region.remove(key); }
/** * Region locks are not supported - perform a cache clear as a precaution. * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#unlockRegion(org.hibernate.cache.access.SoftLock) * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#unlockRegion(org.hibernate.cache.access.SoftLock) */ public final void unlockRegion(SoftLock lock) throws CacheException { region.clear(); }
/** * {@inheritDoc} */ @Override public void remove(Object key) throws CacheException { region.remove(key); } }
/** * Map the given value to the given key, replacing any existing mapping for this key, * pinning the key in the cache */ public final void putEternal(Object key, Object value) throws CacheException { put(key, value, true); }
/** * Since this is a non-strict read/write strategy item locking is not used. */ public void unlockItem(Object key, SoftLock lock) throws CacheException { region.remove(key); }
/** * {@inheritDoc} */ public Object get(Object key, long txTimestamp) throws CacheException { return region.get(key); }
/** * Called to evict data from the entire region * * @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region} * @see org.hibernate.cache.access.EntityRegionAccessStrategy#removeAll() * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#removeAll() */ public final void removeAll() throws CacheException { region.clear(); }