dev@jersey.java.net

[Jersey2] Build Application with ResourceMethod

From: Thomas Koch <thomas_at_koch.ro>
Date: Mon, 27 Feb 2012 17:48:00 +0100

Hi,

I really love the ability to programatically build applications with
Jersey2[1]. However it seems only possible to bind instances of Inflector. If
you could add a method to add arbitray implementations of ResourceMethod, then
one could also use all injector goodies provided by Jersey in the
ResourceMethod:

in ApplicationBuilder.java:

private final ResourceMethodBuilder resourceMethodBuilder = new
ResourceMethodBuilder() {

    public BoundBuilder to(ResourceMethod method) {
        resource.getResourceMethods().add(method);
        return applicationBuilder;
    }

[1] http://stackoverflow.com/questions/9161002/java-rest-framework-with-
programmable-dispatcher

Best regards,

Thomas Koch, http://www.koch.ro