List of usage examples for org.apache.http.nio.conn ManagedClientAsyncConnection isOpen
boolean isOpen();
From source file:org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.java
private synchronized void connectionRequestCompleted(final ManagedClientAsyncConnection conn) { if (this.log.isDebugEnabled()) { this.log.debug("[exchange: " + this.id + "] Connection allocated: " + conn); }// w w w. j a v a 2 s.co m this.connRequestCallback = null; try { this.managedConn = conn; if (this.closed) { conn.releaseConnection(); return; } final HttpRoute route = this.mainRequest.getRoute(); if (!conn.isOpen()) { conn.open(route, this.localContext, this.params); } conn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this); conn.requestOutput(); this.routeEstablished = route.equals(conn.getRoute()); if (!conn.isOpen()) { throw new ConnectionClosedException("Connection closed"); } } catch (final IOException ex) { failed(ex); } catch (final RuntimeException runex) { failed(runex); throw runex; } }