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

Romain Manni-Bucau (JIRA) issues at jboss.org
Tue Mar 22 06:33:00 EDT 2016

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

Romain Manni-Bucau commented on CDI-591:

No, needs both the annotated method and type. The binding is the obvious interesting thing but often there are companion annotations the interceptor needs to read. Workaround today is to use the bean manager to "create" the annotated type and filter methods to find it but this is not fluent and as easy as it could.

> 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

More information about the cdi-dev mailing list