org.hibernate.cache

Interface Region

Known Subinterfaces:
CollectionRegion, EntityRegion, GeneralDataRegion, QueryResultsRegion, TimestampsRegion, TransactionalDataRegion
Known Implementing Classes:
BaseGeneralDataRegionAdapter, BaseRegionAdapter, BaseTransactionalDataRegionAdapter, CollectionRegionAdapter, EntityRegionAdapter, QueryResultsRegionAdapter, TimestampsRegionAdapter

public interface Region

Defines a contract for accessing a particular named region within the underlying cache implementation.
Author:
Steve Ebersole

Method Summary

void
destroy()
The "end state" contract of the region's lifecycle.
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
getName()
Retrieve the name of this region.
long
getSizeInMemory()
The number of bytes is this cache region currently consuming in memory.
int
getTimeout()
long
nextTimestamp()
Map
toMap()
Get the contents of this region as a map.

Method Details

destroy

public void destroy()
            throws CacheException
The "end state" contract of the region's lifecycle. Called during SessionFactory.close() to give the region a chance to cleanup.
Throws:
CacheException - Indicates problem shutting down

getElementCountInMemory

public long getElementCountInMemory()
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

public long getElementCountOnDisk()
The count of entries currently contained in the regions disk store.
Returns:
The count of entries on disk; -1 if unknown or unsupported.

getName

public String getName()
Retrieve the name of this region.
Returns:
The region name

getSizeInMemory

public long getSizeInMemory()
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.

getTimeout

public int getTimeout()

nextTimestamp

public long nextTimestamp()

toMap

public Map toMap()
Get the contents of this region as a map.

Implementors which do not support this notion should simply return an empty map.

Returns:
The content map.