|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.util.persistence.hibernate.EhCacheProvider
public class EhCacheProvider
Cache Provider plugin for ehcache-1.2. New in this provider are ehcache support for multiple Hibernate session factories, each with its own ehcache configuration, and non Serializable keys and values. 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=com.atlassian.crowd.util.persistence.hibernate.EhCacheProvider in the Hibernate configuration
to enable this provider for Hibernate's second level cache.
When configuring multiple ehcache CacheManagers, as you would where you have multiple Hibernate Configurations and
multiple SessionFactories, specify in each Hibernate configuration the ehcache configuration using
the property hibernate.cache.provider_configuration_file_resource_path An example to set an ehcache configuration
called ehcache-2.xml would be hibernate.cache.provider_configuration_file_resource_path=/ehcache-2.xml. If the leading
slash is not there one will be added. The configuration file will be looked for in the root of the classpath.
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
| Constructor Summary | |
|---|---|
EhCacheProvider(net.sf.ehcache.CacheManager cacheManager)
|
|
| Method Summary | |
|---|---|
org.hibernate.cache.Cache |
buildCache(java.lang.String name,
java.util.Properties properties)
Builds a Cache. |
boolean |
isMinimalPutsEnabledByDefault()
|
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 |
| Constructor Detail |
|---|
public EhCacheProvider(net.sf.ehcache.CacheManager cacheManager)
| Method Detail |
|---|
public org.hibernate.cache.Cache buildCache(java.lang.String name,
java.util.Properties properties)
throws org.hibernate.cache.CacheException
buildCache in interface org.hibernate.cache.CacheProvidername - 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 long nextTimestamp()
nextTimestamp in interface org.hibernate.cache.CacheProvider
public void start(java.util.Properties properties)
throws org.hibernate.cache.CacheException
start in interface org.hibernate.cache.CacheProviderproperties - current configuration settings.
org.hibernate.cache.CacheExceptionpublic void stop()
stop in interface org.hibernate.cache.CacheProviderpublic boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault in interface org.hibernate.cache.CacheProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||