public class

PerpetualCache

extends Object
implements Cache
java.lang.Object
   ↳ org.apache.ibatis.cache.impl.PerpetualCache

Summary

Public Constructors
PerpetualCache(String id)
Public Methods
void clear()
Clears this cache instance
boolean equals(Object o)
String getId()
Object getObject(Object key)
ReadWriteLock getReadWriteLock()
Optional.
int getSize()
Optional.
int hashCode()
void putObject(Object key, Object value)
Object removeObject(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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.ibatis.cache.Cache

Public Constructors

public PerpetualCache (String id)

Public Methods

public void clear ()

Clears this cache instance

public boolean equals (Object o)

public String getId ()

public Object getObject (Object key)

public ReadWriteLock getReadWriteLock ()

Optional. 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.

Returns
  • A ReadWriteLock

public int getSize ()

Optional. This method is not called by the core.

Returns
  • The number of elements stored in the cache (not its capacity).

public int hashCode ()

public void putObject (Object key, Object value)

public Object removeObject (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. 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.

Parameters
key The key
Returns
  • Not used