Class SoftCache
java.lang.Object
org.apache.ibatis.cache.decorators.SoftCache
- All Implemented Interfaces:
Cache
Soft Reference cache decorator
Thanks to Dr. Heinz Kabutz for his guidance here.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cache
private int
private final ReferenceQueue<Object>
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.ibatis.cache.Cache
getReadWriteLock
-
Field Details
-
hardLinksToAvoidGarbageCollection
-
queueOfGarbageCollectedEntries
-
delegate
-
numberOfHardLinks
private int numberOfHardLinks
-
-
Constructor Details
-
SoftCache
-
-
Method Details
-
getId
-
getSize
public int getSize()Description copied from interface:Cache
Optional. This method is not called by the core. -
setSize
public void setSize(int size) -
putObject
-
getObject
-
removeObject
Description copied from interface:Cache
As of 3.3.0 this method is only called during a rollback for any previous value that was missing in the cache. This lets any blocking cache to release the lock that may have previously put on the key. A blocking cache puts a lock when a value is null and releases it when the value is back again. This way other threads will wait for the value to be available instead of hitting the database.- Specified by:
removeObject
in interfaceCache
- Parameters:
key
- The key- Returns:
- Not used
-
clear
public void clear()Description copied from interface:Cache
Clears this cache instance. -
removeGarbageCollectedItems
private void removeGarbageCollectedItems()
-