dev@jsr311.java.net

Re: JSR311: Problem with StreamedOutput model

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 14 Mar 2008 09:37:02 -0400

Stephan Koops wrote:
> Hello Bill,
>
> why must the MessageBodyWriter (or the StreamingOutput) blocks, why not
> the resource method?
> This brings application logic in the MessageBodyWriter. But this is not
> the business of the MessageBodyWriter, as its name says.
>

Its not application logic, its marshalling logic. At least for
MessageBodyWriter. If the app developer has constructed its object
erroneously, there's no way to flag this if the response codes have been
committed. But...I was thinking more of StreamedOutput.

> If the resource method blocks, than it is also not necessary, that the
> MessageBodyWriter throws Exceptions or changes HTTP headers.
>

Take a look at the Comet stuff Jerome linked, and you'll see what I mean.

Bill

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