org.hibernate.cache

Interface GeneralDataRegion

All Superinterfaces:
Region
Known Subinterfaces:
QueryResultsRegion, TimestampsRegion
Known Implementing Classes:
BaseGeneralDataRegionAdapter, QueryResultsRegionAdapter, TimestampsRegionAdapter

public interface GeneralDataRegion
extends Region

Contract for general-purpose cache regions.
Author:
Steve Ebersole

Method Summary

void
evict(Object key)
Evict an item from the cache immediately (without regard for transaction isolation).
void
evictAll()
Evict all contents of this particular cache region (without regard for transaction isolation).
Object
get(Object key)
Get an item from the cache.
void
put(Object key, Object value)
Put an item into the cache.

Methods inherited from interface org.hibernate.cache.Region

destroy, getElementCountInMemory, getElementCountOnDisk, getName, getSizeInMemory, getTimeout, nextTimestamp, toMap

Method Details

evict

public void evict(Object key)
            throws CacheException
Evict an item from the cache immediately (without regard for transaction isolation).
Parameters:
key - The key of the item to remove
Throws:
CacheException - Indicates a problem accessing the item or region.

evictAll

public void evictAll()
            throws CacheException
Evict all contents of this particular cache region (without regard for transaction isolation).
Throws:
CacheException - Indicates problem accessing the region.

get

public Object get(Object key)
            throws CacheException
Get an item from the cache.
Parameters:
key - The key of the item to be retrieved.
Returns:
the cached object or null
Throws:
CacheException - Indicates a problem accessing the item or region.

put

public void put(Object key,
                Object value)
            throws CacheException
Put an item into the cache.
Parameters:
key - The key under which to cache the item.
value - The item to cache.
Throws:
CacheException - Indicates a problem accessing the region.