| |
|
| java.lang.Object net.sf.ehcache.hibernate.EhCacheProvider
EhCacheProvider | final public class EhCacheProvider implements CacheProvider(Code) | | Cache Provider plugin for Hibernate 3.2 and 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.
Use hibernate.cache.provider_class=net.sf.ehcache.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 net.sf.ehcache.configurationResourceName An example to set an ehcach configuration
called ehcache-2.xml would be net.sf.ehcache.configurationResourceName=/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
author: Greg Luck author: Emmanuel Bernard version: $Id: EhCacheProvider.java 519 2007-07-27 07:11:45Z gregluck $ |
Method Summary | |
final public Cache | buildCache(String name, Properties properties) Builds a Cache.
Even though this method provides properties, they are not used.
Properties for EHCache are specified in the ehcache.xml file.
Configuration will be read from ehcache.xml for a cache declaration
where the name attribute matches the name parameter in this builder.
Parameters: name - the name of the cache. | final public boolean | isMinimalPutsEnabledByDefault() Not sure what this is supposed to do. | final public long | nextTimestamp() Returns the next timestamp. | final public void | start(Properties properties) Callback to perform any necessary initialization of the underlying cache implementation
during SessionFactory construction. | final public void | stop() Callback to perform any necessary cleanup of the underlying cache implementation
during SessionFactory.close(). |
NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME | final public static String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME(Code) | | The Hibernate system property specifying the location of the ehcache configuration file name.
If set to say ehcache-1.xml, ehcache-1.xml will be looked for in the root of the classpath.
|
buildCache | final public Cache buildCache(String name, Properties properties) throws CacheException(Code) | | Builds a Cache.
Even though this method provides properties, they are not used.
Properties for EHCache are specified in the ehcache.xml file.
Configuration will be read from ehcache.xml for a cache declaration
where the name attribute matches the name parameter in this builder.
Parameters: name - the name of the cache. Must match a cache configured in ehcache.xml Parameters: properties - not used a newly built cache will be built and initialised throws: org.hibernate.cache.CacheException - inter alia, if a cache of the same name already exists |
isMinimalPutsEnabledByDefault | final public boolean isMinimalPutsEnabledByDefault()(Code) | | Not sure what this is supposed to do.
false to be safe |
nextTimestamp | final public long nextTimestamp()(Code) | | Returns the next timestamp.
|
start | final public void start(Properties properties) throws CacheException(Code) | | Callback to perform any necessary initialization of the underlying cache implementation
during SessionFactory construction.
Parameters: properties - current configuration settings. |
stop | final public void stop()(Code) | | Callback to perform any necessary cleanup of the underlying cache implementation
during SessionFactory.close().
|
|
|
|