public class FinderCacheImpl extends Object implements FinderCache<ClassMapping,SelectExecutor,Result>
| Constructor and Description |
|---|
FinderCacheImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExclusionPattern(String pattern)
Adds a pattern for exclusion.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
cache(ClassMapping mapping,
SelectExecutor select,
FetchConfiguration fetch)
Cache a Finder Query for the given mapping and select.
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
get(ClassMapping mapping,
FetchConfiguration fetch)
Gets the finder query for the given mapping.
|
boolean |
getEnableStats() |
List<String> |
getExcludes()
Gets the excluded stringified keys.
|
Map<String,String> |
getMapView()
Get a map-oriented view of the cache.
|
QueryStatistics<ClassMapping> |
getStatistics()
Gets basic statistics of execution and hit count of finder queries.
|
boolean |
invalidate(ClassMapping mapping)
Remove the FinderQuery for the given key from this cache.
|
boolean |
isExcluded(ClassMapping mapping)
Affirms if the given mapping is excluded from being cached.
|
(package private) boolean |
isHinted(FetchConfiguration fetch,
String hint) |
(package private) void |
lock() |
FinderQuery<ClassMapping,SelectExecutor,Result> |
markUncachable(ClassMapping mapping)
Marks the given key as not amenable to caching.
|
FinderQuery<ClassMapping,SelectExecutor,Result> |
markUncachable(String id) |
(package private) boolean |
matches(String pattern,
ClassMapping mapping) |
(package private) boolean |
matches(String pattern,
String target) |
void |
removeExclusionPattern(String pattern)
Removes a pattern for exclusion.
|
(package private) ClassMapping |
searchMappingByName(String cls) |
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
void |
setEnableStats(boolean b) |
void |
setExcludes(String excludes) |
void |
startConfiguration()
Invoked before bean property configuration is begun on this object.
|
(package private) void |
unlock() |
public Map<String,String> getMapView()
getMapView in interface FinderCache<ClassMapping,SelectExecutor,Result>public QueryStatistics<ClassMapping> getStatistics()
getStatistics in interface FinderCache<ClassMapping,SelectExecutor,Result>public FinderQuery<ClassMapping,SelectExecutor,Result> get(ClassMapping mapping, FetchConfiguration fetch)
HINT_IGNORE_FINDER will ignore
any cached finder that may exist in this cache and will return null.
HINT_INVALIDATE_FINDER will
invalidate any cached finder that may exist in this cache and will return
null.get in interface FinderCache<ClassMapping,SelectExecutor,Result>mapping - for which the finder is looked uppublic FinderQuery<ClassMapping,SelectExecutor,Result> cache(ClassMapping mapping, SelectExecutor select, FetchConfiguration fetch)
cache in interface FinderCache<ClassMapping,SelectExecutor,Result>mapping - the class for which the finder is to be cachedselect - the finder queryfetch - may contain hints to control cache operationIf a entry for the given mapping exists then the value of
{@link QueryHints#HINT_RECACHE_FINDER HINT_RECACHE_FINDER} hint
determines whether the existing entry is returned or a new FinderQuery
with the given argument overwrites the existing one.public boolean isExcluded(ClassMapping mapping)
isExcluded in interface FinderCache<ClassMapping,SelectExecutor,Result>public void addExclusionPattern(String pattern)
addExclusionPattern in interface FinderCache<ClassMapping,SelectExecutor,Result>public void removeExclusionPattern(String pattern)
removeExclusionPattern in interface FinderCache<ClassMapping,SelectExecutor,Result>boolean matches(String pattern, ClassMapping mapping)
public boolean invalidate(ClassMapping mapping)
FinderCacheinvalidate in interface FinderCache<ClassMapping,SelectExecutor,Result>public FinderQuery<ClassMapping,SelectExecutor,Result> markUncachable(ClassMapping mapping)
FinderCachemarkUncachable in interface FinderCache<ClassMapping,SelectExecutor,Result>public FinderQuery<ClassMapping,SelectExecutor,Result> markUncachable(String id)
ClassMapping searchMappingByName(String cls)
public void setExcludes(String excludes)
public List<String> getExcludes()
FinderCachegetExcludes in interface FinderCache<ClassMapping,SelectExecutor,Result>boolean isHinted(FetchConfiguration fetch, String hint)
void lock()
void unlock()
public void setEnableStats(boolean b)
public boolean getEnableStats()
public void startConfiguration()
ConfigurablestartConfiguration in interface Configurablepublic void setConfiguration(Configuration conf)
ConfigurablesetConfiguration in interface Configurablepublic void endConfiguration()
ConfigurableendConfiguration in interface ConfigurableCopyright © 2006–2015 Apache Software Foundation. All rights reserved.