Deprecated
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.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.org for documentation on ehcache
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private final ProviderMBeanRegistrationHelper | |
| public static final String | NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
The Hibernate system property specifying the location of the ehcache configuration file name. |
| private static int | referenceCount
To be backwardly compatible with a lot of Hibernate code out there, allow multiple starts and stops on the one singleton CacheManager. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | start(Properties
current configuration settings. properties)Implements org. |
| public void | stop()
Implements org. |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| mbeanRegistrationHelper | back to summary |
|---|---|
| private final ProviderMBeanRegistrationHelper mbeanRegistrationHelper | |
| NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME | back to summary |
|---|---|
| public static final String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME The Hibernate system property specifying the location of the ehcache configuration file name. If not set, ehcache.xml will be looked for in the root of the classpath. If set to say ehcache-1.xml, ehcache-1.xml will be looked for in the root of the classpath. | |
| referenceCount | back to summary |
|---|---|
| private static int referenceCount To be backwardly compatible with a lot of Hibernate code out there, allow multiple starts and stops on the one singleton CacheManager. Keep a count of references to only stop on when only one reference is held. | |
| SingletonEhCacheProvider | back to summary |
|---|---|
| public SingletonEhCacheProvider() | |
| start | back to summary |
|---|---|
| public final void start(Properties properties) throws CacheException Implements org. Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory construction.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close(). | |