juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <jamesbog...@gmail.com>
Subject Re: Adding Resources Programmatically (No Annotations)
Date Tue, 02 Jun 2020 12:27:32 GMT
Hi Girish,

The RestContextBuilder class can be accessed via a lifecycle hook:
http://juneau.apache.org/site/apidocs-8.1.3/overview-summary.html#juneau-rest-server.Instantiation.LifecycleHooks

>From there you can add it via either the child() or children() methods:
http://juneau.apache.org/site/apidocs-8.1.3/org/apache/juneau/rest/RestContextBuilder.html#child-java.lang.String-java.lang.Object-

On Mon, Jun 1, 2020 at 3:37 PM Girish Vasmatkar
<girish.vasmatkar@hotwaxsystems.com> wrote:
>
> Hi All,
>
> I am evaluating Juneau as one of the possible REST implementations. While I am able to
define resources using @Rest annotation, I am looking for something that enables me to add
new resources dynamically/programmatically.
>
> For example, the @Rest annotation defines children property that I will not be knowing
until runtime. I am trying to have an XML configuration file containing all resources and
methods details and I would like to consume that XML at boot up time and have Juneau configure
these resources programmatically.
>
> I looked at RestContextBuilder but could not find how I can use it to register resources
and methods dynamically.
>
> Best Regards,
> Girish

Mime
View raw message