dev@jersey.java.net

Re: ResourceClass scanner <was> Re: I am here again ......

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 01 Nov 2007 13:22:37 -0400

On Nov 1, 2007, at 12:25 PM, Paul Sandoz wrote:

> Frank Martínez wrote:
>> Hi Paul,
>>> I can sort out this bit. I don't want to remove it completely
>>> until the
>>> abstract resource model API and impl is ready so that we still
>>> have
>>> WADL generation support for the interim period. But I can remove the
>>> resource config APT and generation code and do some clean up.
>>>
>> Have you considered the possibility of wadl generation on startup
>> time too?
>>
>
> Yes, or just when the WADL is requested (and potentially keep WADL
> more focused at the resource class level and not at the application
> level for all know resource classes).
>
Exactly, we can treat WADL as an alternate representation of a
resource so a request with "Accept: application/vnd.sun.wadl+xml"
would automatically generate and return the WADL for that resource.

Marc.

>
>> Ok. Now you can override these paths by an init-param of the
>> ServletContainer.
>> <init-param>
>> <param-
>> name>com.sun.ws.rest.config.property.ResourcePaths</param-name>
>> <param-value>/WEB-INF/classes</param-value>
>> </init-param>
>> param-value is a ';' separated list of paths.
>
> Great.
>
>
>>> See the class:
>>>
>>> com.sun.ws.rest.api.container.ContainerFactory
>>>
>>> I justed checked the available properties returned from
>>> System.getProperties() (ironically using the EntityProvider
>>> example in
>>> Jersey to print them out :-) )
>>>
>>> So we can get the value of the property "java.class.path" to get the
>>> list of paths.
>>>
>>> Which means we could add the following additional methods to
>>> ContainerFactory:
>>>
>>> // Creates a ASMResourceConfig obtaining the
>>> // paths from the System property "java.class.path"
>>> public static <A> A createContainer(Class<A> type)
>>>
>>> // Creates a ASMResourceConfig obtaining the
>>> // paths passed in as a parameter
>>> public static <A> A createContainer(Class<A> type, String...
>>> paths)
>>>
>>> Paul.
>>>
>> Done. But i am not familiarized with other containers rather than
>> Servlet.
>
> OK, i will sort this out (as well as clearing up the APT code). I
> will most likely not get around to doing this until Monday next week.
>
> Paul.
>
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>

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