jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] minor changes to Interceptor interfaces

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 24 Aug 2011 18:34:43 -0400

Header values should be Strings when reading as they are being pulled
directly from an HttpRequest (server-side) or HttpResponse (client-side).

On the other hand, header values should be Objects when writing as they
are being set by application code. Writer interceptors may want access
to the object that represents the header that was passed in by
application code. If you more details I can elaborate why.

So, MessageBodyHandlerContext should have the getHeaders() method removed.

The following changes should be made to The Writer and Reader Contexts:

interface WriterToHandlerContext {

   public MultivaluedMap<String, Object> getHeaders();

}

interface ReadFromHandlerContext {

    public MultivaluedMap<String, String> getHeaders();

}

This matches comparably to MessageBodyReader which takes a
<String,String> map as a paramter to readFrom() and MessageBodyWriter
which takes a <String, Object> map as a paramter to writeTo().

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com