Class WeakCache
java.lang.Object
org.apache.ibatis.cache.decorators.WeakCache
- All Implemented Interfaces:
Cache
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cacheprivate final ReentrantLockprivate intprivate final ReferenceQueue<Object> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Cache
getReadWriteLock
-
Field Details
-
hardLinksToAvoidGarbageCollection
-
queueOfGarbageCollectedEntries
-
delegate
-
numberOfHardLinks
private int numberOfHardLinks -
lock
-
-
Constructor Details
-
WeakCache
-
-
Method Details
-
getId
-
getSize
-
setSize
public void setSize(int size) -
putObject
-
getObject
-
removeObject
Description copied from interface:CacheAs 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:
removeObjectin interfaceCache- Parameters:
key- The key- Returns:
- Not used
-
clear
-
removeGarbageCollectedItems
private void removeGarbageCollectedItems()
-