org.apache.webbeans.intercept
Class InterceptorUtil

java.lang.Object
  extended by org.apache.webbeans.intercept.InterceptorUtil

public final class InterceptorUtil
extends Object


Constructor Summary
InterceptorUtil(WebBeansContext webBeansContext)
           
 
Method Summary
 Object callAroundInvokes(WebBeansContext webBeansContext, InjectionTargetBean<?> bean, Object instance, CreationalContextImpl<?> creationalContext, Method proceed, Object[] arguments, List<InterceptorData> stack, javax.interceptor.InvocationContext ejbInvocationContext, Object altKey)
           
<T> void
checkAnnotatedTypeInterceptorConditions(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
           
 boolean checkGivenClassIsInInterceptorList(Class<?> mainClass, Class<?> candidateClass)
          Return true if given candidate is listed in interceptors list.
 boolean checkInInterceptorHierarchy(Class<?> interceptorClass, Class<?> candidateClass)
          Return true if candidate class is a super class of given interceptor class.
 void checkInterceptorConditions(javax.enterprise.inject.spi.AnnotatedType annotatedType)
           
<T> void
checkLifecycleConditions(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, Annotation[] annots, String errorMessage)
           
<T> void
checkLifecycleConditions(Class<T> clazz, Annotation[] annots, String errorMessage)
           
 void checkSimpleWebBeansInterceptorConditions(Class<?> clazz)
           
 void filterCommonInterceptorStackList(List<InterceptorData> stack, Method method)
          Filter bean interceptor stack.
 void filterOverridenAroundInvokeInterceptor(Class<?> beanClass, List<InterceptorData> stack)
          If an AroundInvoke method is overridden by another method (regardless of whether that method is itself an AroundInvoke method), it will not be invoked.
 void filterOverridenLifecycleInterceptor(Class<?> beanClass, List<InterceptorData> stack)
          Remove bean inherited and overriden lifecycle interceptor method from its stack list.
 Class<? extends Annotation> getInterceptorAnnotationClazz(javax.enterprise.inject.spi.InterceptionType type)
           
 List<InterceptorData> getInterceptorMethods(List<InterceptorData> stack, InterceptorType type)
          Gets list of interceptors with the given type.
<T> boolean
isBusinessMethodInterceptor(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
           
 boolean isBusinessMethodInterceptor(Class<?> clazz)
           
<T> boolean
isLifecycleMethodInterceptor(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
           
 boolean isLifecycleMethodInterceptor(Class<?> clazz)
           
 boolean isWebBeansBusinessMethod(Method method)
          Check if the given method is a 'business method' in the sense of the Interceptor specification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterceptorUtil

public InterceptorUtil(WebBeansContext webBeansContext)
Method Detail

isWebBeansBusinessMethod

public boolean isWebBeansBusinessMethod(Method method)
Check if the given method is a 'business method' in the sense of the Interceptor specification

Parameters:
method -
Returns:
true if the given method is an interceptable business method

getInterceptorAnnotationClazz

public Class<? extends Annotation> getInterceptorAnnotationClazz(javax.enterprise.inject.spi.InterceptionType type)

isBusinessMethodInterceptor

public <T> boolean isBusinessMethodInterceptor(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)

isBusinessMethodInterceptor

public boolean isBusinessMethodInterceptor(Class<?> clazz)

isLifecycleMethodInterceptor

public boolean isLifecycleMethodInterceptor(Class<?> clazz)

isLifecycleMethodInterceptor

public <T> boolean isLifecycleMethodInterceptor(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)

checkAnnotatedTypeInterceptorConditions

public <T> void checkAnnotatedTypeInterceptorConditions(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)

checkInterceptorConditions

public void checkInterceptorConditions(javax.enterprise.inject.spi.AnnotatedType annotatedType)

checkLifecycleConditions

public <T> void checkLifecycleConditions(Class<T> clazz,
                                         Annotation[] annots,
                                         String errorMessage)
Parameters:
clazz - AUTSCH! we should use the AnnotatedType for all that stuff!

checkLifecycleConditions

public <T> void checkLifecycleConditions(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                                         Annotation[] annots,
                                         String errorMessage)

checkSimpleWebBeansInterceptorConditions

public void checkSimpleWebBeansInterceptorConditions(Class<?> clazz)

getInterceptorMethods

public List<InterceptorData> getInterceptorMethods(List<InterceptorData> stack,
                                                   InterceptorType type)
Gets list of interceptors with the given type.

Parameters:
stack - interceptor stack
type - interceptor type
Returns:
list of interceptor

filterCommonInterceptorStackList

public void filterCommonInterceptorStackList(List<InterceptorData> stack,
                                             Method method)
Filter bean interceptor stack.

Parameters:
stack - interceptor stack
method - called method on proxy

callAroundInvokes

public Object callAroundInvokes(WebBeansContext webBeansContext,
                                InjectionTargetBean<?> bean,
                                Object instance,
                                CreationalContextImpl<?> creationalContext,
                                Method proceed,
                                Object[] arguments,
                                List<InterceptorData> stack,
                                javax.interceptor.InvocationContext ejbInvocationContext,
                                Object altKey)
                         throws Exception
Throws:
Exception

checkInInterceptorHierarchy

public boolean checkInInterceptorHierarchy(Class<?> interceptorClass,
                                           Class<?> candidateClass)
Return true if candidate class is a super class of given interceptor class.

Parameters:
interceptorClass - interceptor class
candidateClass - candaite class
Returns:
true if candidate class is a super class of given interceptor class

filterOverridenLifecycleInterceptor

public void filterOverridenLifecycleInterceptor(Class<?> beanClass,
                                                List<InterceptorData> stack)
Remove bean inherited and overriden lifecycle interceptor method from its stack list.

Parameters:
beanClass - bean class
stack - bean interceptor stack

filterOverridenAroundInvokeInterceptor

public void filterOverridenAroundInvokeInterceptor(Class<?> beanClass,
                                                   List<InterceptorData> stack)
If an AroundInvoke method is overridden by another method (regardless of whether that method is itself an AroundInvoke method), it will not be invoked. Remove bean inherited but overriden around invoke interceptor method from its stack list.

Parameters:
beanClass - bean class
stack - bean interceptor stack

checkGivenClassIsInInterceptorList

public boolean checkGivenClassIsInInterceptorList(Class<?> mainClass,
                                                  Class<?> candidateClass)
Return true if given candidate is listed in interceptors list.

Parameters:
mainClass - bean class
candidateClass - interceptor candidate class
Returns:
true if given candidate is listed in interceptors list


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.