Top Description Fields Constructors Methods
net.sf.ehcache.hibernate

pack-priv abstract Class AbstractEhcacheProvider

extends Object
implements CacheProvider
Class Inheritance
All Implemented Interfaces
org.hibernate.cache.CacheProvider
Known Direct Subclasses
net.sf.ehcache.hibernate.EhCacheProvider, net.sf.ehcache.hibernate.SingletonEhCacheProvider
Imports
java.net.URL, java.util.Properties, net.sf.ehcache.CacheManager, net.sf.ehcache.util.Timestamper, org.hibernate.cache.Cache, .CacheException, .CacheProvider, org.slf4j.Logger, .LoggerFactory

Deprecated

as a consequence of CacheProvider being deprecated. See corresponding docs for further information.

Abstract super-class for all Ehcache Hibernate CacheProvider implementations.
Authors
Chris Dennis, Greg Luck, Emmanuel Bernard

Field Summary

Modifier and TypeField and Description
private static final Logger
protected volatile CacheManager
manager

CacheManager instance that creates/builds Cache instances for this provider.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final Cache

Returns:

a newly built cache will be built and initialised
buildCache
(String
the name of the cache. Must match a cache configured in ehcache.xml
name
,
Properties
not used
properties
)

Implements org.hibernate.cache.CacheProvider.buildCache.

Deprecated as a consequence of Cache being deprecated.
Builds a Cache.
public final boolean

Returns:

true, optimize for minimal puts
isMinimalPutsEnabledByDefault
()

Implements org.hibernate.cache.CacheProvider.isMinimalPutsEnabledByDefault.

Whether to optimize for minimals puts or minimal gets.
protected URL
loadResource(String configurationResourceName)

Load the supplied resource from the classpath.

public final long
nextTimestamp()

Implements org.hibernate.cache.CacheProvider.nextTimestamp.

Returns the next timestamp.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG
managerback to summary
protected volatile CacheManager manager

CacheManager instance that creates/builds Cache instances for this provider.

Constructor Detail

AbstractEhcacheProviderback to summary
pack-priv AbstractEhcacheProvider()

Method Detail

buildCacheback to summary
public final Cache buildCache(String name, Properties properties) throws CacheException

Implements org.hibernate.cache.CacheProvider.buildCache.

Deprecated

as a consequence of Cache being deprecated. See corresponding docs for further information.

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:String

the name of the cache. Must match a cache configured in ehcache.xml

properties:Properties

not used

Returns:Cache

a newly built cache will be built and initialised

Exceptions
CacheException:
inter alia, if a cache of the same name already exists
isMinimalPutsEnabledByDefaultback to summary
public final boolean isMinimalPutsEnabledByDefault()

Implements org.hibernate.cache.CacheProvider.isMinimalPutsEnabledByDefault.

Whether to optimize for minimals puts or minimal gets.

Indicates whether when operating in non-strict read/write or read-only mode Hibernate should optimize the access patterns for minimal puts or minimal gets. In Ehcache we default to minimal puts since this should have minimal to no affect on unclustered users, and has great benefit for clustered users.

This setting can be overridden by setting the "hibernate.cache.use_minimal_puts" property in the Hibernate configuration.

Returns:boolean

true, optimize for minimal puts

loadResourceback to summary
protected URL loadResource(String configurationResourceName)

Load the supplied resource from the classpath.

nextTimestampback to summary
public final long nextTimestamp()

Implements org.hibernate.cache.CacheProvider.nextTimestamp.

Returns the next timestamp.