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:
| Access | Constructor and Description |
|---|---|
| public | SoftCacheWeakIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isIsolated)
|
| Modifier and Type | Method and Description |
|---|---|
| public Object | buildReference(Object
is the domain object to cache. object)Overrides org. |
| public boolean | hasReference(Object
the object for hard or the reference for soft. reference)Overrides org. |
| SoftCacheWeakIdentityMap | back to summary |
|---|---|
| public SoftCacheWeakIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isIsolated) | |
| buildReference | back to summary |
|---|---|
| public Object buildReference(Object object) Overrides org. Creates a Soft reference to the object. | |
| hasReference | back to summary |
|---|---|
| public boolean hasReference(Object reference) Overrides org. Checks if the object is null, or reference's object is null. | |