Methods Summary |
---|
public java.lang.Object | buildReference(java.lang.Object object)Creates a Soft reference if Required
return object;
|
public oracle.toplink.essentials.internal.identitymaps.CacheKey | createCacheKey(java.util.Vector primaryKey, java.lang.Object object, java.lang.Object writeLockValue, long readTime)Use a ReferenceCacheKey that also stores the linked list node to manage
the LRU sub-cache of references.
return new ReferenceCacheKey(primaryKey, object, writeLockValue, readTime);
|
public oracle.toplink.essentials.internal.helper.linkedlist.ExposedNodeLinkedList | getReferenceCache()Return the linked reference cache.
return referenceCache;
|
public boolean | hasReference(java.lang.Object reference)Checks if the object is null, or reference's object is null.
return reference != null;
|
protected void | put(oracle.toplink.essentials.internal.identitymaps.CacheKey cacheKey)Store the object in the cache with the cache key.
Also store the linked list node in the cache key.
ReferenceCacheKey referenceCacheKey = (ReferenceCacheKey)cacheKey;
LinkedNode node = getReferenceCache().addFirst(buildReference(referenceCacheKey.getObject()));
referenceCacheKey.setReferenceCacheNode(node);
super.put(cacheKey);
|
public java.lang.Object | remove(oracle.toplink.essentials.internal.identitymaps.CacheKey cacheKey)Remove the cache key from the map and the sub-cache list.
if (cacheKey == null) {
return null;
}
ReferenceCacheKey referenceCacheKey = (ReferenceCacheKey)cacheKey;
synchronized (this){
getReferenceCache().remove(referenceCacheKey.getReferenceCacheNode());
}
return super.remove(cacheKey);
|
public synchronized void | updateMaxSize(int maxSize)This method will be used to update the max cache size.
setMaxSize(maxSize);
// Remove the LRU items if max size exceeded.
while (getReferenceCache().size() > getMaxSize()) {
getReferenceCache().removeLast();
}
|