users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Filters and generic entities

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Fri, 22 Mar 2013 19:19:48 +0100

I'm not sure I understand, can you provide a piece of code that describes the use case you have in mind?

Marek

On Mar 22, 2013, at 5:05 PM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:

> Hi Again - can I get some clarifications please ?
> I'd rather not to browse through the RI code to deduce the answer :-)
> I don't think I should open a JIRA for this, very minor question, so would rather prefer to keep it on the list
>
> Cheers, Sergey
> On 19/03/13 21:20, Sergey Beryozkin wrote:
>> On 18/03/13 17:13, Sergey Beryozkin wrote:
>>> Hi
>>>
>>> What ContainerResponseFilter should return in getEntity(),
>>> getEntityClass() and getEntityType(), when the application code uses
>>> GenericEntity class ?
>>>
>>> I'm thinking that GenericEntity needs to be 'unwrapped' by the filter
>>> context implementation, but then if the filter implementation sets
>>> "new GenericEntity..." then I guess it needs to get it back, in
>>> getEntity(), so may be after all
>>>
>>> getEntity(), getEntityClass() and getEntityType()
>>>
>>> should return GenericEntity instance + GenericEntity.class ?
>>
>> I'm still thinking that 'unwrapping' GenericEntity makes sense even if a
>> given filter replaces a current entity with GenericEntity, after all the
>> filter which replaces an entity is more interested in the follow-up
>> filters and writers to get the updates.
>>
>> So, to summarize, relevant ContainerResponseFilter getters should never
>> return GenericEntity if the current entity happens to be GenericEntity
>> (instance, class, type) but unwrap it.
>>
>> Agreed ?
>>
>> Cheers, Sergey
>>
>>
>>>
>>> Thanks, Sergey
>>>
>>
>>
>