dev@jsr311.java.net

Re: JSR311: Response isn't adequate

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 07 Mar 2008 10:53:22 -0500

Jerome Louvel wrote:

>> I don't think getting access to Input/OutputStreams creates a
>> suboptimal design. Since a JAX-RS endpoint uses annotations rather
>> than a static interface contract to process requests, its easy to
>> plug in new models as they become available through the specification
>> or as vendor plugins. The key is to get the extension SPIs correct.
>
> Again, returning an InputStream is fine and optimal. My issue is with giving
> a direct access to Response's OutputStream is that it forces
> thread-per-request model and prevents optimization in the HTTP/IO layers.
>

The StreamOutput injected interface that Marc proposed is an option and
is not forcing anything. On the other hand, not allowing OutputSTream
access to the Resource class *is* enforcing a particular model.


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