dev@jsr311.java.net

RE: Registering Resource Classes (bootstrap)

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Sat, 19 May 2007 16:08:56 +0200

Dhanji,

I'm not even sure that we need a registering service in the API. I'm not
sure if it is possible and basically if it makes sense to have an uniform
way to deploy those annotated resources in a container...

If we do so, at least it shouldn't be a mandatory way to deploy JSR311
resources. For example, Spring users would probably like to leverage their
XML wiring service, while for the Restlet API, we could manually attach them
to Routers or deploy them using a custom mechanism.

Best regards,
Jerome

> -----Message d'origine-----
> De : Dhanji R. Prasanna [mailto:dhanji_at_gmail.com]
> Envoyé : samedi 19 mai 2007 00:18
> À : dev_at_jsr311.dev.java.net
> Objet : Registering Resource Classes (bootstrap)
>
> Hi
>
> This may not sound like an immediate concern, but a lot of
> discussion around the ordering/overriding of resources and
> sub-resources have started so I thought it useful to start a
> thread on how the runtime recognizes resource classes and
> bootstraps itself.
>
> Common wisdom suggests an xml descriptor with properties and
> a list of resource classes in order. I suggest we abstract
> that with the optional use of a builder:
>
> Jaxrs.configure(props)
> .addPackage(" com.wideplay.webservices")
> .addConfiguration(XmlConfigurer.class,
> "atomservices.xml") //via a user-provided builder
>
> .addResource(Account.class) //override
> .addResource(Client.class ) //extend, etc.
> .buildRuntime()
> .start();
>
> An xml parser layer (or any other configuration mechanism)
> could be added easily. Thoughts, comments?
>
> Dhanji.
>
>