Author: struberg
Date: Tue Dec 27 18:30:00 2011
New Revision: 1224972
URL: http://svn.apache.org/viewvc?rev=1224972&view=rev
Log:
OWB-634 parse EJB-Interceptors information via AnnotatedType
previously this has been determined by manually doing Class reflection,
which didn't allow to tweak those settings via CDI Extensions
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/ejb/EjbInterceptorTest.java
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Tue Dec 27 18:30:00 2011
@@ -324,6 +324,11 @@ public abstract class AbstractOwbBean<T>
/**
* Get return types of the bean.
+ * As per section 11.1 it is defined as
+ * "returns the bean class of the managed bean or session bean or of
the bean
+ * that declares the producer method or field."
+ * Which means in case of a producer field or method, we need to return
the class
+ * where the producer field/method is defined in.
*/
public Class<?> getBeanClass()
{
@@ -478,9 +483,11 @@ public abstract class AbstractOwbBean<T>
}
/**
- * Gets type of the producer method.
+ * Gets type of the producer method/field or the bean class if it's not a
producer.
+ * This basically determines the class which will get created.
*
* @return type of the producer method
+ * @see #getBeanClass()
*/
public Class<T> getReturnType()
{
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Tue Dec 27 18:30:00 2011
@@ -48,7 +48,6 @@ import org.apache.webbeans.component.Int
import org.apache.webbeans.component.ManagedBean;
import org.apache.webbeans.component.NewBean;
import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.component.WebBeansType;
import org.apache.webbeans.component.creation.BeanCreator.MetaDataProvider;
import org.apache.webbeans.component.creation.ManagedBeanCreatorImpl;
import org.apache.webbeans.container.BeanManagerImpl;
@@ -809,7 +808,7 @@ public class BeansDeployer
webBeansContext.getManagedBeanConfigurator().checkManagedBeanCondition(clazz);
//Temporary managed bean instance creationa
- ManagedBean<T> managedBean = new
ManagedBean<T>(clazz,WebBeansType.MANAGED, webBeansContext);
+ ManagedBean<T> managedBean = new ManagedBean<T>(clazz,
webBeansContext);
ManagedBeanCreatorImpl<T> managedBeanCreator = new
ManagedBeanCreatorImpl<T>(managedBean);
boolean annotationTypeSet = false;
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Tue Dec 27 18:30:00 2011
@@ -1135,16 +1135,21 @@ public final class DefinitionUtil
return;
}
+ AnnotatedType<?> annotatedType;
+
// If bean is not session bean
if(!(bean instanceof EnterpriseBeanMarker))
{
-
bean.getWebBeansContext().getEJBInterceptorConfig().configure(((AbstractOwbBean)bean).getReturnType(),
bean.getInterceptorStack());
+ annotatedType =
webBeansContext.getAnnotatedElementFactory().getAnnotatedType(bean.getReturnType());
+
+
bean.getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
bean.getInterceptorStack());
}
else
{
//Check for injected fields in EJB @Interceptors
List<InterceptorData> stack = new ArrayList<InterceptorData>();
-
bean.getWebBeansContext().getEJBInterceptorConfig().configure(bean.getBeanClass(),
stack);
+ annotatedType =
webBeansContext.getAnnotatedElementFactory().getAnnotatedType(bean.getBeanClass());
+
bean.getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
stack);
final OpenWebBeansEjbPlugin ejbPlugin =
bean.getWebBeansContext().getPluginLoader().getEjbPlugin();
final boolean isStateful =
ejbPlugin.isStatefulBean(bean.getBeanClass());
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java
Tue Dec 27 18:30:00 2011
@@ -21,19 +21,20 @@ package org.apache.webbeans.intercept.ej
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
import javax.interceptor.AroundInvoke;
import javax.interceptor.AroundTimeout;
import javax.interceptor.Interceptors;
import org.apache.webbeans.config.WebBeansContext;
import org.apache.webbeans.intercept.InterceptorData;
-import org.apache.webbeans.util.AnnotationUtil;
import org.apache.webbeans.util.Asserts;
import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.SecurityUtil;
/**
* Configures the EJB related interceptors.
@@ -54,25 +55,29 @@ public final class EJBInterceptorConfig
/**
* Configures the given class for applicable interceptors.
*
- * @param clazz configuration interceptors for this
+ * @param annotatedType to configure interceptors for
+ * @param interceptorStack to fill
*/
- public void configure(Class<?> clazz, List<InterceptorData> stack)
+ public void configure(AnnotatedType<?> annotatedType,
List<InterceptorData> interceptorStack)
{
- Asserts.nullCheckForClass(clazz);
+ Asserts.assertNotNull(annotatedType);
- if (AnnotationUtil.hasClassAnnotation(clazz, Interceptors.class))
+
+ Interceptors incs = annotatedType.getAnnotation(Interceptors.class);
+ if (incs != null)
{
- Interceptors incs = clazz.getAnnotation(Interceptors.class);
- Class<?>[] intClasses = incs.value();
+ Class<?>[] interceptorClasses = incs.value();
- for (Class<?> intClass : intClasses)
+ for (Class<?> intClass : interceptorClasses)
{
- _configureInterceptorAnnots(intClass, stack, false, null);
+ configureInterceptorAnnots(intClass, interceptorStack, false,
null);
}
}
- _configureBeanAnnots(clazz, stack);
-
webBeansContext.getInterceptorUtil().filterOverridenLifecycleInterceptor(clazz,
stack);
+ configureBeanAnnots(annotatedType, interceptorStack);
+
+ Class clazz = annotatedType.getJavaClass();
+
webBeansContext.getInterceptorUtil().filterOverridenLifecycleInterceptor(clazz,
interceptorStack);
}
/**
@@ -82,14 +87,14 @@ public final class EJBInterceptorConfig
* @param isMethod if interceptor definition is on the bean
* @param m if isMethod true, then it is intercepted method
*/
- private void _configureInterceptorAnnots(Class<?> clazz,
List<InterceptorData> stack, boolean isMethod, Method m)
+ private void configureInterceptorAnnots(Class<?> clazz,
List<InterceptorData> stack, boolean isMethod, Method m)
{
// 1- Look interceptor class super class
// 2- Look interceptor class
Class<?> superClass = clazz.getSuperclass();
if (superClass != null && !superClass.equals(Object.class))
{
- _configureInterceptorAnnots(superClass, stack, false, null);
+ configureInterceptorAnnots(superClass, stack, false, null);
}
webBeansContext.getWebBeansUtil().configureInterceptorMethods(null,
clazz, AroundInvoke.class,
@@ -105,36 +110,38 @@ public final class EJBInterceptorConfig
/**
* Configure bean class defined interceptors.
- * @param clazz bean class
+ * @param annotatedType bean class
* @param stack interceptor stack
*/
- private void _configureBeanAnnots(Class<?> clazz, List<InterceptorData>
stack)
+ private void configureBeanAnnots(AnnotatedType annotatedType,
List<InterceptorData> stack)
{
// 1- Look method intercepor class annotations
// 2- Look super class around invoke
// 3- Look bean around invoke
// 1-
- Method[] methods = SecurityUtil.doPrivilegedGetDeclaredMethods(clazz);
+ Set<AnnotatedMethod<?>> annotatedMethods = annotatedType.getMethods();
- for (Method method : methods)
+ for (AnnotatedMethod<?> annotatedMethod : annotatedMethods)
{
- Interceptors incs = method.getAnnotation(Interceptors.class);
+ Interceptors incs =
annotatedMethod.getAnnotation(Interceptors.class);
if (incs != null)
{
+ Method method = annotatedMethod.getJavaMember();
Class<?>[] intClasses = incs.value();
for (Class<?> intClass : intClasses)
{
- _configureInterceptorAnnots(intClass, stack, true, method);
+ configureInterceptorAnnots(intClass, stack, true, method);
}
}
}
+ Class clazz = annotatedType.getJavaClass();
// 2- Super clazz
List<Class<?>> listSuperClazz = ClassUtil.getSuperClasses(clazz, new
ArrayList<Class<?>>());
- _configureBeanSuperClassAnnots(listSuperClazz, stack);
+ configureBeanSuperClassAnnots(listSuperClazz, stack);
// 3- Bean itself
webBeansContext.getWebBeansUtil().configureInterceptorMethods(null,
clazz, AroundInvoke.class,
@@ -153,7 +160,7 @@ public final class EJBInterceptorConfig
* @param list super classes
* @param stack interceptor stack
*/
- private void _configureBeanSuperClassAnnots(List<Class<?>> list,
List<InterceptorData> stack)
+ private void configureBeanSuperClassAnnots(List<Class<?>> list,
List<InterceptorData> stack)
{
int i = list.size();
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
Tue Dec 27 18:30:00 2011
@@ -52,7 +52,7 @@ public final class AnnotationUtil
public static final Annotation[] EMPTY_ANNOTATION_ARRAY = new
Annotation[0];
public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
+
// No instantiate
private AnnotationUtil()
{
@@ -900,15 +900,31 @@ public final class AnnotationUtil
Asserts.assertNotNull(bean, "bean parameter can not be null");
Set<Annotation> qualifiers = bean.getQualifiers();
- for(Annotation ann : qualifiers)
+ return getAnnotation(qualifiers, Any.class) != null;
+ }
+
+ /**
+ * Search in the given Set of Annotations for the one with the given
AnnotationClass.
+ * @param annotations to scan
+ * @param annotationClass to search for
+ * @return the annotation with the given annotationClass or
<code>null</code> if not found.
+ */
+ public static <T extends Annotation> T getAnnotation(Set<Annotation>
annotations, Class<T> annotationClass)
+ {
+ if (annotations == null)
+ {
+ return null;
+ }
+
+ for(Annotation ann : annotations)
{
- if(ann.annotationType().equals(Any.class))
+ if(ann.annotationType().equals(annotationClass))
{
- return true;
+ return (T) ann;
}
}
-
- return false;
+
+ return null;
}
@@ -1010,6 +1026,6 @@ public final class AnnotationUtil
return anns;
}
- return new Annotation[0];
+ return EMPTY_ANNOTATION_ARRAY;
}
}
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Tue Dec 27 18:30:00 2011
@@ -2702,6 +2702,9 @@ public final class WebBeansUtil
return managedBean;
}
+ /**
+ * This method will be used in {@link
AfterBeanDiscovery#addBean(javax.enterprise.inject.spi.Bean)}}
+ */
public <T> ManagedBean<T>
defineManagedBeanWithoutFireEvents(AnnotatedType<T> type)
{
Class<T> clazz = type.getJavaClass();
Modified:
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/ejb/EjbInterceptorTest.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/ejb/EjbInterceptorTest.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/ejb/EjbInterceptorTest.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/ejb/EjbInterceptorTest.java
Tue Dec 27 18:30:00 2011
@@ -80,7 +80,7 @@ public class EjbInterceptorTest extends
}
- //X TODO enable again for OWB-634 @Test()
+ @Test
public void testDynamicEjbInterceptor()
{
Collection<String> beanXmls = new ArrayList<String>();
Modified:
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
Tue Dec 27 18:30:00 2011
@@ -18,6 +18,7 @@
*/
package org.apache.webbeans.test.unittests.exception;
+import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import junit.framework.Assert;
@@ -209,7 +210,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<MoreThanOnePostConstructComponent>
component = defineManagedBean(MoreThanOnePostConstructComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -226,7 +228,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<PostContructMethodHasParameterComponent> component
= defineManagedBean(PostContructMethodHasParameterComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -243,7 +246,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(PostContructMethodHasReturnTypeComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -260,7 +264,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(PostContructMethodHasCheckedExceptionComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -277,7 +282,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(PostContructMethodHasStaticComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -294,7 +300,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(MoreThanOneAroundInvokeComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -321,7 +328,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(AroundInvokeWithoutParameterComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -338,7 +346,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(AroundInvokeWithoutReturnTypeComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -355,7 +364,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(AroundInvokeWithWrongReturnTypeComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -372,7 +382,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(AroundInvokeWithStaticMethodComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -389,7 +400,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(AroundInvokeWithFinalMethodComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
@@ -406,7 +418,8 @@ public class ExceptionComponentTest exte
{
clear();
AbstractInjectionTargetBean<?> component =
defineManagedBean(NoArgConstructorInterceptorComponent.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{
Modified:
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java?rev=1224972&r1=1224971&r2=1224972&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
Tue Dec 27 18:30:00 2011
@@ -18,6 +18,8 @@
*/
package org.apache.webbeans.test.unittests.intercept;
+import javax.enterprise.inject.spi.AnnotatedType;
+
import junit.framework.Assert;
import org.apache.webbeans.component.AbstractInjectionTargetBean;
@@ -48,7 +50,8 @@ public class EJBInterceptorExceptionComp
{
AbstractInjectionTargetBean<MultpleInterceptor> component =
defineManagedBean(MultpleInterceptor.class);
-
getWebBeansContext().getEJBInterceptorConfig().configure(component.getReturnType(),
component.getInterceptorStack());
+ AnnotatedType annotatedType =
getWebBeansContext().getAnnotatedElementFactory().getAnnotatedType(component.getReturnType());
+
getWebBeansContext().getEJBInterceptorConfig().configure(annotatedType,
component.getInterceptorStack());
}
catch (WebBeansConfigurationException e)
{