users@jsr311.java.net

Re: Some questions about 0.7 api

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Wed, 7 May 2008 13:33:06 +0100

Hi

> 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()

In which cases Field.getGenericType() would be called (something that JavaDocs refer to) ?



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

I don't quite understand the purpose of this method then. The JAX-RS spec says that
it's the only portable way to publish the endpoint. Suppose CXF users would like to try the code they're running with CXF
against Jersey and they don't have JAX-WS involved.

There's a CXF specific way to create an endpoint and I thought that they may want to choose instead :

RuntimeDelegate.createEndpoint(new ApplicationConfigImpl(), clazz)...

But I don't quite get what T should we use in CXF. Seems like using JAX-WS Provider is the only portable value of T but only when people would also like to have JAX-WS annotations supported ?


Thanks, Sergey


>
> Marc.
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland