[cdi-dev] Lifecycle Callback Interceptor and @Target "METHOD"

Jozef Hartinger jharting at redhat.com
Wed Apr 24 08:56:42 EDT 2013


Why do you need ElementType.METHOD? You cannot use method-level bindings 
for lifecycle callback interceptor methods. This has been reverted from 
the interceptors spec.

On 04/24/2013 02:17 PM, Jens Schumann wrote:
> Hi all!
>
> While testing Weld 2.0.0.CR4 I have been running into a 
> DefinitionException because of an interceptor that contains one 
> @AroundInvoke and one @PostConstruct method. Since I use this 
> interceptor at class AND method level it declares 
> @Target({ElementType.METHOD, ElementType.TYPE}). The error message 
> seems to indicate that I can not have a lifecycle callback interceptor 
> with @Target METHOD:
>
> "WELD-000619 An interceptor for lifecycle callbacks Interceptor XX 
> declares and interceptor binding interface YYY with METHOD as its 
> @Target."
>
> Is this true? I just checked the current CDI 1.1 and Interceptor 1.2 
> spec and could not find this kind of restriction.
>
> Jens
>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20130424/9339a217/attachment.html 


More information about the cdi-dev mailing list