public Response getResult() throws IOException { boolean hasInterruptPending = Thread.interrupted(); try { return responseSlot.take(); } catch (InterruptedException e) { hasInterruptPending = false; throw dealWithInterrupt(e); } finally { if (hasInterruptPending) { Thread.currentThread().interrupt(); } } }
public Response getResult(int timeout) throws IOException { final boolean wasInterrupted = Thread.interrupted(); try { Response result = responseSlot.poll(timeout, TimeUnit.MILLISECONDS); if (result == null && timeout > 0) { throw new RequestTimedOutIOException(); } return result; } catch (InterruptedException e) { throw dealWithInterrupt(e); } finally { if (wasInterrupted) { Thread.currentThread().interrupt(); } } }
public Response getResult() throws IOException { boolean hasInterruptPending = Thread.interrupted(); try { return responseSlot.take(); } catch (InterruptedException e) { hasInterruptPending = false; throw dealWithInterrupt(e); } finally { if (hasInterruptPending) { Thread.currentThread().interrupt(); } } }
public Response getResult() throws IOException { boolean hasInterruptPending = Thread.interrupted(); try { return responseSlot.take(); } catch (InterruptedException e) { hasInterruptPending = false; throw dealWithInterrupt(e); } finally { if (hasInterruptPending) { Thread.currentThread().interrupt(); } } }
public Response getResult() throws IOException { boolean hasInterruptPending = Thread.interrupted(); try { return responseSlot.take(); } catch (InterruptedException e) { hasInterruptPending = false; throw dealWithInterrupt(e); } finally { if (hasInterruptPending) { Thread.currentThread().interrupt(); } } }
public Response getResult(int timeout) throws IOException { final boolean wasInterrupted = Thread.interrupted(); try { Response result = responseSlot.poll(timeout, TimeUnit.MILLISECONDS); if (result == null && timeout > 0) { throw new RequestTimedOutIOException(); } return result; } catch (InterruptedException e) { throw dealWithInterrupt(e); } finally { if (wasInterrupted) { Thread.currentThread().interrupt(); } } }
public Response getResult(int timeout) throws IOException { final boolean wasInterrupted = Thread.interrupted(); try { Response result = responseSlot.poll(timeout, TimeUnit.MILLISECONDS); if (result == null && timeout > 0) { throw new RequestTimedOutIOException(); } return result; } catch (InterruptedException e) { throw dealWithInterrupt(e); } finally { if (wasInterrupted) { Thread.currentThread().interrupt(); } } }
public Response getResult(int timeout) throws IOException { final boolean wasInterrupted = Thread.interrupted(); try { Response result = responseSlot.poll(timeout, TimeUnit.MILLISECONDS); if (result == null && timeout > 0) { throw new RequestTimedOutIOException(); } return result; } catch (InterruptedException e) { throw dealWithInterrupt(e); } finally { if (wasInterrupted) { Thread.currentThread().interrupt(); } } }