public interface

RegionFactory

org.hibernate.cache.RegionFactory
Known Indirect Subclasses

Class Overview

Contract for building second level cache regions.

Implementors should define a constructor in one of two forms:

  • MyRegionFactoryImpl(Properties)
  • MyRegionFactoryImpl()
Use the first when we need to read config properties prior to start(Settings, Properties) being called. For an example, have a look at 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 SettingsFactory.

Summary

Public Methods
abstract CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata)
Build a cache region specialized for storing collection data.
abstract EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
Build a cache region specialized for storing entity data.
abstract QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties)
Build a cache region specialized for storing query results
abstract TimestampsRegion buildTimestampsRegion(String regionName, Properties properties)
Build a cache region specialized for storing update-timestamps data.
abstract AccessType getDefaultAccessType()
Get the default access type for entity and collection regions.
abstract boolean isMinimalPutsEnabledByDefault()
By default should we perform "minimal puts" when using this second level cache implementation?
abstract long nextTimestamp()
Generate a timestamp.
abstract void start(Settings settings, Properties properties)
Lifecycle callback to perform any necessary initialization of the underlying cache implementation(s).
abstract void stop()
Lifecycle callback to perform any necessary cleanup of the underlying cache implementation(s).

Public Methods

public abstract CollectionRegion buildCollectionRegion (String regionName, Properties properties, CacheDataDescription metadata)

Build a cache region specialized for storing collection data.

Parameters
regionName The name of the region.
properties Configuration properties.
metadata Information regarding the type of data to be cached
Returns
  • The built region
Throws
CacheException Indicates problems building the region.

public abstract EntityRegion buildEntityRegion (String regionName, Properties properties, CacheDataDescription metadata)

Build a cache region specialized for storing entity data.

Parameters
regionName The name of the region.
properties Configuration properties.
metadata Information regarding the type of data to be cached
Returns
  • The built region
Throws
CacheException Indicates problems building the region.

public abstract QueryResultsRegion buildQueryResultsRegion (String regionName, Properties properties)

Build a cache region specialized for storing query results

Parameters
regionName The name of the region.
properties Configuration properties.
Returns
  • The built region
Throws
CacheException Indicates problems building the region.

public abstract TimestampsRegion buildTimestampsRegion (String regionName, Properties properties)

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

Parameters
regionName The name of the region.
properties Configuration properties.
Returns
  • The built region
Throws
CacheException Indicates problems building the region.

public abstract AccessType getDefaultAccessType ()

Get the default access type for entity and collection regions.

Returns
  • This factory's default access type.

public abstract boolean isMinimalPutsEnabledByDefault ()

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

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

public abstract long nextTimestamp ()

Generate a timestamp.

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

Returns
  • The generated timestamp.

public abstract void start (Settings settings, Properties properties)

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

Parameters
settings The settings in effect.
properties The defined cfg properties
Throws
CacheException Indicates problems starting the L2 cache impl; considered as a sign to stop SessionFactory building.

public abstract void stop ()

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