[cdi-dev] self interception for CDI beans
Pete Muir
pmuir at redhat.com
Wed Jan 9 08:36:45 EST 2013
CDI beans must support this today. As Stuart says, this is defined in the interceptors spec, which a CDI impl must comply with.
On 9 Jan 2013, at 10:44, Mark Struberg wrote:
>
>
> Yes sure. This behaviour is 100% clearly defined for EJBs, but for CDI beans it's a grey area imo.
>
> The intent is to clarify if we need/would like to support this for all CDI beans as well.
>
> LieGrue,
> strub
>
>> ________________________________
>> From: Romain Manni-Bucau <rmannibucau at gmail.com>
>> To: Mark Struberg <struberg at yahoo.de>
>> Cc: cdi-dev <cdi-dev at lists.jboss.org>
>> Sent: Wednesday, January 9, 2013 11:42 AM
>> Subject: Re: [cdi-dev] self interception for CDI beans
>>
>>
>> Hi,
>>
>>
>> +1 it is useful for particular audit for instance (i want to audit a single class in a particular way)
>>
>>
>> just to be sure: you spoke about sessionscoped but in fact it was all proxied cdi beans right?
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>>
>> 2013/1/9 Mark Struberg <struberg at yahoo.de>
>>
>> Hi!
>>>
>>> For EJBs there is a 'self-interception' defined. E.g.
>>>
>>> @Stateless
>>> public class MyEjb {
>>> public String someBusinessMehod() {
>>> returns "Schneewittchen";
>>> }
>>>
>>> @AroundInvoke
>>> public Object interceptMe(InvocationContext ic) throws Exception {
>>> System.out.println("got intercepted");
>>>
>>> return ic.proceed();
>>> }
>>>
>>> }
>>>
>>>
>>> But should the same trick also work for CDI beans when replacing @Stateless with @SessionScoped ?
>>>
>>>
>>> LieGrue,
>>> strub
>>>
>>>
>>> _______________________________________________
>>> cdi-dev mailing list
>>> cdi-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/cdi-dev
>>>
>>
>>
>>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
More information about the cdi-dev
mailing list