|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl
public class CacheAttributeSourceImpl
Provides logic for determining if a class + method are advised and to then setup the data needed for the advice.
| Field Summary | |
|---|---|
protected org.slf4j.Logger |
logger
Logger available to subclasses. |
| Constructor Summary | |
|---|---|
CacheAttributeSourceImpl()
|
|
| Method Summary | ||
|---|---|---|
void |
afterPropertiesSet()
|
|
protected boolean |
allowPublicMethodsOnly()
Should only public methods be allowed to be advised? |
|
AdviceType |
getAdviceType(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
Determines if the method has should be cached or involved with cache entry removal. |
|
CacheableAttribute |
getCacheableAttribute(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
Gets the runtime caching information for a method. |
|
protected CacheableInterceptor |
getCacheInterceptor(java.lang.String cacheableInteceptorName)
Get the CacheableInterceptor by name. |
|
protected CacheKeyGenerator<? extends java.io.Serializable> |
getCacheKeyGenerator(java.lang.String keyGeneratorName,
KeyGenerator keyGenerator)
Get the CacheKeyGenerator by name. |
|
protected net.sf.ehcache.CacheManager |
getCacheManager()
|
|
protected CacheResolverFactory |
getCacheResolverFactory(java.lang.String resolverFactoryName,
ResolverFactory resolverFactory)
Get the CacheResolverFactory by name. |
|
protected CacheKeyGenerator<? extends java.io.Serializable> |
getOrCreateCacheKeyGenerator(KeyGenerator keyGenerator)
|
|
protected CacheResolverFactory |
getOrCreateCacheResolverFactory(ResolverFactory resolverFactory)
|
|
protected
|
getOrCreateChildBean(java.lang.Class<T> beanType,
java.lang.String beanClass,
Property[] properties)
|
|
TriggersRemoveAttribute |
getTriggersRemoveAttribute(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
Gets the runtime triggers-remove information for a method. |
|
protected TriggersRemoveInterceptor |
getTriggersRemoveInterceptor(java.lang.String triggersRemoveInterceptorName)
Get the TriggersRemoveInterceptor by name. |
|
protected CacheableAttribute |
parseCacheableAnnotation(Cacheable ann,
java.lang.reflect.Method method,
ParameterMask parameterMask)
Construct a CacheableAttribute from a Cacheable annotation. |
|
protected ParameterMask |
parsePartialCacheKeyAnnotations(java.lang.reflect.Method method)
Parse the parameters annotated with PartialCacheKey. |
|
protected TriggersRemoveAttribute |
parseTriggersRemoveAnnotation(TriggersRemove ann,
java.lang.reflect.Method method,
ParameterMask parameterMask)
Construct a TriggersRemoveAttribute from a TriggersRemove annotation. |
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
|
void |
setCacheManager(net.sf.ehcache.CacheManager cacheManager)
|
|
void |
setCacheResolverFactory(CacheResolverFactory cacheResolverFactory)
|
|
void |
setCreateCaches(boolean createCaches)
|
|
void |
setDefaultCacheableInterceptor(CacheableInterceptor defaultCacheableInterceptor)
|
|
void |
setDefaultCacheKeyGenerator(CacheKeyGenerator<? extends java.io.Serializable> defaultCacheKeyGenerator)
|
|
void |
setDefaultTriggersRemoveInterceptor(TriggersRemoveInterceptor defaultTriggersRemoveInterceptor)
|
|
void |
setExecutor(org.springframework.scheduling.SchedulingTaskExecutor executor)
|
|
void |
setReflectionHelper(ReflectionHelper reflectionHelper)
|
|
void |
setScheduler(java.lang.Object scheduler)
|
|
void |
setSelfPopulatingCacheScope(SelfPopulatingCacheScope selfPopulatingCacheScope)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
public CacheAttributeSourceImpl()
| Method Detail |
|---|
public void setScheduler(java.lang.Object scheduler)
public void setExecutor(org.springframework.scheduling.SchedulingTaskExecutor executor)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic void setCreateCaches(boolean createCaches)
public void setDefaultCacheKeyGenerator(CacheKeyGenerator<? extends java.io.Serializable> defaultCacheKeyGenerator)
public void setDefaultCacheableInterceptor(CacheableInterceptor defaultCacheableInterceptor)
public void setDefaultTriggersRemoveInterceptor(TriggersRemoveInterceptor defaultTriggersRemoveInterceptor)
public void setSelfPopulatingCacheScope(SelfPopulatingCacheScope selfPopulatingCacheScope)
public void setCacheManager(net.sf.ehcache.CacheManager cacheManager)
public void setReflectionHelper(ReflectionHelper reflectionHelper)
public void setCacheResolverFactory(CacheResolverFactory cacheResolverFactory)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
public AdviceType getAdviceType(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
CacheAttributeSourceAdviceType.NONE if the
method doesn't participate with either.
getAdviceType in interface CacheAttributeSourcemethod - The method to inspecttargetClass - The class the method exists on
AdviceType.NONE if the method is not advised. Will never return null.
public CacheableAttribute getCacheableAttribute(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
CacheAttributeSource
getCacheableAttribute in interface CacheAttributeSourcemethod - The method to inspecttargetClass - The class the method exists on
public TriggersRemoveAttribute getTriggersRemoveAttribute(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
CacheAttributeSource
getTriggersRemoveAttribute in interface CacheAttributeSourcemethod - The method to inspecttargetClass - The class the method exists on
protected boolean allowPublicMethodsOnly()
The default implementation returns false.
protected net.sf.ehcache.CacheManager getCacheManager()
protected ParameterMask parsePartialCacheKeyAnnotations(java.lang.reflect.Method method)
PartialCacheKey.
method - The method who's parameters should be checked.
protected CacheableAttribute parseCacheableAnnotation(Cacheable ann,
java.lang.reflect.Method method,
ParameterMask parameterMask)
CacheableAttribute from a Cacheable annotation.
ann - The annotation to build the attributes from
protected TriggersRemoveAttribute parseTriggersRemoveAnnotation(TriggersRemove ann,
java.lang.reflect.Method method,
ParameterMask parameterMask)
TriggersRemoveAttribute from a TriggersRemove annotation.
ann - The annotation to build the attributes from
protected final CacheableInterceptor getCacheInterceptor(java.lang.String cacheableInteceptorName)
CacheableInterceptor by name. Returning a default resolver factory if the name is empty or null
resolverFactoryName - Name of the resolver factory to retrieve
protected final TriggersRemoveInterceptor getTriggersRemoveInterceptor(java.lang.String triggersRemoveInterceptorName)
TriggersRemoveInterceptor by name. Returning a default resolver factory if the name is empty or null
resolverFactoryName - Name of the resolver factory to retrieve
protected final CacheResolverFactory getCacheResolverFactory(java.lang.String resolverFactoryName,
ResolverFactory resolverFactory)
CacheResolverFactory by name. Returning a default resolver factory if the name is empty or null
resolverFactoryName - Name of the resolver factory to retrieve
protected final CacheKeyGenerator<? extends java.io.Serializable> getCacheKeyGenerator(java.lang.String keyGeneratorName,
KeyGenerator keyGenerator)
CacheKeyGenerator by name. Returning a default generator if the name is empty or null
keyGeneratorName - Name of the generator to retrieve
protected final CacheKeyGenerator<? extends java.io.Serializable> getOrCreateCacheKeyGenerator(KeyGenerator keyGenerator)
protected final CacheResolverFactory getOrCreateCacheResolverFactory(ResolverFactory resolverFactory)
protected final <T> T getOrCreateChildBean(java.lang.Class<T> beanType,
java.lang.String beanClass,
Property[] properties)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||