public final class SingletonEhCacheProvider extends Object implements CacheProvider
hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider
in the Hibernate configuration
to enable this provider for Hibernate's second level cache.
Updated for ehcache-1.2. Note this provider requires ehcache-1.2.jar. Make sure ehcache-1.1.jar or earlier
is not in the classpath or it will not work.
See http://ehcache.sf.net for documentation on ehcache
Modifier and Type | Field and Description |
---|---|
static String |
NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
The Hibernate system property specifying the location of the ehcache configuration file name.
|
Constructor and Description |
---|
SingletonEhCacheProvider() |
Modifier and Type | Method and Description |
---|---|
Cache |
buildCache(String name,
Properties properties)
Builds a Cache.
|
boolean |
isMinimalPutsEnabledByDefault()
Not sure what this is supposed to do.
|
long |
nextTimestamp()
Returns the next timestamp.
|
void |
start(Properties properties)
Callback to perform any necessary initialization of the underlying cache implementation
during SessionFactory construction.
|
void |
stop()
Callback to perform any necessary cleanup of the underlying cache implementation
during SessionFactory.close().
|
public static final String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
public final Cache buildCache(String name, Properties properties) throws CacheException
buildCache
in interface CacheProvider
name
- the name of the cache. Must match a cache configured in ehcache.xmlproperties
- not usedCacheException
- inter alia, if a cache of the same name already existspublic final long nextTimestamp()
nextTimestamp
in interface CacheProvider
public final void start(Properties properties) throws CacheException
start
in interface CacheProvider
properties
- current configuration settings.CacheException
public void stop()
stop
in interface CacheProvider
public final boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault
in interface CacheProvider
Copyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved