openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de>
Subject Re: Request context in Java SE
Date Fri, 31 Aug 2012 01:21:24 GMT
Hi Harald!

After starting a new thread you must start a ReqeustContext for it manually.

There is not yet an API for it, but you can do this in a portable way with Apache DeltaSpike
CdiControl.

Just 
@Inject ContextControl ctxCtrl.

and invoke
ctxCtrl.startContext(RequestScoped.class);

and it should work.

LieGrue,
strub




----- Original Message -----
> From: Harald Wellmann <hwellmann.de@gmail.com>
> To: user@openwebbeans.apache.org
> Cc: 
> Sent: Thursday, August 30, 2012 7:58 PM
> Subject: Request context in Java SE
> 
> In a multi-threaded Java SE application, how can I make sure that a CDI request 
> context is started for every thread?
> 
> As far as I can see, a request context is only available on the thread that 
> created the CDI container (WebBeansContext).
> 
> Is there a portable way of starting the contexts (i.e without depending on OWB 
> APIs)?
> 
> If not, will this be addressed in CDI 1.1?
> 
> Best regards,
> Harald
> 

Mime
View raw message