dev@jsr311.java.net

Re: Proposal for rework of spi package (was Re: "Dual dispatch")

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 26 Apr 2007 10:14:01 -0400

On Apr 26, 2007, at 5:30 AM, Paul Sandoz wrote:
>
> The main quandary i have with deferring conneg to the type provider
> is that this can defer a 406 response until after the HTTP method
> has been invoked, processed the request, and returned a response.
>
I think that is only the case when the type provider doesn't declare
the media types it supports. In the example I gave:

> @Externalizer(classes={Thing.class}, type="application/thing")
> public class ThingExternalizer implements
> TypeStreamingProvider<Thing.class> {...}

the runtime still has all the required information.

I'd only expect generic type providers like a JAXB provider or a
String provider to omit the type property in the @Externalizer
annotation since they don't much care what the media type is, they
just read and write the data regardless.

I agree there's a potential problem but I'm not sure how widespread
it would be provided we educate developers to fill in the type
property correctly.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.