public void closeIdleConnections(long idletime, TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there if (tunit == null) { throw new IllegalArgumentException("Time unit must not be null."); } if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } }
/** * Creates a new simple connection manager. * * @param params the parameters for this manager * @param schreg the scheme registry */ public SingleClientConnManager(HttpParams params, SchemeRegistry schreg) { if (schreg == null) { throw new IllegalArgumentException ("Scheme registry must not be null."); } this.schemeRegistry = schreg; this.connOperator = createConnectionOperator(schreg); this.uniquePoolEntry = new PoolEntry(); this.managedConn = null; this.lastReleaseTime = -1L; this.alwaysShutDown = false; //@@@ from params? as argument? this.isShutDown = false; } // <constructor>
public void closeIdleConnections(long idletime, TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there if (tunit == null) { throw new IllegalArgumentException("Time unit must not be null."); } if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } }
/** * Creates a new simple connection manager. * * @param params the parameters for this manager * @param schreg the scheme registry */ public SingleClientConnManager(HttpParams params, SchemeRegistry schreg) { if (schreg == null) { throw new IllegalArgumentException ("Scheme registry must not be null."); } this.schemeRegistry = schreg; this.connOperator = createConnectionOperator(schreg); this.uniquePoolEntry = new PoolEntry(); this.managedConn = null; this.lastReleaseTime = -1L; this.alwaysShutDown = false; //@@@ from params? as argument? this.isShutDown = false; } // <constructor>
@Override public void closeIdleConnections(final long idletime, final TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there Args.notNull(tunit, "Time unit"); synchronized (this) { if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (final IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } } }
/** * Creates a new simple connection manager. * * @param params the parameters for this manager * @param schreg the scheme registry */ public SingleClientConnManager(HttpParams params, SchemeRegistry schreg) { if (schreg == null) { throw new IllegalArgumentException ("Scheme registry must not be null."); } this.schemeRegistry = schreg; this.connOperator = createConnectionOperator(schreg); this.uniquePoolEntry = new PoolEntry(); this.managedConn = null; this.lastReleaseTime = -1L; this.alwaysShutDown = false; //@@@ from params? as argument? this.isShutDown = false; } // <constructor>
public void closeIdleConnections(long idletime, TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there if (tunit == null) { throw new IllegalArgumentException("Time unit must not be null."); } if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } }
public void closeIdleConnections(long idletime, TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there if (tunit == null) { throw new IllegalArgumentException("Time unit must not be null."); } if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } }
@Override public void closeIdleConnections(final long idletime, final TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there Args.notNull(tunit, "Time unit"); synchronized (this) { if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (final IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } } }
public void closeIdleConnections(final long idletime, final TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there Args.notNull(tunit, "Time unit"); synchronized (this) { if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (final IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } } }
public void closeIdleConnections(final long idletime, final TimeUnit tunit) { assertStillUp(); // idletime can be 0 or negative, no problem there Args.notNull(tunit, "Time unit"); synchronized (this) { if ((managedConn == null) && uniquePoolEntry.connection.isOpen()) { final long cutoff = System.currentTimeMillis() - tunit.toMillis(idletime); if (lastReleaseTime <= cutoff) { try { uniquePoolEntry.close(); } catch (final IOException iox) { // ignore log.debug("Problem closing idle connection.", iox); } } } } }