Class CacheAspectSupport.CacheOperationContext
- java.lang.Object
- org.springframework.cache.interceptor.CacheAspectSupport.CacheOperationContext
- All Implemented Interfaces:
CacheOperationInvocationContext<CacheOperation>
- Enclosing class:
- CacheAspectSupport
protected class CacheAspectSupport.CacheOperationContext extends Object implements CacheOperationInvocationContext<CacheOperation>
ACacheOperationInvocationContext
context for aCacheOperation
.
Constructor Summary
Constructors Constructor Description CacheOperationContext(CacheAspectSupport.CacheOperationMetadata metadata, Object[] args, Object target)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canPutToCache(Object value)
protected Object
generateKey(Object result)
Compute the key for the given caching operation.Object[]
getArgs()
Return the argument list used to invoke the method.protected Collection<String>
getCacheNames()
protected Collection<? extends Cache>
getCaches()
Method
getMethod()
Return the method which was invoked.CacheOperation
getOperation()
Return the cache operation.Object
getTarget()
Return the target instance on which the method was invoked.protected boolean
isConditionPassing(Object result)
Constructor Detail
CacheOperationContext
public CacheOperationContext(CacheAspectSupport.CacheOperationMetadata metadata, Object[] args, Object target)
Method Detail
getOperation
public CacheOperation getOperation()
Description copied from interface:CacheOperationInvocationContext
Return the cache operation.- Specified by:
getOperation
in interfaceCacheOperationInvocationContext<CacheOperation>
getTarget
public Object getTarget()
Description copied from interface:CacheOperationInvocationContext
Return the target instance on which the method was invoked.- Specified by:
getTarget
in interfaceCacheOperationInvocationContext<CacheOperation>
getMethod
public Method getMethod()
Description copied from interface:CacheOperationInvocationContext
Return the method which was invoked.- Specified by:
getMethod
in interfaceCacheOperationInvocationContext<CacheOperation>
getArgs
public Object[] getArgs()
Description copied from interface:CacheOperationInvocationContext
Return the argument list used to invoke the method.- Specified by:
getArgs
in interfaceCacheOperationInvocationContext<CacheOperation>
isConditionPassing
protected boolean isConditionPassing(Object result)
canPutToCache
protected boolean canPutToCache(Object value)
generateKey
protected Object generateKey(Object result)
Compute the key for the given caching operation.- Returns:
- the generated key, or
null
if none can be generated
getCaches
protected Collection<? extends Cache> getCaches()
getCacheNames
protected Collection<String> getCacheNames()