Skip to content

Context and Suspended

Ahmad K. Bawaneh edited this page Feb 16, 2020 · 1 revision

@Context And @Suspended

Domino-rest is supposed to generate clients for JAX-RS resource interfaces, and is not responsible about how these interfaces are implemented in the server, knowing that we now that @Context is supposed to be injected into the implementation by the server side, as for domino-rest such method argument will be ignored and skipped.

for example if the have the following resource interface

@RequestFactory
public interface MoviesService {

    @Path("library/movies")
    @GET
    Movie getMovieByName(@QueryParam("name") String movieName, @Context ServerContext context);
}

then the generated client will be like this

MoviesServiceFactory.INSTANCE
    .getMovieByName("hulk")
    .onSuccess(movie ->{})
    .send();

notice how the context param is ignored.

For @Suspended domino-rest will also ignore the method argument, but since this one is used with void response, and this hides the actual response type we there should be a reader defined for such method.