Camelot uses Jersey 2 to create RESTful Web service from your application.
@Path("/count-by-day") public class TestsCountByDayResource { @Repository private AggregatorRepository aggregatorRepository; @MainInput private EventProducer input; @GET @Path("{day}") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response get(@PathParam("day") String day) { return Response.ok(aggregatorRepository.get(day)).build(); } @PUT @Path("/events") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public Response sendMessage(TestMessage message) { input.produce(TestMessage); return Response.ok("ok").build(); } }
You can inject to resource class the following beans:
More information about injections you can find on camelot injections wiki page.
There was an error while loading. Please reload this page.