FileDocCategorySizeDatePackage
Cache.javaAPI DocHibernate 3.2.52371Thu Apr 21 02:57:20 BST 2005org.hibernate.cache

Cache

public interface Cache
Implementors define a caching algorithm. All implementors must be threadsafe.

Fields Summary
Constructors Summary
Methods Summary
public voidclear()
Clear the cache

public voiddestroy()
Clean up

public java.lang.Objectget(java.lang.Object key)
Get an item from the cache, nontransactionally

param
key
return
the cached object or null
throws
CacheException

public longgetElementCountInMemory()
The count of entries currently contained in the regions in-memory store.

return
The count of entries in memory; -1 if unknown or unsupported.

public longgetElementCountOnDisk()
The count of entries currently contained in the regions disk store.

return
The count of entries on disk; -1 if unknown or unsupported.

public java.lang.StringgetRegionName()
Get the name of the cache region

public longgetSizeInMemory()
The number of bytes is this cache region currently consuming in memory.

return
The number of bytes consumed by this region; -1 if unknown or unsupported.

public intgetTimeout()
Get a reasonable "lock timeout"

public voidlock(java.lang.Object key)
If this is a clustered cache, lock the item

public longnextTimestamp()
Generate a timestamp

public voidput(java.lang.Object key, java.lang.Object value)
Add an item to the cache, nontransactionally, with failfast semantics

param
key
param
value
throws
CacheException

public java.lang.Objectread(java.lang.Object key)
Get an item from the cache

param
key
return
the cached object or null
throws
CacheException

public voidremove(java.lang.Object key)
Remove an item from the cache

public java.util.MaptoMap()
optional operation

public voidunlock(java.lang.Object key)
If this is a clustered cache, unlock the item

public voidupdate(java.lang.Object key, java.lang.Object value)
Add an item to the cache

param
key
param
value
throws
CacheException