/** * 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); }
private void putLock(final Object key, final Lock newLock) { if (newLock.isLocked()) { region.putEternal(key, newLock); } else { region.put(key, newLock); } }
private void putLock(final Object key, final Lock newLock) { if (newLock.isLocked()) { region.putPinned(key, newLock); } else { region.put(key, newLock); } }
/** * 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); }
private void putLock(final Object key, final Lock newLock) { if (newLock.isLocked()) { region.putEternal(key, newLock); } else { region.put(key, newLock); } }
/** * Returns <code>false</code> and fails to put the value if there is an existing un-writeable item mapped to this * key. * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) */ @Override public final boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { region.writeLock(key); try { Lockable item = (Lockable) region.get(key); boolean writeable = item == null || item.isWriteable(txTimestamp, version, versionComparator); if (writeable) { region.put(key, new Item(value, version, region.nextTimestamp())); return true; } else { return false; } } finally { region.writeUnlock(key); } }
private void putLock(final Object key, final Lock newLock) { if (newLock.isLocked()) { region.putEternal(key, newLock); } else { region.put(key, newLock); } }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * Map the given value to the given key, replacing any existing mapping for this key, * pinning the key in the cache */ public final void putPinned(Object key, Object value) throws CacheException { put(key, value, true); }
/** * Returns <code>false</code> and fails to put the value if there is an existing un-writeable item mapped to this * key. * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) */ @Override public final boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { region.writeLock(key); try { Lockable item = (Lockable) region.get(key); boolean writeable = item == null || item.isWriteable(txTimestamp, version, versionComparator); if (writeable) { region.put(key, new Item(value, version, region.nextTimestamp())); return true; } else { return false; } } finally { region.writeUnlock(key); } }
/** * Returns <code>false</code> and fails to put the value if there is an existing un-writeable item mapped to this * key. * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) */ @Override public final boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { region.writeLock(key); try { Lockable item = (Lockable) region.get(key); boolean writeable = item == null || item.isWriteable(txTimestamp, version, versionComparator); if (writeable) { region.put(key, new Item(value, version, region.nextTimestamp())); return true; } else { return false; } } finally { region.writeUnlock(key); } }
/** * Returns <code>false</code> and fails to put the value if there is an existing un-writeable item mapped to this * key. * * @see org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) * @see org.hibernate.cache.access.CollectionRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean) */ @Override public final boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { region.writeLock(key); try { Lockable item = (Lockable) region.get(key); boolean writeable = item == null || item.isWriteable(txTimestamp, version, versionComparator); if (writeable) { region.put(key, new Item(value, version, region.nextTimestamp())); return true; } else { return false; } } finally { region.writeUnlock(key); } }