[cdi-dev] Interceptors and JDK 8 default methods

Martin Kouba mkouba at redhat.com
Wed Jan 13 02:57:27 EST 2016


Hi Arjan,

that's a good question. I think it should work, i.e. an invocation of a 
default method should be intercepted, see also the spec "7.2. Container 
invocations and interception". However, I'm not so sure about possible 
implementation problems. I've created WELD-2093 [1] to track this issue.

Martin

[1]
https://issues.jboss.org/browse/WELD-2093

Dne 12.1.2016 v 17:43 arjan tijms napsal(a):
> Hi,
>
> I've got a CDI bean implementing an interface with several default
> methods. The bean implements one of those methods.
>
> When I place an interceptor on said bean, and call the different methods
> via the CDI proxy, only the method that the bean implemented is
> intercepted. The defaulted methods go straight to the implementation
> provided by the interface.
>
> Tested with Weld 2.3.2 on WildFly 10cr5.
>
> Is this supposed to work?
>
> Kind regards,
> Arjan Tijms
>
>
>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>

-- 
Martin Kouba
Software Engineer
Red Hat, Czech Republic


More information about the cdi-dev mailing list