// Simple request with a callback
HttpGet request4 = new HttpGet("http://google.com");
// using a null HttpContext here since it is optional
// the callback will be called when the task completes, fails, or is cancelled
HttpRequestFutureTask<Boolean> futureTask4 = requestExecService.execute(request4,
HttpClientContext.create(), handler, callback);
Boolean wasItOk4 = futureTask4.get(10, TimeUnit.SECONDS);
System.out.println("It was ok? " + wasItOk4);
// Multiple requests, with a callback