users@jsr311.java.net

Injection scope for message body providers

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Tue, 3 Jun 2008 18:21:04 +0100

Hi

My understanding is that the JAX-RS spec allows for providers such as MessageBodyReaders and MessageBodyWriters to have context values injected into @Context annotated fields (either directly or possibly through setters).

I remember reading on this list that providers are expected to have a singleton lifecycle. If so then what are the expectations with respect to the visibility of such injected fields in multithreaded environments ? For ex, HttpHeaders, SecurityContext, etc will likely differ across the invocations...

Thanks, Sergey

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland