com.schlimm.springcdi.interceptor.model
Class InterceptorInfo

java.lang.Object
  extended by com.schlimm.springcdi.interceptor.model.InterceptorInfo
Direct Known Subclasses:
MethodInterceptorInfo

public abstract class InterceptorInfo
extends Object

Model bean that stores all relevant interceptor information. One bean per interceptor defined in the bean factory. Subclasses can implement logic specific to BeanDefinition type, such as AnnotatedBeanDefinition or GenericBeanDefinition. Also subclasses can implement logic specific to JSR 318 interceptor types, such as method interceptors or time out interceptors.

Author:
Niklas Schlimm

Field Summary
protected  org.springframework.core.type.AnnotationMetadata annotationMetadata
          Annotation meta data for this interceptor
protected  org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder
          Bean definition of this interceptor
protected  List<String> classLevelInterceptions
          Name of the beans where this interceptor is defined on the class level
protected  List<Method> interceptedMethods
          All methods where this interceptor is defined on the method level
static Class<? extends Annotation> interceptorAnnotationType
           
static Class<? extends Annotation> interceptorBindingAnnotationType
           
 
Constructor Summary
InterceptorInfo()
           
 
Method Summary
 void addClassLevelInterception(String beanName)
           
 void addInterceptedBean(String beanName)
           
 void addInterceptedMethod(Method method)
           
 Map<String,Object> getAnnotationAttributes(String annotationType)
           
 org.springframework.core.type.AnnotationMetadata getAnnotationMetadata()
           
 org.springframework.beans.factory.config.BeanDefinitionHolder getBeanDefinitionHolder()
           
 List<String> getClassLevelInterceptions()
           
 Set<String> getInterceptedBeans()
           
 List<Method> getInterceptedMethods()
           
 List<String> getInterceptorBindings()
           
 Set<Method> getInterceptorMethods()
           
 boolean isInterceptingBean(String beanName)
          Check if the given bean is intercepted by this interceptor
static boolean isInterceptor(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition abd)
           
 boolean matches(String beanName, Method givenMethod)
          Check is this interceptor intercepts the bean on the class level or on the method level.
protected  void resolveInterceptorBindings()
           
protected abstract  void resolveInterceptorMethods()
          Subclasses can implement custom logic to resolve interceptor methods on this interceptor
 void setBeanDefinitionHolder(org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder)
           
 void setClassLevelInterceptions(List<String> classLevelInterceptions)
           
 void setInterceptedBeans(Set<String> interceptedBeans)
           
 void setInterceptorMethods(Set<Method> interceptorMethods)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

interceptorAnnotationType

public static Class<? extends Annotation> interceptorAnnotationType

interceptorBindingAnnotationType

public static Class<? extends Annotation> interceptorBindingAnnotationType

beanDefinitionHolder

protected org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder
Bean definition of this interceptor


annotationMetadata

protected org.springframework.core.type.AnnotationMetadata annotationMetadata
Annotation meta data for this interceptor


classLevelInterceptions

protected List<String> classLevelInterceptions
Name of the beans where this interceptor is defined on the class level


interceptedMethods

protected List<Method> interceptedMethods
All methods where this interceptor is defined on the method level

Constructor Detail

InterceptorInfo

public InterceptorInfo()
Method Detail

isInterceptor

public static boolean isInterceptor(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition abd)

resolveInterceptorBindings

protected void resolveInterceptorBindings()

isInterceptingBean

public boolean isInterceptingBean(String beanName)
Check if the given bean is intercepted by this interceptor

Parameters:
beanName - name of the bean in the factory
Returns:
true, if this interceptor intercepts the bean

matches

public boolean matches(String beanName,
                       Method givenMethod)
Check is this interceptor intercepts the bean on the class level or on the method level.

Parameters:
beanName - name of the bean
givenMethod - method that may be intercepted
Returns:
true if this interceptor intercepts the (whole) bean or the method

resolveInterceptorMethods

protected abstract void resolveInterceptorMethods()
Subclasses can implement custom logic to resolve interceptor methods on this interceptor


getBeanDefinitionHolder

public org.springframework.beans.factory.config.BeanDefinitionHolder getBeanDefinitionHolder()

setBeanDefinitionHolder

public void setBeanDefinitionHolder(org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder)

getAnnotationMetadata

public org.springframework.core.type.AnnotationMetadata getAnnotationMetadata()

getInterceptorBindings

public List<String> getInterceptorBindings()

setInterceptedBeans

public void setInterceptedBeans(Set<String> interceptedBeans)

getInterceptedBeans

public Set<String> getInterceptedBeans()

addInterceptedBean

public void addInterceptedBean(String beanName)

setClassLevelInterceptions

public void setClassLevelInterceptions(List<String> classLevelInterceptions)

getClassLevelInterceptions

public List<String> getClassLevelInterceptions()

addClassLevelInterception

public void addClassLevelInterception(String beanName)

addInterceptedMethod

public void addInterceptedMethod(Method method)

getInterceptedMethods

public List<Method> getInterceptedMethods()

setInterceptorMethods

public void setInterceptorMethods(Set<Method> interceptorMethods)

getInterceptorMethods

public Set<Method> getInterceptorMethods()

toString

public String toString()
Overrides:
toString in class Object

getAnnotationAttributes

public Map<String,Object> getAnnotationAttributes(String annotationType)


Copyright © 2011. All Rights Reserved.