public interface

Region

org.hibernate.cache.Region
Known Indirect Subclasses

Class Overview

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

Summary

Public Methods
abstract boolean contains(Object key)
Determine whether this region contains data for the given key.
abstract void destroy()
The "end state" contract of the region's lifecycle.
abstract long getElementCountInMemory()
The count of entries currently contained in the regions in-memory store.
abstract long getElementCountOnDisk()
The count of entries currently contained in the regions disk store.
abstract String getName()
Retrieve the name of this region.
abstract long getSizeInMemory()
The number of bytes is this cache region currently consuming in memory.
abstract int getTimeout()
abstract long nextTimestamp()
abstract Map toMap()
Get the contents of this region as a map.

Public Methods

public abstract 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 The cache key
Returns
  • True if the underlying cache contains corresponding data; false otherwise.

public abstract void destroy ()

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

Throws
CacheException Indicates problem shutting down

public abstract 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.

public abstract 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.

public abstract String getName ()

Retrieve the name of this region.

Returns
  • The region name

public abstract 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.

public abstract int getTimeout ()

public abstract long nextTimestamp ()

public abstract 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.