users@jersey.java.net

[Jersey] Registering a REST Resource after engine is started

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

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