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

[jsr339-experts] Re: Alternative request and response entity types

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 10 May 2012 15:48:44 +0100

On 10/05/12 15:19, Bill Burke wrote:
>
>
> On 5/1/12 4:49 PM, Sergey Beryozkin wrote:
>> Hi
>>
>> One thing that is limiting with MBR and MBW interfaces is that they do
>> not support the alternative entity streams/data types. It's always
>> either InputStream or OutputStream.
>>
>> However, it is often the case that the in or out streams have already
>> been wrapped into more efficient STAX readers or writers.
>>
>> Any ideas on how to support alternative types for MBRs and MBWs to
>> process ? In CXF this is handled in the CXF specific way, but I wonder
>> if we can have say
>>
>> Response.getEntityType()
>> Request.getEntityType()
>>
>> which would return InputStream.class by default but may also return
>> XMLStreamReader.class, etc
>>
>
> Not sure I agree with this usecase. How an InputStream/OutputStream is
> processed is really up to the MBR/MBW and the corresponding mapping the
> the resource method.
>
Indeed - it just prevents the filters to pre-process the entity,
example, read into Document for the XML signature validation and wrap
into an optimized STAX DOM reader

I'm not strongly in favor of addressing this issue now, but I'd like the
API to stay 'open' to such extensions in the future. With the buffer
entity it won;t happen

Cheers, Sergey

>> Sergey
>