tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Injection of objet created by interceptor (per request)
Date Wed, 09 May 2012 11:03:50 GMT
Why isn't it elegant? If you don't use async mecanism and/or start new
thread that's common. Moreover
in the interceptor you can clean the thread local (in a finally) so no
memory leak.

That's the way commonly used for security if i'm not mistaken.

- Romain


2012/5/9 Eric Chatellier <chatellier@codelutin.com>

> Le 09/05/2012 12:54, Romain Manni-Bucau a écrit :
> > Hi,
> >
> > isn't ThreadLocal adapted?
> It's working.
> It was my first working solution.
>
> But i'm wondering, if it's really safe ?
>
> And it doesn't seems to be an elegant solution :D
> >
> > if you really want to use @Inject because that's fancy or because that's
> > the API you want to expose you can  @Produces a proxy looking in your
> > threadlocal.
> I will chech @Produces... but still threadlocal :-(
>
> Thanks.
>
> --
> Éric Chatellier <chatellier@codelutin.com>
> Tel: 02.40.50.29.28
> http://www.codelutin.com
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message