com.googlecode.ehcache.annotations.config
Class AnnotationDrivenEhCacheBeanDefinitionParser

java.lang.Object
  extended by com.googlecode.ehcache.annotations.config.AnnotationDrivenEhCacheBeanDefinitionParser
All Implemented Interfaces:
org.springframework.beans.factory.xml.BeanDefinitionParser

public class AnnotationDrivenEhCacheBeanDefinitionParser
extends java.lang.Object
implements org.springframework.beans.factory.xml.BeanDefinitionParser

BeanDefinitionParser that sets up DefaultBeanFactoryPointcutAdvisor instances to wrap EhCacheInterceptors around Cacheables and TriggersRemove advised methods.

Version:
$Id: AnnotationDrivenEhCacheBeanDefinitionParser.java 656 2011-04-21 19:54:27Z eric.dalquist@gmail.com $
Author:
Nicholas Blair

Field Summary
static java.lang.String XSD_ATTR__CACHE_MANAGER
           
static java.lang.String XSD_ATTR__CREATE_MISSING_CACHES
           
static java.lang.String XSD_ATTR__DEFAULT_CACHE_KEY_GENERATOR
           
static java.lang.String XSD_ATTR__DEFAULT_CACHE_RESOLVER_FACTORY
           
static java.lang.String XSD_ATTR__DEFAULT_CACHEABLE_INTECEPTOR
           
static java.lang.String XSD_ATTR__DEFAULT_TRIGGERS_REMOVE_INTECEPTOR
           
static java.lang.String XSD_ATTR__EXECUTOR
           
static java.lang.String XSD_ATTR__SCHEDULER
           
