org.onebusaway.container.cache
Class CacheableMethodKeyFactoryManager

java.lang.Object
  extended by org.onebusaway.container.cache.CacheableMethodKeyFactoryManager

@Component
public class CacheableMethodKeyFactoryManager
extends Object

Support class that determines the caching policy for a particular method by producing a CacheableMethodKeyFactory for that method. We make use of Cacheable, CacheableArgument, and CacheableKey annotations to allow customization of the default key factory behavior, as well as directly setting behavior using methods such as setCacheKeyFactories(Map) and putCacheRefreshIndicatorArgumentIndexForMethod(Method, int).

Author:
bdferris
See Also:
CacheableMethodKeyFactory, Cacheable, CacheableArgument, CacheableKey

Constructor Summary
CacheableMethodKeyFactoryManager()
           
 
Method Summary
 void addCacheableObjectKeyFactory(Class<?> className, CacheableObjectKeyFactory keyFactory)
           
protected  net.sf.ehcache.Cache createCache(org.aspectj.lang.ProceedingJoinPoint pjp, String name)
           
protected  CacheableArgument getCacheableArgumentAnnotation(Annotation[] annotations)
          Private Methods
 CacheableMethodKeyFactory getCacheableMethodKeyFactoryForJoinPoint(org.aspectj.lang.ProceedingJoinPoint pjp, Method method)
           
 CacheableMethodKeyFactory getCacheableMethodKeyFactoryForMethod(Method m)
           
protected  CacheableObjectKeyFactory getKeyFactoryForCacheableArgumentAnnotation(Class<?> type, CacheableArgument cacheableArgumentAnnotation, boolean cacheRefreshIndicator)
           
protected  CacheableObjectKeyFactory getKeyFactoryForParameterType(Class<?> type, boolean cacheRefreshIndicator)
           
 Method getMatchingMethodForJoinPoint(org.aspectj.lang.ProceedingJoinPoint pjp)
           
 List<Method> getMatchingMethodsForJoinPoint(org.aspectj.lang.ProceedingJoinPoint pjp)
           
 void putCacheRefreshIndicatorArgumentIndexForMethod(Method method, int argumentIndex)
           
 void putCacheRefreshIndicatorArgumentIndexForMethodSignature(String methodName, int argumentIndex)
           
 void setCacheKeyFactories(Map<Object,Object> keyFactories)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheableMethodKeyFactoryManager

public CacheableMethodKeyFactoryManager()
Method Detail

addCacheableObjectKeyFactory

public void addCacheableObjectKeyFactory(Class<?> className,
                                         CacheableObjectKeyFactory keyFactory)

setCacheKeyFactories

public void setCacheKeyFactories(Map<Object,Object> keyFactories)

putCacheRefreshIndicatorArgumentIndexForMethodSignature

public void putCacheRefreshIndicatorArgumentIndexForMethodSignature(String methodName,
                                                                    int argumentIndex)

putCacheRefreshIndicatorArgumentIndexForMethod

public void putCacheRefreshIndicatorArgumentIndexForMethod(Method method,
                                                           int argumentIndex)

getCacheableMethodKeyFactoryForJoinPoint

public CacheableMethodKeyFactory getCacheableMethodKeyFactoryForJoinPoint(org.aspectj.lang.ProceedingJoinPoint pjp,
                                                                          Method method)

getCacheableMethodKeyFactoryForMethod

public CacheableMethodKeyFactory getCacheableMethodKeyFactoryForMethod(Method m)

getMatchingMethodForJoinPoint

public Method getMatchingMethodForJoinPoint(org.aspectj.lang.ProceedingJoinPoint pjp)

getMatchingMethodsForJoinPoint

public List<Method> getMatchingMethodsForJoinPoint(org.aspectj.lang.ProceedingJoinPoint pjp)

getCacheableArgumentAnnotation

protected CacheableArgument getCacheableArgumentAnnotation(Annotation[] annotations)
Private Methods


getKeyFactoryForCacheableArgumentAnnotation

protected CacheableObjectKeyFactory getKeyFactoryForCacheableArgumentAnnotation(Class<?> type,
                                                                                CacheableArgument cacheableArgumentAnnotation,
                                                                                boolean cacheRefreshIndicator)

getKeyFactoryForParameterType

protected CacheableObjectKeyFactory getKeyFactoryForParameterType(Class<?> type,
                                                                  boolean cacheRefreshIndicator)

createCache

protected net.sf.ehcache.Cache createCache(org.aspectj.lang.ProceedingJoinPoint pjp,
                                           String name)


Copyright © 2011 OneBusAway. All Rights Reserved.