public abstract class

BaseRegionAdapter

extends Object
implements Region
java.lang.Object
   ↳ org.hibernate.cache.impl.bridge.BaseRegionAdapter
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Basic adapter bridging between Region and Cache.

Summary

Fields
protected final Settings settings
protected final Cache underlyingCache
Protected Constructors
BaseRegionAdapter(Cache underlyingCache, Settings settings)
Public Methods
void clear()
boolean contains(Object key)
Determine whether this region contains data for the given key.
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.cache.Region

Fields

protected final Settings settings

protected final Cache underlyingCache

Protected Constructors

protected BaseRegionAdapter (Cache underlyingCache, Settings settings)

Public Methods

public void clear ()

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

public void destroy ()

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

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.

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.

public String getName ()

Retrieve the name of this region.

Returns
  • The region name

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.

public int getTimeout ()

public long nextTimestamp ()

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.