public abstract class AbstractL2CacheOperationSource extends Object implements L2CacheOperationSource
| 限定符和类型 | 字段和说明 |
|---|---|
private Map<Object,Collection<L2CacheOperation>> |
attributeCache
Cache of CacheOperations, keyed by method on a specific target class.
|
private static Collection<L2CacheOperation> |
NULL_CACHING_ATTRIBUTE
Canonical value held in cache to indicate no caching attribute was
found for this method and we don't need to look again.
|
| 构造器和说明 |
|---|
AbstractL2CacheOperationSource() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
allowPublicMethodsOnly() |
private Collection<L2CacheOperation> |
computeCacheOperations(Method method,
Class<?> targetClass) |
protected abstract Collection<L2CacheOperation> |
findCacheOperations(Class<?> clazz)
Subclasses need to implement this to return the caching attribute for the
given class, if any.
|
protected abstract Collection<L2CacheOperation> |
findCacheOperations(Method method)
Subclasses need to implement this to return the caching attribute for the
given method, if any.
|
protected Object |
getCacheKey(Method method,
Class<?> targetClass)
Determine a cache key for the given method and target class.
|
Collection<L2CacheOperation> |
getCacheOperations(Method method,
Class<?> targetClass)
Determine the caching attribute for this method invocation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisCandidateClassprivate static final Collection<L2CacheOperation> NULL_CACHING_ATTRIBUTE
private final Map<Object,Collection<L2CacheOperation>> attributeCache
As this base class is not marked Serializable, the cache will be recreated after serialization - provided that the concrete subclass is Serializable.
@Nullable public Collection<L2CacheOperation> getCacheOperations(Method method, @Nullable Class<?> targetClass)
Defaults to the class's caching attribute if no method attribute is found.
getCacheOperations 在接口中 L2CacheOperationSourcemethod - the method for the current invocation (never null)targetClass - the target class for this invocation (may be null)L2CacheOperation for this method, or null if the method
is not cacheableprotected Object getCacheKey(Method method, @Nullable Class<?> targetClass)
Must not produce same key for overloaded methods. Must produce same key for different instances of the same method.
method - the method (never null)targetClass - the target class (may be null)null)@Nullable private Collection<L2CacheOperation> computeCacheOperations(Method method, @Nullable Class<?> targetClass)
protected boolean allowPublicMethodsOnly()
@Nullable protected abstract Collection<L2CacheOperation> findCacheOperations(Class<?> clazz)
clazz - the class to retrieve the attribute fornull if none@Nullable protected abstract Collection<L2CacheOperation> findCacheOperations(Method method)
method - the method to retrieve the attribute fornull if noneCopyright © 2023. All rights reserved.