public interface Cache
public MyCache(final String id) { if (id == null) { throw new IllegalArgumentException("Cache instances require an ID"); } this.id = id; initialize(); }
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this cache instance
|
String |
getId() |
Object |
getObject(Object key) |
ReadWriteLock |
getReadWriteLock()
Optional.
|
int |
getSize()
Optional.
|
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.
|
String getId()
void putObject(Object key, Object value)
key
- Can be any object but usually it is a CacheKey
value
- The result of a select.Object getObject(Object key)
key
- The keyObject removeObject(Object key)
key
- The keyvoid clear()
int getSize()
ReadWriteLock getReadWriteLock()
Copyright © 2010–2015 MyBatis.org. All rights reserved.