Package org.hibernate.cache

This package defines APIs/SPIs and implementations for the Hibernate second-level cache.

See:
          Description

Interface Summary
Cache Deprecated. As of 3.3; see for details.
CacheConcurrencyStrategy Deprecated. As of 3.3; see for details.
CacheDataDescription Describes attributes regarding the type of data to be cached.
CacheProvider Deprecated. As of 3.3; see for details.
CollectionRegion Defines the contract for a cache region which will specifically be used to store collection data.
EntityRegion Defines the contract for a cache region which will specifically be used to store entity data.
GeneralDataRegion Contract for general-purpose cache regions.
OptimisticCache A contract for transactional cache implementations which support optimistic locking of items within the cache.
OptimisticCacheSource Contract for sources of optimistically lockable data sent to the second level cache.
QueryCache Defines the contract for caches capable of storing query results.
QueryCacheFactory Defines a factory for query cache instances.
QueryResultsRegion Defines the contract for a cache region which will specifically be used to store query results.
ReadWriteCache.Lockable  
Region Defines a contract for accessing a particular named region within the underlying cache implementation.
RegionFactory Contract for building second level cache regions.
TimestampsRegion Defines the contract for a cache region which will specifically be used to store entity "update timestamps".
TransactionalDataRegion Defines contract for regions which hold transactionally-managed data.
TransactionAwareCache Marker interface for identifying cache impls which are aware of JTA transactions
 

Class Summary
AbstractJndiBoundCacheProvider Support for CacheProvider implementations which are backed by caches bound into JNDI namespace.
CacheKey Allows multiple entity classes / collection roles to be stored in the same cache region.
EhCache EHCache plugin for Hibernate

EHCache uses a net.sf.ehcache.store.MemoryStore and a net.sf.ehcache.store.DiskStore.

EhCacheProvider Cache Provider plugin for ehcache-1.2.
FilterKey Allows cached queries to be keyed by enabled filters.
HashtableCache A lightweight implementation of the Cache interface
HashtableCacheProvider A simple in-memory Hashtable-based cache impl.
JndiBoundTreeCacheProvider Support for JBossCache (TreeCache), where the cache instance is available via JNDI lookup.
NoCacheProvider Implementation of NoCacheProvider.
NonstrictReadWriteCache Caches data that is sometimes updated without ever locking the cache.
OptimisticTreeCache Represents a particular region within the given JBossCache TreeCache utilizing TreeCache's optimistic locking capabilities.
OptimisticTreeCache.CircumventChecksDataVersion Used to signal to a DataVersionAdapter to simply not perform any checks.
OptimisticTreeCache.DataVersionAdapter  
OptimisticTreeCache.NonLockingDataVersion Used in regions where no locking should ever occur.
OptimisticTreeCacheProvider Support for a standalone JBossCache TreeCache instance utilizing TreeCache's optimistic locking capabilities.
OSCache  
OSCacheProvider Support for OpenSymphony OSCache.
QueryKey A key that identifies a particular query with bound parameter values.
ReadOnlyCache Caches data that is never updated.
ReadWriteCache Caches data that is sometimes updated while maintaining the semantics of "read committed" isolation level.
ReadWriteCache.Item An item of cached data, timestamped with the time it was cached,.
ReadWriteCache.Lock A soft lock which supports concurrent locking, timestamped with the time it was released
SingletonEhCacheProvider Singleton cache Provider plugin for Hibernate 3.2 and ehcache-1.2.
StandardQueryCache The standard implementation of the Hibernate QueryCache interface.
StandardQueryCacheFactory Standard Hibernate implementation of the QueryCacheFactory interface.
SwarmCache  
SwarmCacheProvider Support for SwarmCache replicated cache.
Timestamper Generates increasing identifiers (in a single VM only).
TransactionalCache Support for fully transactional cache implementations like JBoss TreeCache.
TreeCache Represents a particular region within the given JBossCache TreeCache.
TreeCacheProvider Support for a standalone JBossCache (TreeCache) instance.
UpdateTimestampsCache Tracks the timestamps of the most recent updates to particular tables.
 

Exception Summary
CacheException Something went wrong in the cache
NoCachingEnabledException Implementation of NoCachingEnabledException.
 

Package org.hibernate.cache Description

This package defines APIs/SPIs and implementations for the Hibernate second-level cache.

The legacy (and now deprecated) approach to caching is defined by the CacheProvider and Cache interfaces as well as the CacheConcurrencyStrategy interface along with the various implementations of all these interfaces. In that scheme, a CacheProvider defined how to configure and perform lifecycle operations in regards to a particular underlying caching library; it also defined how to build Cache instances which in turn defined how to access the "regions" of the underlying cache instance. For entity and collection data cache regions, CacheConcurrencyStrategy wrapped access to those cache regions to apply transactional/concurrent access semantics.

The improved approach is based on RegionFactory, the various Region specializations and the two access strategies contracts (EntityRegionAccessStrategy and CollectionRegionAccessStrategy). The general approach here is that RegionFactory defined how to configure and perform lifecycle operations in regards to a particular underlying caching library (or libraries). RegionFactory also defines how to build specialized Region instances based on the type of data we will be storing in that given region. The fact that RegionFactory is asked to build specialized regions (as opposed to just general access) is the first improvement over the legacy scheme. The second improvement is the fact that the regions (well the ones like entity and collection regions that are responsible for storing transactional data) are asked to build their own access strategies (see EntityRegion.buildAccessStrategy(org.hibernate.cache.access.AccessType) and CollectionRegion.buildAccessStrategy(org.hibernate.cache.access.AccessType)).



Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved