protected <V>V awaitResult(ListenableFuture<V> future,int time,TimeUnit unit){
  try {
    return future.get(time,unit);
  }
 catch (  ExecutionException e) {
    LOG.log(Level.WARNING,"Exception processing future: " + e.getMessage());
    future.cancel(true);
    return null;
  }
catch (  InterruptedException|TimeoutException e) {
    LOG.log(Level.SEVERE,"Exception processing future ",e);
    future.cancel(true);
    return null;
  }
}

protected < V > V awaitResult ( ListenableFuture < V > future , int time , TimeUnit unit ) { try { return future . get ( time , unit ) ; } catch ( ExecutionException e ) { LOG . log ( Level . WARNING , "Exception processing future: " + e . getMessage ( ) ) ; future . cancel ( true ) ; return null ; } catch ( InterruptedException | TimeoutException e ) { LOG . log ( Level . SEVERE , "Exception processing future " , e ) ; future . cancel ( true ) ; return null ; } }
waits for listenablefuture to terminate . cancels on timeout
