users@jersey.java.net

Re: Resource Model from wadl

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 12 Dec 2007 09:30:33 +0100

Jakub Podlesak wrote:
> On Tue, Dec 11, 2007 at 08:53:13AM -0800, Marc Hadley wrote:
>> On Dec 11, 2007, at 8:10 AM, Paul Sandoz wrote:
>>
>>> Jakub Podlesak wrote:
>>>> Hi Nam,
>>>> unfortunately not. At the moment abstract resource model still
>>>> contains a reference to [java.lang.Class] implementing corresponding
>>>> resource, which makes such a utility kind of difficult to write.
>>>> I think anyway that the aim should be to get rid of the dependency,
>>>> which would allow us to introduce the utility you are asking for.
>>>>
>>> One way to do that is to make the model generic.
>>>
>>> But... i am not sure it is the right thing to do, because the set of
>>> stuff that WADL describes may be different from the set of stuff the
>>> resource model describes i.e. they describe different things.
>>>
>> Also don't we want stuff like the Java class in the model since we use
>> that for dispatching ?
>

I am not sure what you mean can you explain some more?


> I think we need it definitely in the runtime model, not necessarily
> in the abstract model.
>

The runtime could create instances of the abstract model like the following:

   AbstractResource<Class>
   AbstractResourceMethod<Method>

that way we keep things separate. It is useful for the runtime to keep
the Class and Method instances close to the abstract model and not have
to create something in parallel.

Paul.

> ~Jakub
>
>>> Perhaps a better way if you want access to the WADL model is to use
>>> JAXB classes generated from the WADL XSD.
>>>
>>> Also while on the topic an Ant utility to generate WADL from
>>> resource classes may be useful.
>>>
>> I think a doclet would be a good approach. That way we could also
>> extract Javadoc information and add that to the generated WADL. I plan
>> to take a look at this but haven't found the time yet.
>>
>> Marc.
>>
>>>> ~Jakub
>>>> On Mon, Dec 10, 2007 at 02:44:08PM -0800, Nam Nguyen wrote:
>>>>> Hi,
>>>>>
>>>>> Is there an existing utility somewhere to construct resource model
>>>>> given a wadl file? This would be very useful for tools.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -Nam
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>>>
>>> --
>>> | ? + ? = To question
>>> ----------------\
>>> Paul Sandoz
>>> x38109
>>> +33-4-76188109
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>> ---
>> Marc Hadley <marc.hadley at sun.com>
>> CTO Office, Sun Microsystems.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109