CacheOperationSource implementation that allows attributes to be matched
by registered name.
| Modifier and Type | Field and Description |
|---|---|
| protected static final Log | logger
Logger available to subclasses. |
| private final Map | nameMap
Keys are method names; values are TransactionAttributes. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCacheMethod(String
the name of the method methodName, Collection<CacheOperation> operation associated with the method ops)Add an attribute for a cacheable method. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public Collection | getCacheOperations(Method
the method to introspect method, Class<?> the target class (may be targetClass)null, in which case
the declaring class of the method must be used)Implements org. Return the collection of cache operations for this method,
or |
| public int | |
| protected boolean | |
| public void | setNameMap(Map<String, Collection<CacheOperation>> nameMap)
Set a name/attribute map, consisting of method names (e.g. "myMethod") and CacheOperation instances (or Strings to be converted to CacheOperation instances). |
| public String |
| logger | back to summary |
|---|---|
| protected static final Log logger Logger available to subclasses. Static for optimal serialization. | |
| nameMap | back to summary |
|---|---|
| private final Map<String, Collection<CacheOperation>> nameMap Keys are method names; values are TransactionAttributes. | |
| NameMatchCacheOperationSource | back to summary |
|---|---|
| public NameMatchCacheOperationSource() | |
| addCacheMethod | back to summary |
|---|---|
| public void addCacheMethod(String methodName, Collection<CacheOperation> ops) Add an attribute for a cacheable method. Method names can be exact matches, or of the pattern "xxx*", "*xxx" or "*xxx*" for matching multiple methods.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCacheOperations | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Return the collection of cache operations for this method,
or
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isMatch | back to summary |
|---|---|
| protected boolean isMatch(String methodName, String mappedName) Return if the given method name matches the mapped name. The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.
| |
| setNameMap | back to summary |
|---|---|
| public void setNameMap(Map<String, Collection<CacheOperation>> nameMap) Set a name/attribute map, consisting of method names (e.g. "myMethod") and CacheOperation instances (or Strings to be converted to CacheOperation instances).
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |