dev@jsr311.java.net

Re: JSR311: GenericEntity + extending Response

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 20 Aug 2008 09:33:32 -0400

On Aug 20, 2008, at 2:47 AM, Paul Sandoz wrote:
>
>> For javax.ws.rs.core.Response, spec says that "An application class
>> can extend this class directly or can use one the static methods to
>> create an instance using a ResponseBuilder."
>>
>> The problem with this is that if the user sets the entity to be a
>> GenericEntity, the runtime has no way of getting at the type
>> information that GenericEntity is supposed to provide as
>> getEntity() is supposed to unwrap GenericEntity.
>>
>
> That JavaDoc is written from the intent of the runtime processing a
> Response instance, but i think it can be made clearer. It is the
> runtime processing the response that checks if the entity is an
> instance of GenericEntity and if so unwraps the information in the
> GenericEntity instance.
>
Right. I'll try to make that clearer in the Javadoc, sorry for the
confusion.

Marc.

>
>> Either don't allow users to extend Response or add a
>> getGenericType() method to Response. I vote for adding a
>> getGenericType() method.
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>

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