RE: Registering Resource Classes (bootstrap)

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


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,

> -----Message d'origine-----
> De : Dhanji R. Prasanna []
> Envoyé : samedi 19 mai 2007 00:18
> À :
> 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.