public class SingletonEhCacheProvider extends Object implements org.hibernate.cache.CacheProvider
Custom EhCacheProvider which ensures that the correct disk store path is used and the cache manager can be shared between Hibernate and Communote.
Additionally this provider defines a mapping from an Hibernate cache region to the actual EhCache. This mapping was included to circumvent some shortcomings of the default behavior which would map each cache region to a distinctive EhCache. Especially in clustered environments this is not desired since EhCache creates additional threads for each cache to manage change distributions.Parts of the implementation are taken from net.sf.ehcache.hibernate.SingletonEhCacheProvider
Constructor and Description |
---|
SingletonEhCacheProvider()
Create a new provider and prepare the region mapping.
|
Modifier and Type | Method and Description |
---|---|
org.hibernate.cache.Cache |
buildCache(String name,
Properties properties) |
boolean |
isMinimalPutsEnabledByDefault() |
long |
nextTimestamp() |
void |
start(Properties properties) |
void |
stop() |
public SingletonEhCacheProvider()
public org.hibernate.cache.Cache buildCache(String name, Properties properties) throws org.hibernate.cache.CacheException
buildCache
in interface org.hibernate.cache.CacheProvider
org.hibernate.cache.CacheException
public boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault
in interface org.hibernate.cache.CacheProvider
public long nextTimestamp()
nextTimestamp
in interface org.hibernate.cache.CacheProvider
public void start(Properties properties) throws org.hibernate.cache.CacheException
start
in interface org.hibernate.cache.CacheProvider
org.hibernate.cache.CacheException
public void stop()
stop
in interface org.hibernate.cache.CacheProvider
Copyright © 2019 Communote team. All rights reserved.