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>
ACacheOperationInvocationContextcontext 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 booleancanPutToCache(Object value)protected ObjectgenerateKey(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()MethodgetMethod()Return the method which was invoked.CacheOperationgetOperation()Return the cache operation.ObjectgetTarget()Return the target instance on which the method was invoked.protected booleanisConditionPassing(Object result)
Constructor Detail
CacheOperationContext
public CacheOperationContext(CacheAspectSupport.CacheOperationMetadata metadata, Object[] args, Object target)
Method Detail
getOperation
public CacheOperation getOperation()
Description copied from interface:CacheOperationInvocationContextReturn the cache operation.- Specified by:
getOperationin interfaceCacheOperationInvocationContext<CacheOperation>
getTarget
public Object getTarget()
Description copied from interface:CacheOperationInvocationContextReturn the target instance on which the method was invoked.- Specified by:
getTargetin interfaceCacheOperationInvocationContext<CacheOperation>
getMethod
public Method getMethod()
Description copied from interface:CacheOperationInvocationContextReturn the method which was invoked.- Specified by:
getMethodin interfaceCacheOperationInvocationContext<CacheOperation>
getArgs
public Object[] getArgs()
Description copied from interface:CacheOperationInvocationContextReturn the argument list used to invoke the method.- Specified by:
getArgsin 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
nullif none can be generated
getCaches
protected Collection<? extends Cache> getCaches()
getCacheNames
protected Collection<String> getCacheNames()