users@jersey.java.net

[Jersey] Two questions about creating a resource programatically

From: Bill O'Neil <oneil5045_at_gmail.com>
Date: Wed, 5 Feb 2014 22:48:41 -0500

I am having a little trouble figuring out how to use @BeanParam when
creating a resource programatically. I assume this should be possible?

I am starting with this.
https://jersey.java.net/documentation/latest/user-guide.html#d0e9039

Assume I want to recreate the following programatically. How could I
create the Inflector?

@Path("echorequest")
public class HelloWorldResource {

    @GET
    @Produces("application/json")
    public MyRequest echorequest(@BeanParam MyRequest request) {
        return request;
    }
}
And secondly how could I create this?

@Path("/resource")
public class AsyncResource {
    @GET
    public void asyncGet(@Suspended final AsyncResponse asyncResponse,
@BeanParam MyRequest request) {
        *// pass request into an executor... *
    }
}
Are either of these approaches possible?

Thanks, Bill