org.lexevs.cache
Class AbstractMethodCachingBean<T>

java.lang.Object
  extended by org.lexevs.cache.AbstractMethodCachingBean<T>
Direct Known Subclasses:
MethodCachingInterceptor, MethodCachingProxy

public abstract class AbstractMethodCachingBean<T>
extends java.lang.Object

The Class MethodCachingProxy.

Author:
Kevin Peterson

Constructor Summary
AbstractMethodCachingBean()
           
 
Method Summary
 void clearAll()
           
protected  java.lang.Object clearCache(T joinPoint, java.lang.reflect.Method method)
          Clear cache.
protected  java.lang.Object doCacheMethod(T joinPoint)
          Cache method.
protected  java.lang.String getArgumentKey(java.lang.Object argument)
           
protected  java.lang.String getArgumentKey(java.lang.Object argument, ParameterKey key)
           
protected abstract  java.lang.Object[] getArguments(T joinPoint)
           
 CacheRegistry.CacheWrapper<java.lang.String,java.lang.Object> getCacheFromName(java.lang.String cacheName, boolean createIfNotPresent)
           
 CacheRegistry getCacheRegistry()
           
protected  java.util.Map<java.lang.String,CacheRegistry.CacheWrapper<java.lang.String,java.lang.Object>> getCaches()
           
protected  java.lang.String getKeyFromMethod(java.lang.String className, java.lang.String signature, java.lang.Object[] arguments, java.lang.annotation.Annotation[][] parameterAnnotations)
          Gets the key from method.
 LgLoggerIF getLogger()
          Gets the logger.
protected abstract  java.lang.reflect.Method getMethod(T joinPoint)
           
 SystemVariables getSystemVariables()
           
protected abstract  java.lang.Object getTarget(T joinPoint)
           
protected abstract  java.lang.Object proceed(T joinPoint)
           
 void setCacheRegistry(CacheRegistry cacheRegistry)
           
 void setLogger(LgLoggerIF logger)
          Sets the logger.
 void setSystemVariables(SystemVariables systemVariables)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMethodCachingBean

public AbstractMethodCachingBean()
Method Detail

clearCache

protected java.lang.Object clearCache(T joinPoint,
                                      java.lang.reflect.Method method)
                               throws java.lang.Throwable
Clear cache.

Parameters:
pjp - the pjp
Returns:
the object
Throws:
java.lang.Throwable - the throwable

clearAll

public void clearAll()

doCacheMethod

protected java.lang.Object doCacheMethod(T joinPoint)
                                  throws java.lang.Throwable
Cache method.

Parameters:
pjp - the pjp
Returns:
the object
Throws:
java.lang.Throwable - the throwable

getMethod

protected abstract java.lang.reflect.Method getMethod(T joinPoint)

getTarget

protected abstract java.lang.Object getTarget(T joinPoint)

proceed

protected abstract java.lang.Object proceed(T joinPoint)
                                     throws java.lang.Throwable
Throws:
java.lang.Throwable

getArguments

protected abstract java.lang.Object[] getArguments(T joinPoint)

getCacheFromName

public CacheRegistry.CacheWrapper<java.lang.String,java.lang.Object> getCacheFromName(java.lang.String cacheName,
                                                                                      boolean createIfNotPresent)

getKeyFromMethod

protected java.lang.String getKeyFromMethod(java.lang.String className,
                                            java.lang.String signature,
                                            java.lang.Object[] arguments,
                                            java.lang.annotation.Annotation[][] parameterAnnotations)
Gets the key from method.

Parameters:
className - the class name
signature - the signature
arguments - the arguments
parameterAnnotations -
Returns:
the key from method

getArgumentKey

protected java.lang.String getArgumentKey(java.lang.Object argument,
                                          ParameterKey key)

getArgumentKey

protected java.lang.String getArgumentKey(java.lang.Object argument)

getCaches

protected java.util.Map<java.lang.String,CacheRegistry.CacheWrapper<java.lang.String,java.lang.Object>> getCaches()

getLogger

public LgLoggerIF getLogger()
Gets the logger.

Returns:
the logger

setLogger

public void setLogger(LgLoggerIF logger)
Sets the logger.

Parameters:
logger - the new logger

getSystemVariables

public SystemVariables getSystemVariables()

setSystemVariables

public void setSystemVariables(SystemVariables systemVariables)

setCacheRegistry

public void setCacheRegistry(CacheRegistry cacheRegistry)

getCacheRegistry

public CacheRegistry getCacheRegistry()

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.