public class SoftCacheWeakIdentityMap extends HardCacheWeakIdentityMap
Purpose: A SoftCacheWeakIdentityMap is identical to the WeakIdentityMap, however the weak reference can be a performance problem for some types of apps because it can cause too much garbage collection of objects read causing them to be re-read and re-built (this defeats the purpose of the cache). The SoftCacheWeakIdentityMap solves this through also holding a fixed number of objects in memory to improve caching.
Responsibilities:
HardCacheWeakIdentityMap.ReferenceCacheKey
Constructor and Description |
---|
SoftCacheWeakIdentityMap(int size,
ClassDescriptor descriptor,
AbstractSession session,
boolean isIsolated) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
buildReference(java.lang.Object object)
Creates a Soft reference to the object.
|
boolean |
hasReference(java.lang.Object reference)
Checks if the object is null, or reference's object is null.
|
createCacheKey, getReferenceCache, put, remove, updateMaxSize
clone, collectLocks, elements, getCacheKey, getCacheKeys, getSize, getSize, keys, keys, lazyRelationshipLoaded, resetCacheKey
acquireDeferredLock, acquireLock, acquireLockNoWait, acquireLockWithWait, acquireReadLockOnCacheKey, acquireReadLockOnCacheKeyNoWait, containsKey, get, getAllCacheKeysFromIdentityMapWithEntityPK, getAllFromIdentityMapWithEntityPK, getCacheKeyForLock, getDefaultIdentityMapClass, getDescriptor, getDescriptorClass, getMaxSize, getWrapper, getWriteLockValue, release, remove, setDescriptor, setWrapper, setWriteLockValue, toString
public SoftCacheWeakIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isIsolated)
public java.lang.Object buildReference(java.lang.Object object)
buildReference
in class HardCacheWeakIdentityMap
object
- is the domain object to cache.public boolean hasReference(java.lang.Object reference)
hasReference
in class HardCacheWeakIdentityMap
the
- object for hard or the reference for soft.EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference