Top Description Fields Constructors Methods
org.hibernate.cache.impl.bridge

public abstract Class BaseRegionAdapter

extends Object
implements Region
Class Inheritance
All Implemented Interfaces
org.hibernate.cache.Region
Known Direct Subclasses
org.hibernate.cache.impl.bridge.BaseTransactionalDataRegionAdapter, org.hibernate.cache.impl.bridge.BaseGeneralDataRegionAdapter
Imports
java.util.Map, org.hibernate.cache.Region, .Cache, .CacheException, org.hibernate.cfg.Settings

Basic adapter bridging between Region and Cache.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
protected final Settings
protected final Cache
underlyingCache

Deprecated as a consequence of Cache being deprecated.

Constructor Summary

AccessConstructor and Description
protected
BaseRegionAdapter(Cache underlyingCache, Settings settings)

Deprecated as a consequence of Cache being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
contains(Object
The cache key
key
)

Implements org.hibernate.cache.Region.contains.

Determine whether this region contains data for the given key.
public void
destroy()

Implements org.hibernate.cache.Region.destroy.

The "end state" contract of the region's lifecycle.
public long
getElementCountInMemory()

Implements org.hibernate.cache.Region.getElementCountInMemory.

The count of entries currently contained in the regions in-memory store.
public long
getElementCountOnDisk()

Implements org.hibernate.cache.Region.getElementCountOnDisk.

The count of entries currently contained in the regions disk store.
public String
getName()

Implements org.hibernate.cache.Region.getName.

Retrieve the name of this region.
public long
getSizeInMemory()

Implements org.hibernate.cache.Region.getSizeInMemory.

The number of bytes is this cache region currently consuming in memory.
public int
public long
public Map<K, V>
toMap()

Implements org.hibernate.cache.Region.toMap.

Get the contents of this region as a map.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

settingsback to summary
protected final Settings settings
underlyingCacheback to summary
protected final Cache underlyingCache

Deprecated

as a consequence of Cache being deprecated. See corresponding docs for further information.

Constructor Detail

BaseRegionAdapterback to summary
protected BaseRegionAdapter(Cache underlyingCache, Settings settings)

Deprecated

as a consequence of Cache being deprecated. See corresponding docs for further information.

Method Detail

clearback to summary
public void clear() throws CacheException
containsback to summary
public boolean contains(Object key)

Implements org.hibernate.cache.Region.contains.

Doc from org.hibernate.cache.Region.contains.

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

Implements org.hibernate.cache.Region.destroy.

Doc from org.hibernate.cache.Region.destroy.

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()

Implements org.hibernate.cache.Region.getElementCountInMemory.

Doc from org.hibernate.cache.Region.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()

Implements org.hibernate.cache.Region.getElementCountOnDisk.

Doc from org.hibernate.cache.Region.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()

Implements org.hibernate.cache.Region.getName.

Doc from org.hibernate.cache.Region.getName.

Retrieve the name of this region.

Returns:String

The region name

getSizeInMemoryback to summary
public long getSizeInMemory()

Implements org.hibernate.cache.Region.getSizeInMemory.

Doc from org.hibernate.cache.Region.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()

Implements org.hibernate.cache.Region.getTimeout.

nextTimestampback to summary
public long nextTimestamp()

Implements org.hibernate.cache.Region.nextTimestamp.

toMapback to summary
public Map<K, V> toMap()

Implements org.hibernate.cache.Region.toMap.

Doc from org.hibernate.cache.Region.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.