| java.lang.Object org.kuali.core.util.cache.MethodCacheInterceptor
MethodCacheInterceptor | public class MethodCacheInterceptor implements MethodInterceptor,InitializingBean(Code) | | begin Kuali Foundation modification
This class implements org.aopalliance.intercept.MethodInterceptor. This interceptor builds the cache key for the method and
checks if an earlier result was cached with that key. If so, the cached result is returned; otherwise, the intercepted method is
called and the result cached for future use.
end Kuali Foundation modification
author: Kuali Rice Team (kuali-rice@googlegroups.com) since: 2004.10.07 |
afterPropertiesSet | public void afterPropertiesSet() throws Exception(Code) | | Checks if required attributes are provided.
begin Kuali Foundation modification
See Also: org.springframework.beans.factory.InitializingBean.afterPropertiesSet See Also: end Kuali Foundation modification |
buildCacheKey | public String buildCacheKey(String methodSignature, Object[] argValues)(Code) | | Parameters: className - Parameters: methodName - Parameters: paramTypes - Parameters: argValues - cache key: className.methodName(paramClass=argValue[,paramClass=argValue...]) |
containsCacheKey | public boolean containsCacheKey(String key)(Code) | | Parameters: key - true if the cache contains an entry with the given key |
invoke | public Object invoke(MethodInvocation invocation) throws Throwable(Code) | | begin Kuali Foundation modification
Caches method results, if possible.
Results must be Serializable to be cached. Method with unSerializable results will never have their results cached, and will
log error messages complaining about that fact.
See Also: org.aopalliance.intercept.MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation) See Also: end Kuali Foundation modification |
removeCacheKey | public void removeCacheKey(String cacheKey)(Code) | | Removes a method cache if one exists for the given key.
Parameters: cacheKey - - key for method signature and parameters - see buildCacheKey |
setCache | public void setCache(Cache cache)(Code) | | begin Kuali Foundation modification
Parameters: cache - name of cache to be usedend Kuali Foundation modification |
setExpirationTimeInSeconds | public void setExpirationTimeInSeconds(int expirationTimeInSeconds)(Code) | | Entries older than this will have their contents replaced by the return value from a call to the appropriate method
Parameters: expirationTimeInSeconds - |
setMaxEntrySizeInBytes | public void setMaxEntrySizeInBytes(long maxEntrySizeInBytes)(Code) | | Entries whose size is larger than the current value will not be cached. If the maxEntrySizeInBytes <= 0, no size limit will
be applied.
Parameters: maxEntrySizeInBytes - |
|
|