[cdi-dev] [JBoss JIRA] (CDI-287) Clarify the order of CDI interceptors wrt. around-invoke method of target class
Pete Muir (JIRA)
jira-events at lists.jboss.org
Wed Nov 21 10:52:21 EST 2012
[ https://issues.jboss.org/browse/CDI-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pete Muir resolved CDI-287.
---------------------------
Resolution: Done
Merged
> Clarify the order of CDI interceptors wrt. around-invoke method of target class
> -------------------------------------------------------------------------------
>
> Key: CDI-287
> URL: https://issues.jboss.org/browse/CDI-287
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Interceptors
> Affects Versions: 1.0
> Reporter: Ron Šmeral
> Assignee: Pete Muir
> Fix For: 1.1.PFD
>
>
> Currently, the CDI specification doesn't define, when is the around-invoke method of a target class called, with regard to CDI interceptors.
> The spec. only says, in 9.4, towards the end:
> bq. Interceptors declared using {{@Interceptors}} or in {{ejb-jar.xml}} are called before interceptors declared using interceptor bindings.
> Currently, the order happens to be (in EAP6):
> # {{@Interceptors}} and {{ejb-jar.xml}}
> # Around-invoke method
> # CDI interceptors
> In the following example the order of interception would be:
> # {{FirstInterceptor}}
> # {{SomeClass.aroundInvoke}}
> # {{ThirdInterceptor}}
> \\
> \\
> {code}
> public class SomeClass {
> @ThirdInterceptorBinding // bound to ThirdInterceptor
> @Interceptors(FirstInterceptor.class)
> public int doSomething() {
> // ...
> }
> @AroundInvoke // comes second
> public Object aroundInvoke(InvocationContext invocationContext) throws Exception {
> return invocationContext.proceed();
> }
> }
> {code}
> This problem manifests in this (currently skipped) test:
> https://github.com/weld/core/blob/1.1/tests-arquillian/src/test/java/org/jboss/weld/tests/interceptors/retry/RetryInterceptorTest.java
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the cdi-dev
mailing list