Top Description Methods
org.hibernate.cache

public Interface RegionFactory

Known Direct Implementers
org.hibernate.cache.impl.NoCachingRegionFactory, org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
Imports
java.util.Properties, org.hibernate.cache.access.AccessType, org.hibernate.cfg.Settings

Contract for building second level cache regions.

Implementors should define a constructor in one of two forms:

Use the first when we need to read config properties prior to start being called. For an example, have a look at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge where we need the properties in order to determine which legacy CacheProvider to use so that we can answer the isMinimalPutsEnabledByDefault() question for the org.hibernate.cfg.SettingsFactory.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public CollectionRegion

Returns:

The built region
buildCollectionRegion
(String
The name of the region.
regionName
,
Properties
Configuration properties.
properties
,
CacheDataDescription
Information regarding the type of data to be cached
metadata
)

Build a cache region specialized for storing collection data.

public EntityRegion

Returns:

The built region
buildEntityRegion
(String
The name of the region.
regionName
,
Properties
Configuration properties.
properties
,
CacheDataDescription
Information regarding the type of data to be cached
metadata
)

Build a cache region specialized for storing entity data.

public QueryResultsRegion

Returns:

The built region
buildQueryResultsRegion
(String
The name of the region.
regionName
,
Properties
Configuration properties.
properties
)

Build a cache region specialized for storing query results

public TimestampsRegion

Returns:

The built region
buildTimestampsRegion
(String
The name of the region.
regionName
,
Properties
Configuration properties.
properties
)

Build a cache region specialized for storing update-timestamps data.

public AccessType

Returns:

This factory's default access type.
getDefaultAccessType
()

Get the default access type for entity and collection regions.

public boolean

Returns:

True if "minimal puts" should be performed by default; false otherwise.
isMinimalPutsEnabledByDefault
()

By default should we perform "minimal puts" when using this second level cache implementation?

public long

Returns:

The generated timestamp.
nextTimestamp
()

Generate a timestamp.

public void
start(Settings
The settings in effect.
settings
,
Properties
The defined cfg properties
properties
)

Lifecycle callback to perform any necessary initialization of the underlying cache implementation(s).

public void
stop()

Lifecycle callback to perform any necessary cleanup of the underlying cache implementation(s).

Method Detail

buildCollectionRegionback to summary
public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException

Build a cache region specialized for storing collection data.

Parameters
regionName:String

The name of the region.

properties:Properties

Configuration properties.

metadata:CacheDataDescription

Information regarding the type of data to be cached

Returns:CollectionRegion

The built region

Exceptions
CacheException:
Indicates problems building the region.
buildEntityRegionback to summary
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException

Build a cache region specialized for storing entity data.

Parameters
regionName:String

The name of the region.

properties:Properties

Configuration properties.

metadata:CacheDataDescription

Information regarding the type of data to be cached

Returns:EntityRegion

The built region

Exceptions
CacheException:
Indicates problems building the region.
buildQueryResultsRegionback to summary
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws CacheException

Build a cache region specialized for storing query results

Parameters
regionName:String

The name of the region.

properties:Properties

Configuration properties.

Returns:QueryResultsRegion

The built region

Exceptions
CacheException:
Indicates problems building the region.
buildTimestampsRegionback to summary
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException

Build a cache region specialized for storing update-timestamps data.

Parameters
regionName:String

The name of the region.

properties:Properties

Configuration properties.

Returns:TimestampsRegion

The built region

Exceptions
CacheException:
Indicates problems building the region.
getDefaultAccessTypeback to summary
public AccessType getDefaultAccessType()

Get the default access type for entity and collection regions.

Returns:AccessType

This factory's default access type.

isMinimalPutsEnabledByDefaultback to summary
public boolean isMinimalPutsEnabledByDefault()

By default should we perform "minimal puts" when using this second level cache implementation?

Returns:boolean

True if "minimal puts" should be performed by default; false otherwise.

nextTimestampback to summary
public long nextTimestamp()

Generate a timestamp.

This is generally used for cache content locking/unlocking purposes depending upon the access-strategy being used.

Returns:long

The generated timestamp.

startback to summary
public void start(Settings settings, Properties properties) throws CacheException

Lifecycle callback to perform any necessary initialization of the underlying cache implementation(s). Called exactly once during the construction of a org.hibernate.impl.SessionFactoryImpl.

Parameters
settings:Settings

The settings in effect.

properties:Properties

The defined cfg properties

Exceptions
CacheException:
Indicates problems starting the L2 cache impl; considered as a sign to stop org.hibernate.SessionFactory building.
stopback to summary
public void stop()

Lifecycle callback to perform any necessary cleanup of the underlying cache implementation(s). Called exactly once during org.hibernate.SessionFactory#close.