Class SynchronizedCache
- java.lang.Object
-
- org.apache.ibatis.cache.decorators.SynchronizedCache
-
-
Constructor Summary
Constructors Constructor Description SynchronizedCache(Cache delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this cache instance.booleanequals(java.lang.Object obj)java.lang.StringgetId()java.lang.ObjectgetObject(java.lang.Object key)java.util.concurrent.locks.ReadWriteLockgetReadWriteLock()Optional.intgetSize()Optional.inthashCode()voidputObject(java.lang.Object key, java.lang.Object object)java.lang.ObjectremoveObject(java.lang.Object key)As of 3.3.0 this method is only called during a rollback for any previous value that was missing in the cache.
-
-
-
Constructor Detail
-
SynchronizedCache
public SynchronizedCache(Cache delegate)
-
-
Method Detail
-
getId
public java.lang.String getId()
-
getSize
public int getSize()
Description copied from interface:CacheOptional. This method is not called by the core.
-
putObject
public void putObject(java.lang.Object key, java.lang.Object object)
-
getObject
public java.lang.Object getObject(java.lang.Object key)
-
removeObject
public java.lang.Object removeObject(java.lang.Object key)
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
public void clear()
Description copied from interface:CacheClears this cache instance.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getReadWriteLock
public java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
Description copied from interface:CacheOptional. As of 3.2.6 this method is no longer called by the core.Any locking needed by the cache must be provided internally by the cache provider.
- Specified by:
getReadWriteLockin interfaceCache- Returns:
- A ReadWriteLock
-
-