@Override public NaturalIdCacheStatistics getNaturalIdCacheStatistics(String regionName) { ConcurrentNaturalIdCacheStatisticsImpl nics = (ConcurrentNaturalIdCacheStatisticsImpl) naturalIdCacheStatistics.get( regionName ); if ( nics == null ) { if ( sessionFactory == null ) { return null; } Region region = sessionFactory.getNaturalIdCacheRegion( regionName ); if ( region == null ) { return null; } nics = new ConcurrentNaturalIdCacheStatisticsImpl( region ); ConcurrentNaturalIdCacheStatisticsImpl previous; if ( ( previous = (ConcurrentNaturalIdCacheStatisticsImpl) naturalIdCacheStatistics.putIfAbsent( regionName, nics ) ) != null ) { nics = previous; } } return nics; }
/** * Second level cache statistics per region * * @param regionName region name * * @return SecondLevelCacheStatistics */ public SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName) { ConcurrentSecondLevelCacheStatisticsImpl slcs = (ConcurrentSecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.get( regionName ); if ( slcs == null ) { if ( sessionFactory == null ) { return null; } Region region = sessionFactory.getSecondLevelCacheRegion( regionName ); if ( region == null ) { return null; } slcs = new ConcurrentSecondLevelCacheStatisticsImpl( region ); ConcurrentSecondLevelCacheStatisticsImpl previous; if ( ( previous = (ConcurrentSecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.putIfAbsent( regionName, slcs ) ) != null ) { slcs = previous; } } return slcs; }
public Region getSecondLevelCacheRegion(String regionName) { return sessionFactoryImplementor.getSecondLevelCacheRegion(regionName); }
public Region getNaturalIdCacheRegion(String regionName) { return sessionFactoryImplementor.getNaturalIdCacheRegion(regionName); }
ConcurrentSecondLevelCacheStatisticsImpl(Region region) { super( region.getName() ); this.region = region; }
ConcurrentNaturalIdCacheStatisticsImpl(Region region) { super( region.getName() ); this.region = region; }
@Override public void addCacheRegion(String name, Region region) { allCacheRegions.put( name, region ); }
@Override public Region getSecondLevelCacheRegion(String regionName) { return allCacheRegions.get( regionName ); }
@Override public Region getNaturalIdCacheRegion(String regionName) { return allCacheRegions.get( regionName ); }
@SuppressWarnings({ "unchecked" }) @Override public Map<String, Region> getAllSecondLevelCacheRegions() { return new HashMap<String,Region>( allCacheRegions ); }
public Region getSecondLevelCacheRegion(String regionName) { return cacheAccess.getSecondLevelCacheRegion( regionName ); }
public Region getNaturalIdCacheRegion(String regionName) { return cacheAccess.getNaturalIdCacheRegion( regionName ); }
public Region getSecondLevelCacheRegion(String regionName) { return cacheAccess.getSecondLevelCacheRegion(regionName); }
public Region getNaturalIdCacheRegion(String regionName) { return cacheAccess.getNaturalIdCacheRegion(regionName); }
/** * Get a named second-level cache region * * @param regionName The name of the region to retrieve. * @return The region */ public Region getSecondLevelCacheRegion(String regionName);
/** * Get a named naturalId cache region * * @param regionName The name of the region to retrieve. * @return The region */ public Region getNaturalIdCacheRegion(String regionName);
/** * Add {@code Region} to this Cache scope. * * @param name The region name. * @param region The {@code Region} instance. */ public void addCacheRegion(String name, Region region);
/** * Get second level cache region by its name. * * @param regionName The region name. * @return The second level cache region. */ public Region getSecondLevelCacheRegion(String regionName);
/** * Get natural id cache region by its name. * * @param regionName The region name. * @return The natural id cache region. */ public Region getNaturalIdCacheRegion(String regionName);
/** * Get <tt>all</tt> cache regions, including query cache. * * @return The map contains all cache regions with region name as the key. */ public Map<String, Region> getAllSecondLevelCacheRegions();