[cdi-dev] self interception for CDI beans

Romain Manni-Bucau rmannibucau at gmail.com
Wed Jan 9 05:42:08 EST 2013


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 <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20130109/2b23d2b0/attachment.html 


More information about the cdi-dev mailing list