org.hibernate.cache
Interface Cache
- OptimisticCache
- HashtableCache
Implementors define a caching algorithm. All implementors
must be threadsafe.
void | clear() - Clear the cache
|
void | destroy() - Clean up
|
Object | get(Object key) - Get an item from the cache, nontransactionally
|
long | getElementCountInMemory() - The count of entries currently contained in the regions in-memory store.
|
long | getElementCountOnDisk() - The count of entries currently contained in the regions disk store.
|
String | getRegionName() - Get the name of the cache region
|
long | getSizeInMemory() - The number of bytes is this cache region currently consuming in memory.
|
int | getTimeout() - Get a reasonable "lock timeout"
|
void | lock(Object key) - If this is a clustered cache, lock the item
|
long | nextTimestamp() - Generate a timestamp
|
void | put(Object key, Object value) - Add an item to the cache, nontransactionally, with
failfast semantics
|
Object | read(Object key) - Get an item from the cache
|
void | remove(Object key) - Remove an item from the cache
|
Map | toMap() - optional operation
|
void | unlock(Object key) - If this is a clustered cache, unlock the item
|
void | update(Object key, Object value) - Add an item to the cache
|
get
public Object get(Object key)
throws CacheException
Get an item from the cache, nontransactionally
- the cached object or null
getElementCountInMemory
public long getElementCountInMemory()
The count of entries currently contained in the regions in-memory store.
- The count of entries in memory; -1 if unknown or unsupported.
getElementCountOnDisk
public long getElementCountOnDisk()
The count of entries currently contained in the regions disk store.
- The count of entries on disk; -1 if unknown or unsupported.
getRegionName
public String getRegionName()
Get the name of the cache region
getSizeInMemory
public long getSizeInMemory()
The number of bytes is this cache region currently consuming in memory.
- The number of bytes consumed by this region; -1 if unknown or
unsupported.
getTimeout
public int getTimeout()
Get a reasonable "lock timeout"
lock
public void lock(Object key)
throws CacheException
If this is a clustered cache, lock the item
nextTimestamp
public long nextTimestamp()
Generate a timestamp
put
public void put(Object key,
Object value)
throws CacheException
Add an item to the cache, nontransactionally, with
failfast semantics
read
public Object read(Object key)
throws CacheException
Get an item from the cache
- the cached object or null
remove
public void remove(Object key)
throws CacheException
Remove an item from the cache
toMap
public Map toMap()
optional operation
unlock
public void unlock(Object key)
throws CacheException
If this is a clustered cache, unlock the item
update
public void update(Object key,
Object value)
throws CacheException
Add an item to the cache