Top Description Methods
org.hibernate.cache

public Interface Region

Known Direct Subinterfaces
org.hibernate.cache.TransactionalDataRegion, org.hibernate.cache.GeneralDataRegion
Known Direct Implementers
org.hibernate.cache.impl.bridge.BaseRegionAdapter
Imports
java.util.Map

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

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if the underlying cache contains corresponding data; false otherwise.
contains
(Object
The cache key
key
)

Determine whether this region contains data for the given key.

public void
destroy()

The "end state" contract of the region's lifecycle.

public long

Returns:

The count of entries in memory; -1 if unknown or unsupported.
getElementCountInMemory
()

The count of entries currently contained in the regions in-memory store.

public long

Returns:

The count of entries on disk; -1 if unknown or unsupported.
getElementCountOnDisk
()

The count of entries currently contained in the regions disk store.

public String

Returns:

The region name
getName
()

Retrieve the name of this region.

public long

Returns:

The number of bytes consumed by this region; -1 if unknown or unsupported.
getSizeInMemory
()

The number of bytes is this cache region currently consuming in memory.

public int
public long
public Map<K, V>

Returns:

The content map.
toMap
()

Get the contents of this region as a map.

Method Detail

containsback to summary
public boolean contains(Object key)

Determine whether this region contains data for the given key.

The semantic here is whether the cache contains data visible for the current call context. This should be viewed as a "best effort", meaning blocking should be avoid if possible.

Parameters
key:Object

The cache key

Returns:boolean

True if the underlying cache contains corresponding data; false otherwise.

destroyback to summary
public void destroy() throws CacheException

The "end state" contract of the region's lifecycle. Called during org.hibernate.SessionFactory#close() to give the region a chance to cleanup.

Exceptions
CacheException:
Indicates problem shutting down
getElementCountInMemoryback to summary
public long getElementCountInMemory()

The count of entries currently contained in the regions in-memory store.

Returns:long

The count of entries in memory; -1 if unknown or unsupported.

getElementCountOnDiskback to summary
public long getElementCountOnDisk()

The count of entries currently contained in the regions disk store.

Returns:long

The count of entries on disk; -1 if unknown or unsupported.

getNameback to summary
public String getName()

Retrieve the name of this region.

Returns:String

The region name

getSizeInMemoryback to summary
public long getSizeInMemory()

The number of bytes is this cache region currently consuming in memory.

Returns:long

The number of bytes consumed by this region; -1 if unknown or unsupported.

getTimeoutback to summary
public int getTimeout()
nextTimestampback to summary
public long nextTimestamp()
toMapback to summary
public Map<K, V> toMap()

Get the contents of this region as a map.

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

Returns:Map<K, V>

The content map.