|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.hibernate.SingletonEhCacheProvider
public final class SingletonEhCacheProvider
Singleton cache Provider plugin for Hibernate 3.2 and ehcache-1.2. New in this provider is support for non Serializable keys and values. This provider works as a Singleton. No matter how many Hibernate Configurations you have, only one ehcache CacheManager is used. See EhCacheProvider for a non-singleton implementation.
Ehcache-1.2 also has many other features such as cluster support and listeners, which can be used seamlessly simply by configurion in ehcache.xml. Usehibernate.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
Field Summary | |
---|---|
static java.lang.String |
NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
The Hibernate system property specifying the location of the ehcache configuration file name. |
Constructor Summary | |
---|---|
SingletonEhCacheProvider()
|
Method Summary | |
---|---|
org.hibernate.cache.Cache |
buildCache(java.lang.String name,
java.util.Properties properties)
Builds a Cache. |
boolean |
isMinimalPutsEnabledByDefault()
Not sure what this is supposed to do. |
long |
nextTimestamp()
Returns the next timestamp. |
void |
start(java.util.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(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
Constructor Detail |
---|
public SingletonEhCacheProvider()
Method Detail |
---|
public final org.hibernate.cache.Cache buildCache(java.lang.String name, java.util.Properties properties) throws org.hibernate.cache.CacheException
buildCache
in interface org.hibernate.cache.CacheProvider
name
- the name of the cache. Must match a cache configured in ehcache.xmlproperties
- not used
org.hibernate.cache.CacheException
- inter alia, if a cache of the same name already existspublic final long nextTimestamp()
nextTimestamp
in interface org.hibernate.cache.CacheProvider
public final void start(java.util.Properties properties) throws org.hibernate.cache.CacheException
start
in interface org.hibernate.cache.CacheProvider
properties
- current configuration settings.
org.hibernate.cache.CacheException
public void stop()
stop
in interface org.hibernate.cache.CacheProvider
public final boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault
in interface org.hibernate.cache.CacheProvider
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |