org.hibernate.cache.jbc2
Class JBossCacheRegionFactory

java.lang.Object
  extended by org.hibernate.cache.jbc2.JBossCacheRegionFactory
All Implemented Interfaces:
RegionFactory
Direct Known Subclasses:
JndiMultiplexedJBossCacheRegionFactory, JndiSharedJBossCacheRegionFactory, MultiplexedJBossCacheRegionFactory, SharedJBossCacheRegionFactory

public class JBossCacheRegionFactory
extends Object
implements RegionFactory

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.

Author:
Steve Ebersole, Brian Stansberry

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)
           
 EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
           
 QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties)
           
 TimestampsRegion buildTimestampsRegion(String regionName, Properties properties)
           
 CacheInstanceManager getCacheInstanceManager()
           
static String getRegionPrefix(Properties properties)
           
 boolean isMinimalPutsEnabledByDefault()
           
 long nextTimestamp()
           
 void start(Settings settings, Properties properties)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossCacheRegionFactory

public JBossCacheRegionFactory(Properties props)
FIXME Per the RegionFactory class Javadoc, this constructor version should not be necessary.

Parameters:
props - The configuration properties

JBossCacheRegionFactory

public JBossCacheRegionFactory()
Create a new JBossCacheRegionFactory.


JBossCacheRegionFactory

public JBossCacheRegionFactory(CacheInstanceManager cacheInstanceManager)
Create a new JBossCacheRegionFactory that uses the provided CacheInstanceManager.

Parameters:
cacheInstanceManager - The contract for how we get JBC cache instances.
Method Detail

getCacheInstanceManager

public CacheInstanceManager getCacheInstanceManager()

start

public void start(Settings settings,
                  Properties properties)
           throws CacheException
Specified by:
start in interface RegionFactory
Throws:
CacheException

stop

public void stop()
Specified by:
stop in interface RegionFactory

isMinimalPutsEnabledByDefault

public boolean isMinimalPutsEnabledByDefault()
Specified by:
isMinimalPutsEnabledByDefault in interface RegionFactory

nextTimestamp

public long nextTimestamp()
Specified by:
nextTimestamp in interface RegionFactory

buildEntityRegion

public EntityRegion buildEntityRegion(String regionName,
                                      Properties properties,
                                      CacheDataDescription metadata)
                               throws CacheException
Specified by:
buildEntityRegion in interface RegionFactory
Throws:
CacheException

buildCollectionRegion

public CollectionRegion buildCollectionRegion(String regionName,
                                              Properties properties,
                                              CacheDataDescription metadata)
                                       throws CacheException
Specified by:
buildCollectionRegion in interface RegionFactory
Throws:
CacheException

buildQueryResultsRegion

public QueryResultsRegion buildQueryResultsRegion(String regionName,
                                                  Properties properties)
                                           throws CacheException
Specified by:
buildQueryResultsRegion in interface RegionFactory
Throws:
CacheException

buildTimestampsRegion

public TimestampsRegion buildTimestampsRegion(String regionName,
                                              Properties properties)
                                       throws CacheException
Specified by:
buildTimestampsRegion in interface RegionFactory
Throws:
CacheException

getRegionPrefix

public static String getRegionPrefix(Properties properties)


Copyright © 2011 Hibernate.org. All Rights Reserved.