org.hibernate.cache
Interface Region

All Known Subinterfaces:
CollectionRegion, EntityRegion, GeneralDataRegion, QueryResultsRegion, TimestampsRegion, TransactionalDataRegion
All Known Implementing Classes:
BaseGeneralDataRegionAdapter, BaseRegionAdapter, BaseTransactionalDataRegionAdapter, BasicRegionAdapter, ClusteredConcurrentTimestampsRegionImpl, CollectionRegionAdapter, CollectionRegionImpl, EntityRegionAdapter, EntityRegionImpl, QueryResultsRegionAdapter, QueryResultsRegionImpl, TimestampsRegionAdapter, TimestampsRegionImpl, TransactionalDataRegionAdapter

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 Detail

getName

String getName()
Retrieve the name of this region.

Returns:
The region name

destroy

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

getSizeInMemory

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.

getElementCountInMemory

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

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.

toMap

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.

nextTimestamp

long nextTimestamp()

getTimeout

int getTimeout()


Copyright © 2009 Hibernate.org. All Rights Reserved.