Top Description Fields Constructors Methods
org.eclipse.persistence.internal.identitymaps

public Class SoftCacheWeakIdentityMap

extends HardCacheWeakIdentityMap
Class Inheritance
Imports
java.lang.ref.SoftReference, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession

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:

Since
TOPLink/Java 1.2

Field Summary

Inherited from org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap:
referenceCache

Constructor Summary

AccessConstructor and Description
public
SoftCacheWeakIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isIsolated)

Method Summary

Modifier and TypeMethod and Description
public Object
buildReference(Object
is the domain object to cache.
object
)

Overrides org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap.buildReference.

Creates a Soft reference to the object.
public boolean
hasReference(Object
the object for hard or the reference for soft.
reference
)

Overrides org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap.hasReference.

Checks if the object is null, or reference's object is null.
Inherited from org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap:
createCacheKeygetReferenceCacheputremoveupdateMaxSize

Constructor Detail

SoftCacheWeakIdentityMapback to summary
public SoftCacheWeakIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isIsolated)

Method Detail

buildReferenceback to summary
public Object buildReference(Object object)

Overrides org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap.buildReference.

Creates a Soft reference to the object.

Parameters
object:Object

is the domain object to cache.

Annotations
@Override
hasReferenceback to summary
public boolean hasReference(Object reference)

Overrides org.eclipse.persistence.internal.identitymaps.HardCacheWeakIdentityMap.hasReference.

Checks if the object is null, or reference's object is null.

Parameters
reference:Object

the object for hard or the reference for soft.

Annotations
@Override