|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.cache.jbc.JBossCacheRegionFactory
public class JBossCacheRegionFactory
RegionFactory
that uses one or more JBoss Cache instances for
caching entities, collections, queries and timestamps. How the factory
obtains a reference to the needed JBoss Cache instance(s) is determined
by the injected CacheInstanceManager
.
By default uses SharedCacheInstanceManager
as its
CacheInstanceManager
.
Basically, this uses a single shared JBoss Cache for entities, collections,
queries and timestamps. The JBoss Cache instance is created by the
JBC DefaultCacheFactory
using the resource identified by the
JndiSharedCacheInstanceManager.CACHE_RESOURCE_PROP
configuration property.
Also exposes an overloaded constructor that allows injection of different
CacheInstanceManager
implementations.
Constructor Summary | |
---|---|
JBossCacheRegionFactory()
Create a new JBossCacheRegionFactory. |
|
JBossCacheRegionFactory(CacheInstanceManager cacheInstanceManager)
Create a new JBossCacheRegionFactory that uses the provided CacheInstanceManager . |
|
JBossCacheRegionFactory(Properties props)
FIXME Per the RegionFactory class Javadoc, this constructor version should not be necessary. |
Method Summary | |
---|---|
CollectionRegion |
buildCollectionRegion(String regionName,
Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing collection data. |
EntityRegion |
buildEntityRegion(String regionName,
Properties properties,
CacheDataDescription metadata)
Build a cache region specialized for storing entity data. |
QueryResultsRegion |
buildQueryResultsRegion(String regionName,
Properties properties)
Build a cache region specialized for storing query results |
TimestampsRegion |
buildTimestampsRegion(String regionName,
Properties properties)
Build a cache region specialized for storing update-timestamps data. |
CacheInstanceManager |
getCacheInstanceManager()
|
AccessType |
getDefaultAccessType()
Get the default access type for entity and
collection regions. |
static String |
getRegionPrefix(Properties properties)
|
boolean |
isMinimalPutsEnabledByDefault()
By default should we perform "minimal puts" when using this second level cache implementation? |
long |
nextTimestamp()
Generate a timestamp. |
void |
start(Settings settings,
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JBossCacheRegionFactory(Properties props)
props
- The configuration propertiespublic JBossCacheRegionFactory()
public JBossCacheRegionFactory(CacheInstanceManager cacheInstanceManager)
CacheInstanceManager
.
cacheInstanceManager
- The contract for how we get JBC cache instances.Method Detail |
---|
public CacheInstanceManager getCacheInstanceManager()
public void start(Settings settings, Properties properties) throws CacheException
RegionFactory
SessionFactoryImpl
.
start
in interface RegionFactory
settings
- The settings in effect.properties
- The defined cfg properties
CacheException
- Indicates problems starting the L2 cache impl;
considered as a sign to stop SessionFactory
building.public void stop()
RegionFactory
SessionFactory.close()
.
stop
in interface RegionFactory
public boolean isMinimalPutsEnabledByDefault()
RegionFactory
isMinimalPutsEnabledByDefault
in interface RegionFactory
public AccessType getDefaultAccessType()
RegionFactory
entity
and
collection
regions.
getDefaultAccessType
in interface RegionFactory
public long nextTimestamp()
RegionFactory
nextTimestamp
in interface RegionFactory
public EntityRegion buildEntityRegion(String regionName, 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 cached
CacheException
- Indicates problems building the region.public CollectionRegion buildCollectionRegion(String regionName, 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 cached
CacheException
- Indicates problems building the region.public QueryResultsRegion buildQueryResultsRegion(String regionName, 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 TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException
RegionFactory
buildTimestampsRegion
in interface RegionFactory
regionName
- The name of the region.properties
- Configuration properties.
CacheException
- Indicates problems building the region.public static String getRegionPrefix(Properties properties)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |