Package org.hibernate.cache
Class HashtableCache
java.lang.Object
org.hibernate.cache.HashtableCache
- All Implemented Interfaces:
Cache
A lightweight implementation of the Cache interface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the cachevoiddestroy()Clean upGet an item from the cache, nontransactionallylongThe count of entries currently contained in the regions in-memory store.longThe count of entries currently contained in the regions disk store.Get the name of the cache regionlongThe number of bytes is this cache region currently consuming in memory.intGet a reasonable "lock timeout"voidIf this is a clustered cache, lock the itemlongGenerate a timestampvoidAdd an item to the cache, nontransactionally, with failfast semanticsGet an item from the cachevoidRemove an item from the cachetoMap()optional operationtoString()voidIf this is a clustered cache, unlock the itemvoidAdd an item to the cache
-
Constructor Details
-
HashtableCache
-
-
Method Details
-
getRegionName
Description copied from interface:CacheGet the name of the cache region- Specified by:
getRegionNamein interfaceCache
-
read
Description copied from interface:CacheGet an item from the cache- Specified by:
readin interfaceCache- Parameters:
key-- Returns:
- the cached object or null
- Throws:
CacheException
-
get
Description copied from interface:CacheGet an item from the cache, nontransactionally- Specified by:
getin interfaceCache- Parameters:
key-- Returns:
- the cached object or null
- Throws:
CacheException
-
update
Description copied from interface:CacheAdd an item to the cache- Specified by:
updatein interfaceCache- Parameters:
key-value-- Throws:
CacheException
-
put
Description copied from interface:CacheAdd an item to the cache, nontransactionally, with failfast semantics- Specified by:
putin interfaceCache- Parameters:
key-value-- Throws:
CacheException
-
remove
Description copied from interface:CacheRemove an item from the cache- Specified by:
removein interfaceCache- Throws:
CacheException
-
clear
Description copied from interface:CacheClear the cache- Specified by:
clearin interfaceCache- Throws:
CacheException
-
destroy
Description copied from interface:CacheClean up- Specified by:
destroyin interfaceCache- Throws:
CacheException
-
lock
Description copied from interface:CacheIf this is a clustered cache, lock the item- Specified by:
lockin interfaceCache- Throws:
CacheException
-
unlock
Description copied from interface:CacheIf this is a clustered cache, unlock the item- Specified by:
unlockin interfaceCache- Throws:
CacheException
-
nextTimestamp
public long nextTimestamp()Description copied from interface:CacheGenerate a timestamp- Specified by:
nextTimestampin interfaceCache
-
getTimeout
public int getTimeout()Description copied from interface:CacheGet a reasonable "lock timeout"- Specified by:
getTimeoutin interfaceCache
-
getSizeInMemory
public long getSizeInMemory()Description copied from interface:CacheThe number of bytes is this cache region currently consuming in memory.- Specified by:
getSizeInMemoryin interfaceCache- Returns:
- The number of bytes consumed by this region; -1 if unknown or unsupported.
-
getElementCountInMemory
public long getElementCountInMemory()Description copied from interface:CacheThe count of entries currently contained in the regions in-memory store.- Specified by:
getElementCountInMemoryin interfaceCache- Returns:
- The count of entries in memory; -1 if unknown or unsupported.
-
getElementCountOnDisk
public long getElementCountOnDisk()Description copied from interface:CacheThe count of entries currently contained in the regions disk store.- Specified by:
getElementCountOnDiskin interfaceCache- Returns:
- The count of entries on disk; -1 if unknown or unsupported.
-
toMap
Description copied from interface:Cacheoptional operation -
toString
-