users@jsr311.java.net

Re: Some questions about 0.7 api

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 06 May 2008 14:39:02 -0700

On May 6, 2008, at 12:03 PM, Sergey Beryozkin wrote:
>
> I'd like to ask few questions about some of the api changes in 0.7.
>
> 1. MessageBodyWriter has new parameters introduced.
> For example, Type parameter is added to writeTo method and the
> MessageBodyWriter documentation says about it:
>
> "genericType type of the object to be written. E.g if the message
> body is to be produced from a field. this will be the declared type
> of the field as returned by Field.getGenericType()"
>
> So in cases like :
>
> 1.1 public Bar getBar() {
> return this.bar;
> }
>
> 1.2 public Bar getBar() {
> return bars.bar;
> }
>
> the classes need to be introspected and checked if fileds of type
> Bar are available and if yes then those fields need to be examined
> further ?
>
In your example is getBar meant to be a resource method ? If so then
the Type parameter would be the whatever you get back from
Method.getGenericReturnType()

>
>
> 2. RuntimeDelegate.createEndpoint(ApplicationConfig ac, Class<T>
> endpointType);
>
> If it's JAX-RS then what is the value of T ?
>
We don't require support for any particular value of T. Jersey
supports a variety including JAX-WS Provider, Grizzly adaptor, LW http
server.

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