Re: JSR311: GenericEntity + extending Response

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 20 Aug 2008 08:47:12 +0200

On Aug 20, 2008, at 2:39 AM, Bill Burke wrote:

> For, 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.


> 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
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: