public class EhCacheRegionFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected EhcacheAccessStrategyFactory |
accessStrategyFactory
EhcacheAccessStrategyFactory for creating various access strategies |
protected net.sf.ehcache.CacheManager |
manager
Ehcache CacheManager that supplied Ehcache instances for this Hibernate RegionFactory.
|
protected ProviderMBeanRegistrationHelper |
mbeanRegistrationHelper
MBean registration helper class instance for Ehcache Hibernate MBeans.
|
static java.lang.String |
NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
The Hibernate system property specifying the location of the ehcache configuration file name.
|
protected SessionFactoryOptions |
settings
Settings object for the Hibernate persistence unit.
|
Constructor and Description |
---|
EhCacheRegionFactory()
Creates a non-singleton EhCacheRegionFactory
|
EhCacheRegionFactory(java.util.Properties prop)
Creates a non-singleton EhCacheRegionFactory
|
Modifier and Type | Method and Description |
---|---|
CollectionRegion |
buildCollectionRegion(java.lang.String regionName,
java.util.Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing collection data.
|
EntityRegion |
buildEntityRegion(java.lang.String regionName,
java.util.Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing entity data.
|
NaturalIdRegion |
buildNaturalIdRegion(java.lang.String regionName,
java.util.Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing NaturalId to Primary Key mappings.
|
QueryResultsRegion |
buildQueryResultsRegion(java.lang.String regionName,
java.util.Properties properties)
Build a cache region specialized for storing query results.
|
TimestampsRegion |
buildTimestampsRegion(java.lang.String regionName,
java.util.Properties properties)
Build a cache region specialized for storing update-timestamps data.
|
AccessType |
getDefaultAccessType()
Default access-type used when the configured using JPA 2.0 config.
|
boolean |
isMinimalPutsEnabledByDefault()
By default should we perform "minimal puts" when using this second
level cache implementation?
|
protected java.net.URL |
loadResource(java.lang.String configurationResourceName)
Load a resource from the classpath.
|
long |
nextTimestamp()
Generate a timestamp.
|
void |
setClassLoaderService(ClassLoaderService classLoaderService) |
void |
start(SessionFactoryOptions settings,
java.util.Properties properties)
Lifecycle callback to perform any necessary initialization of the
underlying cache implementation(s).
|
void |
stop()
Lifecycle callback to perform any necessary cleanup of the underlying
cache implementation(s).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildCollectionRegion, buildEntityRegion, buildNaturalIdRegion, buildQueryResultsRegion, buildTimestampsRegion, start
public static final java.lang.String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
protected final ProviderMBeanRegistrationHelper mbeanRegistrationHelper
protected volatile net.sf.ehcache.CacheManager manager
protected SessionFactoryOptions settings
protected final EhcacheAccessStrategyFactory accessStrategyFactory
EhcacheAccessStrategyFactory
for creating various access strategiespublic EhCacheRegionFactory()
public EhCacheRegionFactory(java.util.Properties prop)
prop
- Not usedpublic void start(SessionFactoryOptions settings, java.util.Properties properties) throws CacheException
RegionFactory
SessionFactoryImpl
.settings
- The settings in effect.properties
- The defined cfg propertiesCacheException
- Indicates problems starting the L2 cache impl;
considered as a sign to stop SessionFactory
building.public void stop()
RegionFactory
SessionFactory.close()
.public boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault
in interface RegionFactory
public long nextTimestamp()
RegionFactory
nextTimestamp
in interface RegionFactory
public EntityRegion buildEntityRegion(java.lang.String regionName, java.util.Properties properties, CacheDataDescription metadata) throws CacheException
RegionFactory
buildEntityRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.metadata
- Information regarding the type of data to be cachedCacheException
- Indicates problems building the region.public NaturalIdRegion buildNaturalIdRegion(java.lang.String regionName, java.util.Properties properties, CacheDataDescription metadata) throws CacheException
RegionFactory
buildNaturalIdRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.metadata
- Information regarding the type of data to be cachedCacheException
- Indicates problems building the region.public CollectionRegion buildCollectionRegion(java.lang.String regionName, java.util.Properties properties, CacheDataDescription metadata) throws CacheException
RegionFactory
buildCollectionRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.metadata
- Information regarding the type of data to be cachedCacheException
- Indicates problems building the region.public QueryResultsRegion buildQueryResultsRegion(java.lang.String regionName, java.util.Properties properties) throws CacheException
RegionFactory
buildQueryResultsRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.CacheException
- Indicates problems building the region.public void setClassLoaderService(ClassLoaderService classLoaderService)
public TimestampsRegion buildTimestampsRegion(java.lang.String regionName, java.util.Properties properties) throws CacheException
RegionFactory
buildTimestampsRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.CacheException
- Indicates problems building the region.protected java.net.URL loadResource(java.lang.String configurationResourceName)
public AccessType getDefaultAccessType()
@Cacheable(true)
to be attached to an
entity without any access type or usage qualification.
We are conservative here in specifying AccessType.READ_WRITE
so as to follow the mantra of "do no harm".
This is a Hibernate 3.5 method.getDefaultAccessType
in interface RegionFactory
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.