You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Eric Covener (JIRA)" <ji...@apache.org> on 2010/03/05 16:58:27 UTC
[jira] Commented: (OWB-318) multiple methods with same EJB
@interceptors(foo.class) in same bean class get multiple interceptor
instances
[ https://issues.apache.org/jira/browse/OWB-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841901#action_12841901 ]
Eric Covener commented on OWB-318:
----------------------------------
I'm not sure if an InterceptorDataImpl should be shared or if we should have N Impl's and one underlying interceptor class instance. Gurkan, I see you were in this neighborhood recently, DYT?
> multiple methods with same EJB @interceptors(foo.class) in same bean class get multiple interceptor instances
> -------------------------------------------------------------------------------------------------------------
>
> Key: OWB-318
> URL: https://issues.apache.org/jira/browse/OWB-318
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Interceptor and Decorators
> Affects Versions: M4
> Reporter: Eric Covener
> Assignee: Eric Covener
> Original Estimate: 6h
> Remaining Estimate: 6h
>
> One managed bean with multiple methods with the same EJB @interceptors(foo.class) get multiple interceptor instances, but we should only create 1 instance.
> See TCK method org.jboss.jsr299.tck.interceptors.tests.method.MethodLevelInterceptorTest.testInterceptorCanBeAppliedToMoreThanOneMethod().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (OWB-318) multiple methods with same EJB
@interceptors(foo.class) in same bean class get multiple interceptor
instances
Posted by Gurkan Erdogdu <cg...@gmail.com>.
Eric you are right. According to the interceptor specification, if a same
interceptor is applied to different methods, owner class has just one
interceptor instance.
But I am afraid that, we create a new instance for each WebBeansInterceptor
bean in the InterceptorHandler#injectInterceptorFields for each business
method call. For EJBInterceptors, currently we create a new instance of
InterceptorData for the same interceptor applied to a different methods of
the same target class in the WebBeansUtil#configureInterceptorMethods method
via
> try
> {
> if (!isDefinedWithWebBeans)
> {
> *intData.setInterceptorInstance(newInstanceForced(clazz));*
> }
> }
>
>
This seems to be a wrong and not performancable! It needs update!
Moreover, currently we do not inject dependencies of the EJBInterceptors. We
also have to provide this functionality. I have added OWBInjector class for
injecting dependencies of Java EE components that are not beans.
Thanks;
--Gurkan
2010/3/5 Eric Covener (JIRA) <ji...@apache.org>
>
> [
> https://issues.apache.org/jira/browse/OWB-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841901#action_12841901]
>
> Eric Covener commented on OWB-318:
> ----------------------------------
>
> I'm not sure if an InterceptorDataImpl should be shared or if we should
> have N Impl's and one underlying interceptor class instance. Gurkan, I see
> you were in this neighborhood recently, DYT?
>
> > multiple methods with same EJB @interceptors(foo.class) in same bean
> class get multiple interceptor instances
> >
> -------------------------------------------------------------------------------------------------------------
> >
> > Key: OWB-318
> > URL: https://issues.apache.org/jira/browse/OWB-318
> > Project: OpenWebBeans
> > Issue Type: Bug
> > Components: Interceptor and Decorators
> > Affects Versions: M4
> > Reporter: Eric Covener
> > Assignee: Eric Covener
> > Original Estimate: 6h
> > Remaining Estimate: 6h
> >
> > One managed bean with multiple methods with the same EJB
> @interceptors(foo.class) get multiple interceptor instances, but we should
> only create 1 instance.
> > See TCK method
> org.jboss.jsr299.tck.interceptors.tests.method.MethodLevelInterceptorTest.testInterceptorCanBeAppliedToMoreThanOneMethod().
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
--
Gurkan Erdogdu
http://gurkanerdogdu.blogspot.com