public ManagedClientConnection getConnection( long timeout, TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException { if (route == null) { throw new IllegalArgumentException("Route may not be null."); } if (log.isDebugEnabled()) { log.debug("ThreadSafeClientConnManager.getConnection: " + route + ", timeout = " + timeout); } BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit); // BEGIN android-changed // When using a recycled Socket, we need to re-tag it with any // updated statistics options. try { final Socket socket = entry.getConnection().getSocket(); if (socket != null) { SocketTagger.get().tag(socket); } } catch (IOException iox) { log.debug("Problem tagging socket.", iox); } // END android-changed return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry); }
if ((hca.getPoolEntry() != null) && (hca.getManager() != this)) { throw new IllegalArgumentException ("Connection not obtained from this manager."); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); final Socket socket = entry.getConnection().getSocket(); if (socket != null) { if (hca.isOpen() && !hca.isMarkedReusable()) { if (log.isDebugEnabled()) { log.debug hca.shutdown(); iox); } finally { BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); boolean reusable = hca.isMarkedReusable(); hca.detach(); if (entry != null) { connectionPool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(ThreadSafeClientConnManager tsccm, AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }
"connection not obtained from this manager"); final BasicPooledConnAdapter hca = (BasicPooledConnAdapter) conn; if (hca.getPoolEntry() != null) { Asserts.check(hca.getManager() == this, "Connection not obtained from this manager"); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); if (entry == null) { return; if (hca.isOpen() && !hca.isMarkedReusable()) { hca.shutdown(); final boolean reusable = hca.isMarkedReusable(); if (log.isDebugEnabled()) { if (reusable) { hca.detach(); pool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(ThreadSafeClientConnManager tsccm, AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }
@Override public ManagedClientConnection getConnection( final long timeout, final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException { Args.notNull(route, "Route"); if (log.isDebugEnabled()) { log.debug("Get connection: " + route + ", timeout = " + timeout); } final BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit); return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry); }
"connection not obtained from this manager"); final BasicPooledConnAdapter hca = (BasicPooledConnAdapter) conn; if (hca.getPoolEntry() != null) { Asserts.check(hca.getManager() == this, "Connection not obtained from this manager"); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); if (entry == null) { return; if (hca.isOpen() && !hca.isMarkedReusable()) { hca.shutdown(); final boolean reusable = hca.isMarkedReusable(); if (log.isDebugEnabled()) { if (reusable) { hca.detach(); pool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(final ThreadSafeClientConnManager tsccm, final AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }
@Override public ManagedClientConnection getConnection( final long timeout, final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException { Args.notNull(route, "Route"); if (log.isDebugEnabled()) { log.debug("Get connection: " + route + ", timeout = " + timeout); } final BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit); return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry); }
"connection not obtained from this manager"); final BasicPooledConnAdapter hca = (BasicPooledConnAdapter) conn; if (hca.getPoolEntry() != null) { Asserts.check(hca.getManager() == this, "Connection not obtained from this manager"); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); if (entry == null) { return; if (hca.isOpen() && !hca.isMarkedReusable()) { hca.shutdown(); final boolean reusable = hca.isMarkedReusable(); if (log.isDebugEnabled()) { if (reusable) { hca.detach(); pool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(ThreadSafeClientConnManager tsccm, AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }
public ManagedClientConnection getConnection( final long timeout, final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException { Args.notNull(route, "Route"); if (log.isDebugEnabled()) { log.debug("Get connection: " + route + ", timeout = " + timeout); } final BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit); return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry); }
"connection not obtained from this manager"); final BasicPooledConnAdapter hca = (BasicPooledConnAdapter) conn; if (hca.getPoolEntry() != null) { Asserts.check(hca.getManager() == this, "Connection not obtained from this manager"); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); if (entry == null) { return; if (hca.isOpen() && !hca.isMarkedReusable()) { hca.shutdown(); final boolean reusable = hca.isMarkedReusable(); if (log.isDebugEnabled()) { if (reusable) { hca.detach(); pool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(final ThreadSafeClientConnManager tsccm, final AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }
public ManagedClientConnection getConnection( final long timeout, final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException { Args.notNull(route, "Route"); if (log.isDebugEnabled()) { log.debug("Get connection: " + route + ", timeout = " + timeout); } final BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit); return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry); }
if ((hca.getPoolEntry() != null) && (hca.getManager() != this)) { throw new IllegalArgumentException ("Connection not obtained from this manager."); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); final Socket socket = entry.getConnection().getSocket(); if (socket != null) { if (hca.isOpen() && !hca.isMarkedReusable()) { if (log.isDebugEnabled()) { log.debug hca.shutdown(); iox); } finally { BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); boolean reusable = hca.isMarkedReusable(); hca.detach(); if (entry != null) { connectionPool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(ThreadSafeClientConnManager tsccm, AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }
public ManagedClientConnection getConnection( long timeout, TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException { if (route == null) { throw new IllegalArgumentException("Route may not be null."); } if (log.isDebugEnabled()) { log.debug("ThreadSafeClientConnManager.getConnection: " + route + ", timeout = " + timeout); } BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit); // BEGIN android-changed // When using a recycled Socket, we need to re-tag it with any // updated statistics options. try { final Socket socket = entry.getConnection().getSocket(); if (socket != null) { SocketTagger.get().tag(socket); } } catch (IOException iox) { log.debug("Problem tagging socket.", iox); } // END android-changed return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry); }
if ((hca.getPoolEntry() != null) && (hca.getManager() != this)) { throw new IllegalArgumentException ("Connection not obtained from this manager."); final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); final Socket socket = entry.getConnection().getSocket(); if (socket != null) { if (hca.isOpen() && !hca.isMarkedReusable()) { if (log.isDebugEnabled()) { log.debug hca.shutdown(); iox); } finally { BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); boolean reusable = hca.isMarkedReusable(); hca.detach(); if (entry != null) { connectionPool.freeEntry(entry, reusable, validDuration, timeUnit);
/** * Creates a new adapter. * * @param tsccm the connection manager * @param entry the pool entry for the connection being wrapped */ protected BasicPooledConnAdapter(final ThreadSafeClientConnManager tsccm, final AbstractPoolEntry entry) { super(tsccm, entry); markReusable(); }