Package org.hibernate.cache
Interface Cache
- All Known Subinterfaces:
OptimisticCache
- All Known Implementing Classes:
HashtableCache
public interface Cache
Deprecated.
As of 3.3; see for details.
Implementors define a caching algorithm. All implementors
must be threadsafe.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated.Clear the cachevoiddestroy()Deprecated.Clean upDeprecated.Get an item from the cache, nontransactionallylongDeprecated.The count of entries currently contained in the regions in-memory store.longDeprecated.The count of entries currently contained in the regions disk store.Deprecated.Get the name of the cache regionlongDeprecated.The number of bytes is this cache region currently consuming in memory.intDeprecated.Get a reasonable "lock timeout"voidDeprecated.If this is a clustered cache, lock the itemlongDeprecated.Generate a timestampvoidDeprecated.Add an item to the cache, nontransactionally, with failfast semanticsDeprecated.Get an item from the cachevoidDeprecated.Remove an item from the cachetoMap()Deprecated.optional operationvoidDeprecated.If this is a clustered cache, unlock the itemvoidDeprecated.Add an item to the cache
-
Method Details
-
read
Deprecated.Get an item from the cache- Parameters:
key-- Returns:
- the cached object or null
- Throws:
CacheException
-
get
Deprecated.Get an item from the cache, nontransactionally- Parameters:
key-- Returns:
- the cached object or null
- Throws:
CacheException
-
put
Deprecated.Add an item to the cache, nontransactionally, with failfast semantics- Parameters:
key-value-- Throws:
CacheException
-
update
Deprecated.Add an item to the cache- Parameters:
key-value-- Throws:
CacheException
-
remove
Deprecated.Remove an item from the cache- Throws:
CacheException
-
clear
Deprecated.Clear the cache- Throws:
CacheException
-
destroy
Deprecated.Clean up- Throws:
CacheException
-
lock
Deprecated.If this is a clustered cache, lock the item- Throws:
CacheException
-
unlock
Deprecated.If this is a clustered cache, unlock the item- Throws:
CacheException
-
nextTimestamp
long nextTimestamp()Deprecated.Generate a timestamp -
getTimeout
int getTimeout()Deprecated.Get a reasonable "lock timeout" -
getRegionName
String getRegionName()Deprecated.Get the name of the cache region -
getSizeInMemory
long getSizeInMemory()Deprecated.The number of bytes is this cache region currently consuming in memory.- Returns:
- The number of bytes consumed by this region; -1 if unknown or unsupported.
-
getElementCountInMemory
long getElementCountInMemory()Deprecated.The count of entries currently contained in the regions in-memory store.- Returns:
- The count of entries in memory; -1 if unknown or unsupported.
-
getElementCountOnDisk
long getElementCountOnDisk()Deprecated.The count of entries currently contained in the regions disk store.- Returns:
- The count of entries on disk; -1 if unknown or unsupported.
-
toMap
Map toMap()Deprecated.optional operation
-