users@jersey.java.net

[Jersey] Re: Registering a REST Resource after engine is started

From: Alexandre Borgoltz <alexandre.borgoltz_at_gmail.com>
Date: Thu, 7 Apr 2011 09:46:30 +0200

Apologies - my mistake for double posting.
I hadn't received the answers to the first posting (??) and thought it had
failed.

-- 
Alexandre
2011/4/7 Alexandre Borgoltz <alexandre.borgoltz_at_gmail.com>
> Hi,
>
> The default registration mecanism for resources is to scan the classpath
> (WEB-INF/lib, WEB-INF/classes).
> As I need to register my resources programmatically explicitely, I wrote my
> own javax.ws.rs.core.Application and it did the trick.
>
> BUT afaik the scan/resource configuration only occurs once, on jersey
> startup.
>
> I am writing a port of jersey to OSGi and for that purpose I need to
> register resources programmatically *after *jersey is launched - some kind
> of .addSingleton(Object resource) or .addClass(Class<?> clazz) API [and
> the corresponding .remove*()] I could call whenever I need to.
>
> Does that already exists somewhere? Or is it a feature request I have to
> post somewhere (jersey?jsr311?)? I am willing to contribute to coding the
> changes.
>
> I thank you in advance,
>
> --
> Alexandre
>