[jax-rs-spec users] [jsr339-experts] Refactor MessageBodyHandlerContext.getHeaders()

From: Bill Burke <>
Date: Mon, 19 Dec 2011 10:31:45 -0500

The MessageBodyHandlerContext.getHeaders() method needs to be removed.
New methods in ReadFrom and WriteToHandler Context need to be added to
match the corresponding MessageBodyReader and Writer interfaces:

interface ReadFromHandlerContext {

    MultivaluedMap<String, String> getHeaders();


interface WriteToHandlerContext {

    MultivaluedMap<String, Object> getHeaders();


Why this change? Writers are allowed to add headers to the outgoing
request (client) or response (server). In this scenario, they may want
to interact using the Object representation of the header rather than
the String based one.

Readers will always be dealing with a String based representation of
headers. Finally, this whole change maps 1-1 to the corresponding
parameters that MessageBodyReader and MessageBodyWriters expect.

Bill Burke
JBoss, a division of Red Hat