With RESTEasy I\'ve implemented a subclass of Application to provide a list of singleton resources. Is there a way to add another singleton dynamically later on? I\'ve not found
I have not tried this myself, but I found a blog post where this is described: http://sarbarian.wordpress.com/2010/03/07/resteasy-and-osgi-perfect-match/
During deployment, RESTEasy puts it's registry in the servlet context. The idea suggstested in the blog, is that you fetch the registry from the servlet context, and then add your resource class.
Something like this:
import org.jboss.resteasy.spi.Registry;
Object resource = new MyService();
Registry registry = (Registry) context.getAttribute(Registry.class.getName());
registry.addSingletonResource(resource);