[cdi-dev] [JBoss JIRA] (CDI-591) Easy way to get an interceptor model

Mark Struberg (JIRA) issues at jboss.org
Fri Aug 24 04:48:00 EDT 2018


    [ https://issues.jboss.org/browse/CDI-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13623674#comment-13623674 ] 

Mark Struberg commented on CDI-591:
-----------------------------------

Up!

We had the following report from Arjan and he pointed out that Weld since introduced a non-portable way to do exactly that.
https://issues.apache.org/jira/browse/OWB-1217

So why not finally make it an official part of the API?

Could think about extending the InvocationContext. Not sure how we could do this as part of the Interceptors spec as it doesn't know about AnnotatedTypes at all. We could either subclass it to a CdiInvocationContext. Or define a standard parameter in the Map. E.g. 'jcdi.intercepted.AnnotatedMethod'. It should not only contain the InterceptorBindings but the whole AnnotatedMethod. Often you need other Annotations than just the InterceptorBinding.

> Easy way to get an interceptor model
> ------------------------------------
>
>                 Key: CDI-591
>                 URL: https://issues.jboss.org/browse/CDI-591
>             Project: CDI Specification Issues
>          Issue Type: Epic
>            Reporter: Romain Manni-Bucau
>
> Since CDI 1.1 we can get the intercepted Bean<?> but we can't get the annotated type and method associated easily (= an injection). Would be great to enable it since often in an interceptor you need the binding to read some configuration (@Nonbinding) to change a bit the behavior.
> {code}
> @Inject
> @Intercepted
> AnnotatedType<?> type;
> @Inject
> @Intercepted
> AnnotatedMethod<?> method;
> {code}
> would be great
> Side note: would be better to be in the InvocationContext but not sure it is an option. Or it would need a CdiInvocationContext inheriting from InvocationContext probably.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the cdi-dev mailing list