static java.lang.String XSD_ATTR__SELF_POPULATING_CACHE_SCOPE
           
 
Constructor Summary
AnnotationDrivenEhCacheBeanDefinitionParser()
           
 
Method Summary
 org.springframework.beans.factory.config.BeanDefinition parse(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
           
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupCacheAttributeSource(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
          Create a CacheAttributeSource bean that will be used by the advisor and interceptor
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupCachingReflectionHelper(org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
           
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultCacheableInterceptor(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
          Setup the default cache interceptor
protected  void setupDefaultCacheKeyGenerator(java.lang.Class<? extends CacheKeyGenerator<? extends java.io.Serializable>> generatorClass, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
          Utility API used to setup each of the default CacheKeyGenerator implementations.
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultCacheKeyGenerators(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
          Setup the default cache key generator.
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultCacheResolverFactory(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
          Setup the default cache resolver factory
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultTriggersRemoveInterceptor(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource)
          Setup the default cache interceptor
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupInterceptor(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource, org.springframework.beans.factory.config.RuntimeBeanReference cacheableAttributeSourceRuntimeReference)
          Create MethodInterceptor that is applies the caching logic to advised methods.
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupPointcut(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource, org.springframework.beans.factory.config.RuntimeBeanReference cacheAttributeSource)
          Create the Pointcut used to apply the caching interceptor
protected  org.springframework.beans.factory.config.RuntimeBeanReference setupPointcutAdvisor(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.Object elementSource, org.springframework.beans.factory.config.RuntimeBeanReference cacheablePointcutBeanReference, org.springframework.beans.factory.config.RuntimeBeanReference cachingInterceptorBeanReference)
          Create PointcutAdvisor that puts the Pointcut and MethodInterceptor together.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XSD_ATTR__CREATE_MISSING_CACHES

public static final java.lang.String XSD_ATTR__CREATE_MISSING_CACHES
See Also:
Constant Field Values

XSD_ATTR__CACHE_MANAGER

public static final java.lang.String XSD_ATTR__CACHE_MANAGER
See Also:
Constant Field Values

XSD_ATTR__DEFAULT_CACHE_KEY_GENERATOR

public static final java.lang.String XSD_ATTR__DEFAULT_CACHE_KEY_GENERATOR
See Also:
Constant Field Values

XSD_ATTR__DEFAULT_CACHE_RESOLVER_FACTORY

public static final java.lang.String XSD_ATTR__DEFAULT_CACHE_RESOLVER_FACTORY
See Also:
Constant Field Values

XSD_ATTR__DEFAULT_CACHEABLE_INTECEPTOR

public static final java.lang.String XSD_ATTR__DEFAULT_CACHEABLE_INTECEPTOR
See Also:
Constant Field Values

XSD_ATTR__DEFAULT_TRIGGERS_REMOVE_INTECEPTOR

public static final java.lang.String XSD_ATTR__DEFAULT_TRIGGERS_REMOVE_INTECEPTOR
See Also:
Constant Field Values

XSD_ATTR__SELF_POPULATING_CACHE_SCOPE

public static final java.lang.String XSD_ATTR__SELF_POPULATING_CACHE_SCOPE
See Also:
Constant Field Values

XSD_ATTR__SCHEDULER

public static final java.lang.String XSD_ATTR__SCHEDULER
See Also:
Constant Field Values

XSD_ATTR__EXECUTOR

public static final java.lang.String XSD_ATTR__EXECUTOR
See Also:
Constant Field Values
Constructor Detail

AnnotationDrivenEhCacheBeanDefinitionParser

public AnnotationDrivenEhCacheBeanDefinitionParser()
Method Detail

parse

public org.springframework.beans.factory.config.BeanDefinition parse(org.w3c.dom.Element element,
                                                                     org.springframework.beans.factory.xml.ParserContext parserContext)
Specified by:
parse in interface org.springframework.beans.factory.xml.BeanDefinitionParser

setupCachingReflectionHelper

protected org.springframework.beans.factory.config.RuntimeBeanReference setupCachingReflectionHelper(org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                     java.lang.Object elementSource)

setupDefaultCacheResolverFactory

protected org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultCacheResolverFactory(org.w3c.dom.Element element,
                                                                                                         org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                         java.lang.Object elementSource)
Setup the default cache resolver factory

Returns:
A reference to the default cache resolver factory.

setupDefaultCacheableInterceptor

protected org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultCacheableInterceptor(org.w3c.dom.Element element,
                                                                                                         org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                         java.lang.Object elementSource)
Setup the default cache interceptor

Returns:
A reference to the default cache interceptor.

setupDefaultTriggersRemoveInterceptor

protected org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultTriggersRemoveInterceptor(org.w3c.dom.Element element,
                                                                                                              org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                              java.lang.Object elementSource)
Setup the default cache interceptor

Returns:
A reference to the default cache interceptor.

setupDefaultCacheKeyGenerators

protected org.springframework.beans.factory.config.RuntimeBeanReference setupDefaultCacheKeyGenerators(org.w3c.dom.Element element,
                                                                                                       org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                       java.lang.Object elementSource)
Setup the default cache key generator.

Returns:
A reference to the default cache key generator. Should never be null.

setupDefaultCacheKeyGenerator

protected final void setupDefaultCacheKeyGenerator(java.lang.Class<? extends CacheKeyGenerator<? extends java.io.Serializable>> generatorClass,
                                                   org.springframework.beans.factory.xml.ParserContext parserContext,
                                                   java.lang.Object elementSource)
Utility API used to setup each of the default CacheKeyGenerator implementations. Requires that the class has a static String field named DEFAULT_BEAN_NAME declared that is used for the bean name.


setupCacheAttributeSource

protected org.springframework.beans.factory.config.RuntimeBeanReference setupCacheAttributeSource(org.w3c.dom.Element element,
                                                                                                  org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                  java.lang.Object elementSource)
Create a CacheAttributeSource bean that will be used by the advisor and interceptor

Returns:
Reference to the CacheAttributeSource. Should never be null.

setupPointcut

protected org.springframework.beans.factory.config.RuntimeBeanReference setupPointcut(org.w3c.dom.Element element,
                                                                                      org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                      java.lang.Object elementSource,
                                                                                      org.springframework.beans.factory.config.RuntimeBeanReference cacheAttributeSource)
Create the Pointcut used to apply the caching interceptor

Returns:
Reference to the Pointcut. Should never be null.

setupInterceptor

protected org.springframework.beans.factory.config.RuntimeBeanReference setupInterceptor(org.w3c.dom.Element element,
                                                                                         org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                         java.lang.Object elementSource,
                                                                                         org.springframework.beans.factory.config.RuntimeBeanReference cacheableAttributeSourceRuntimeReference)
Create MethodInterceptor that is applies the caching logic to advised methods.

Returns:
Reference to the MethodInterceptor. Should never be null.

setupPointcutAdvisor

protected org.springframework.beans.factory.config.RuntimeBeanReference setupPointcutAdvisor(org.w3c.dom.Element element,
                                                                                             org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                             java.lang.Object elementSource,
                                                                                             org.springframework.beans.factory.config.RuntimeBeanReference cacheablePointcutBeanReference,
                                                                                             org.springframework.beans.factory.config.RuntimeBeanReference cachingInterceptorBeanReference)
Create PointcutAdvisor that puts the Pointcut and MethodInterceptor together.

Returns:
Reference to the PointcutAdvisor. Should never be null.


Copyright © 2011. All Rights Reserved.