org.hibernate.engine.spi
Interface CacheImplementor

All Superinterfaces:
Cache, Serializable, Service
All Known Implementing Classes:
CacheImpl

public interface CacheImplementor
extends Service, Cache, Serializable

Define internal contact of Cache API


Method Summary
 void addCacheRegion(String name, Region region)
          Add Region to this Cache scope.
 void close()
          Close all cache regions.
 void evictQueries()
          Clean up the default QueryCache.
 Map<String,Region> getAllSecondLevelCacheRegions()
          Get all cache regions, including query cache.
 Region getNaturalIdCacheRegion(String regionName)
          Get natural id cache region by its name.
 QueryCache getQueryCache()
          Get the default QueryCache.
 QueryCache getQueryCache(String regionName)
          Get query cache by region name or create a new one if none exist.
 RegionFactory getRegionFactory()
           
 Region getSecondLevelCacheRegion(String regionName)
          Get second level cache region by its name.
 UpdateTimestampsCache getUpdateTimestampsCache()
          Get UpdateTimestampsCache instance managed by the SessionFactory.
 
Methods inherited from interface org.hibernate.Cache
containsCollection, containsEntity, containsEntity, containsQuery, evictCollection, evictCollectionRegion, evictCollectionRegions, evictDefaultQueryRegion, evictEntity, evictEntity, evictEntityRegion, evictEntityRegion, evictEntityRegions, evictNaturalIdRegion, evictNaturalIdRegion, evictNaturalIdRegions, evictQueryRegion, evictQueryRegions
 

Method Detail

close

void close()
Close all cache regions.


getQueryCache

QueryCache getQueryCache(String regionName)
                         throws HibernateException
Get query cache by region name or create a new one if none exist.

If the region name is null, then default query cache region will be returned.

Parameters:
regionName - Query cache region name.
Returns:
The QueryCache associated with the region name, or default query cache if the region name is null.
Throws:
HibernateException - HibernateException maybe thrown when the creation of new QueryCache instance.

getQueryCache

QueryCache getQueryCache()
Get the default QueryCache.


addCacheRegion

void addCacheRegion(String name,
                    Region region)
Add Region to this Cache scope.

Parameters:
name - The region name.
region - The Region instance.

getUpdateTimestampsCache

UpdateTimestampsCache getUpdateTimestampsCache()
Get UpdateTimestampsCache instance managed by the SessionFactory.


evictQueries

void evictQueries()
                  throws HibernateException
Clean up the default QueryCache.

Throws:
HibernateException

getSecondLevelCacheRegion

Region getSecondLevelCacheRegion(String regionName)
Get second level cache region by its name.

Parameters:
regionName - The region name.
Returns:
The second level cache region.

getNaturalIdCacheRegion

Region getNaturalIdCacheRegion(String regionName)
Get natural id cache region by its name.

Parameters:
regionName - The region name.
Returns:
The natural id cache region.

getAllSecondLevelCacheRegions

Map<String,Region> getAllSecondLevelCacheRegions()
Get all cache regions, including query cache.

Returns:
The map contains all cache regions with region name as the key.

getRegionFactory

RegionFactory getRegionFactory()
Returns:
The RegionFactory


Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.