minor change and reformat partial code

This commit is contained in:
Strong Liu 2012-02-26 23:37:33 +08:00
parent 4e2d7d123d
commit 1278d12000
1 changed files with 17 additions and 11 deletions

View File

@ -1562,21 +1562,27 @@ public final class SessionFactoryImpl
}
public void evictQueryRegion(String regionName) {
if (regionName == null) throw new NullPointerException(
"Region-name cannot be null (use Cache#evictDefaultQueryRegion to evict the default query cache)");
if (settings.isQueryCacheEnabled()) {
QueryCache namedQueryCache = queryCaches.get(regionName);
// TODO : cleanup entries in queryCaches + allCacheRegions ?
if (namedQueryCache != null) namedQueryCache.clear();
if ( regionName == null ) {
throw new NullPointerException(
"Region-name cannot be null (use Cache#evictDefaultQueryRegion to evict the default query cache)"
);
}
if ( settings.isQueryCacheEnabled() ) {
QueryCache namedQueryCache = queryCaches.get( regionName );
// TODO : cleanup entries in queryCaches + allCacheRegions ?
if ( namedQueryCache != null ) {
namedQueryCache.clear();
}
}
}
public void evictQueryRegions() {
if ( queryCaches != null ) {
for ( QueryCache queryCache : queryCaches.values() ) {
queryCache.clear();
// TODO : cleanup entries in queryCaches + allCacheRegions ?
}
if ( CollectionHelper.isEmpty( queryCaches ) ) {
return;
}
for ( QueryCache queryCache : queryCaches.values() ) {
queryCache.clear();
// TODO : cleanup entries in queryCaches + allCacheRegions ?
}
}
}