org.hibernate.cache
Class TreeCacheProvider

java.lang.Object
  extended by org.hibernate.cache.TreeCacheProvider
All Implemented Interfaces:
CacheProvider

public class TreeCacheProvider
extends Object
implements CacheProvider

Support for a standalone JBossCache (TreeCache) instance. The JBossCache is configured via a local config resource.

Author:
Gavin King

Field Summary
static String CONFIG_RESOURCE
          Deprecated. use org.hibernate.cfg.Environment.CACHE_PROVIDER_CONFIG
static String DEFAULT_CONFIG
           
 
Constructor Summary
TreeCacheProvider()
           
 
Method Summary
 Cache buildCache(String regionName, Properties properties)
          Construct and configure the Cache representation of a named cache region.
 org.jboss.cache.TreeCache getUnderlyingCache()
           
 boolean isMinimalPutsEnabledByDefault()
           
 long nextTimestamp()
          Generate a timestamp
 void start(Properties properties)
          Prepare the underlying JBossCache TreeCache instance.
 void stop()
          Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_RESOURCE

public static final String CONFIG_RESOURCE
Deprecated. use org.hibernate.cfg.Environment.CACHE_PROVIDER_CONFIG
See Also:
Constant Field Values

DEFAULT_CONFIG

public static final String DEFAULT_CONFIG
See Also:
Constant Field Values
Constructor Detail

TreeCacheProvider

public TreeCacheProvider()
Method Detail

buildCache

public Cache buildCache(String regionName,
                        Properties properties)
                 throws CacheException
Construct and configure the Cache representation of a named cache region.

Specified by:
buildCache in interface CacheProvider
Parameters:
regionName - the name of the cache region
properties - configuration settings
Returns:
The Cache representation of the named cache region.
Throws:
CacheException - Indicates an error building the cache region.

nextTimestamp

public long nextTimestamp()
Description copied from interface: CacheProvider
Generate a timestamp

Specified by:
nextTimestamp in interface CacheProvider

start

public void start(Properties properties)
Prepare the underlying JBossCache TreeCache instance.

Specified by:
start in interface CacheProvider
Parameters:
properties - All current config settings.
Throws:
CacheException - Indicates a problem preparing cache for use.

stop

public void stop()
Description copied from interface: CacheProvider
Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().

Specified by:
stop in interface CacheProvider

isMinimalPutsEnabledByDefault

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

getUnderlyingCache

public org.jboss.cache.TreeCache getUnderlyingCache()