I'd like to implement a call like:
public Response getContent() throws MyException
This method internally calls to a web service, but I only want one request to the web service at the same time. That is: when the first request comes, it goes to the web service. If in the meanwhile another requests arrive, it wait for the result of the first request. After the first request returns (or throws exception), all the pending requests return too (or throw exceptions). From this point, if another request comes, it goes again to the web service with the same criteria (only one web service call at the same time)
What is the best approach for implementing this in Java/Android?
Thanks