deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "l.penet@senat.fr" <l.pe...@senat.fr>
Subject Advice on accessing @RequestScoped bean in service thread
Date Thu, 21 Jul 2016 17:16:46 GMT
Hi.

I am looking for an advice on how to acces a request scoped bean in a 
service thread. My current need is in a web socket service thread, but 
it could be any background thread.

The bean I need to access is a data access bean, which will itself 
request injection of an entity manager to perform various operations. It 
does in fact nothing related to the HTTP session, but I want to be sure 
that every requests gets a clean bean.

How do you recommend to do that ? If I boldly try to une 
BeanProvider.getContextualInstance(), it does not work as there is, of 
course, no request scope. Should I start a pseudo request scope ? Is 
there an annotation for that ?

Thanks in advance,

Ludovic


|
| AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
|


Mime
View raw message