|
Spring Framework | ||||||||
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 org.apache.commons.logging.Log |
logger
Logger available to subclasses. |
Constructor Summary | |
---|---|
NameMatchCacheOperationSource()
|
Method Summary | |
---|---|
void |
addCacheMethod(java.lang.String methodName,
java.util.Collection<CacheOperation> ops)
Add an attribute for a cacheable method. |
boolean |
equals(java.lang.Object other)
|
java.util.Collection<CacheOperation> |
getCacheOperations(java.lang.reflect.Method method,
java.lang.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(java.lang.String methodName,
java.lang.String mappedName)
Return if the given method name matches the mapped name. |
void |
setNameMap(java.util.Map<java.lang.String,java.util.Collection<CacheOperation>> nameMap)
Set a name/attribute map, consisting of method names (e.g. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log logger
Static for optimal serialization.
Constructor Detail |
---|
public NameMatchCacheOperationSource()
Method Detail |
---|
public void setNameMap(java.util.Map<java.lang.String,java.util.Collection<CacheOperation>> nameMap)
CacheOperation
public void addCacheMethod(java.lang.String methodName, java.util.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 methodpublic java.util.Collection<CacheOperation> getCacheOperations(java.lang.reflect.Method method, java.lang.Class<?> targetClass)
CacheOperationSource
null
if the method contains no cacheable annotations.
getCacheOperations
in interface CacheOperationSource
method
- 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 foundprotected boolean isMatch(java.lang.String methodName, java.lang.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(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
Spring Framework | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |