|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kns.util.cache.MethodCacheNoCopyInterceptor
public class MethodCacheNoCopyInterceptor
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
Constructor Summary | |
---|---|
MethodCacheNoCopyInterceptor()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Checks if required attributes are provided. |
String |
buildCacheKey(String methodSignature,
Object[] argValues)
|
boolean |
containsCacheKey(String key)
|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation)
begin Kuali Foundation modification Caches method results, if possible. |
void |
removeCacheKey(String cacheKey)
Removes a method cache if one exists for the given key. |
void |
setCache(com.opensymphony.oscache.base.Cache cache)
begin Kuali Foundation modification |
void |
setExpirationTimeInSeconds(int expirationTimeInSeconds)
Entries older than this will have their contents replaced by the return value from a call to the appropriate method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodCacheNoCopyInterceptor()
Method Detail |
---|
public void setCache(com.opensymphony.oscache.base.Cache cache)
cache
- name of cache to be used
end Kuali Foundation modificationpublic void setExpirationTimeInSeconds(int expirationTimeInSeconds)
expirationTimeInSeconds
- public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
end Kuali Foundation modification
public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
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.
invoke
in interface org.aopalliance.intercept.MethodInterceptor
Throwable
end Kuali Foundation modification
public String buildCacheKey(String methodSignature, Object[] argValues)
className
- methodName
- paramTypes
- argValues
-
public boolean containsCacheKey(String key)
key
-
public void removeCacheKey(String cacheKey)
cacheKey
- - key for method signature and parameters - see buildCacheKey
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |