|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.cache.interceptor.NameMatchCacheOperationSource
public class NameMatchCacheOperationSource
Simple CacheOperationSource implementation that allows attributes to be matched
by registered name.
| Field Summary | |
|---|---|
protected static Log |
logger
Logger available to subclasses. |
| Constructor Summary | |
|---|---|
NameMatchCacheOperationSource()
|
|
| Method Summary | |
|---|---|
void |
addCacheMethod(String methodName,
Collection<CacheOperation> ops)
Add an attribute for a cacheable method. |
boolean |
equals(Object other)
|
Collection<CacheOperation> |
getCacheOperations(Method method,
Class<?> targetClass)
Return the collection of cache operations for this method, or null if the method contains no "cacheable" annotations. |
int |
hashCode()
|
protected boolean |
isMatch(String methodName,
String mappedName)
Return if the given method name matches the mapped name. |
void |
setNameMap(Map<String,Collection<CacheOperation>> nameMap)
Set a name/attribute map, consisting of method names (e.g. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Log logger
Static for optimal serialization.
| Constructor Detail |
|---|
public NameMatchCacheOperationSource()
| Method Detail |
|---|
public void setNameMap(Map<String,Collection<CacheOperation>> nameMap)
CacheOperation,
CacheOperationEditor
public void addCacheMethod(String methodName,
Collection<CacheOperation> ops)
Method names can be exact matches, or of the pattern "xxx*", "*xxx" or "*xxx*" for matching multiple methods.
methodName - the name of the methodops - operation associated with the method
public Collection<CacheOperation> getCacheOperations(Method method,
Class<?> targetClass)
CacheOperationSourcenull if the method contains no "cacheable" annotations.
getCacheOperations in interface CacheOperationSourcemethod - the method to introspecttargetClass - the target class (may be null,
in which case the declaring class of the method must be used)
null if
none found
protected boolean isMatch(String methodName,
String mappedName)
The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.
methodName - the method name of the classmappedName - the name in the descriptor
PatternMatchUtils.simpleMatch(String, String)public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||