i have a jersey service which generates a response. what i want to do is to poll a resource (in my case, a singleton class instance) for a success value, and as soon as i get the success value, perform some action
@Path("/generate")
class Generation{
@POST
@Produces("javax.ws.rs.core.MediaType.TEXT_PLAIN")
public String generateAndPoll(){
//Generate response
/*Polling to start
*/
return someValue;
}
}
what may be a good way to accomplish that? Would timer be of any use?