public void closeExpiredConnections() { synchronized (this) { assertNotShutdown(); final long now = System.currentTimeMillis(); if (this.poolEntry != null && this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
@Override public void closeExpiredConnections() { synchronized (this) { assertNotShutdown(); final long now = System.currentTimeMillis(); if (this.poolEntry != null && this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
public void closeExpiredConnections() { synchronized (this) { assertNotShutdown(); final long now = System.currentTimeMillis(); if (this.poolEntry != null && this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
@Override public void closeExpiredConnections() { synchronized (this) { assertNotShutdown(); final long now = System.currentTimeMillis(); if (this.poolEntry != null && this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
public void closeIdleConnections(final long idletime, final TimeUnit tunit) { Args.notNull(tunit, "Time unit"); synchronized (this) { assertNotShutdown(); long time = tunit.toMillis(idletime); if (time < 0) { time = 0; } final long deadline = System.currentTimeMillis() - time; if (this.poolEntry != null && this.poolEntry.getUpdated() <= deadline) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
public void closeIdleConnections(final long idletime, final TimeUnit tunit) { Args.notNull(tunit, "Time unit"); synchronized (this) { assertNotShutdown(); long time = tunit.toMillis(idletime); if (time < 0) { time = 0; } final long deadline = System.currentTimeMillis() - time; if (this.poolEntry != null && this.poolEntry.getUpdated() <= deadline) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
@Override public void closeIdleConnections(final long idletime, final TimeUnit tunit) { Args.notNull(tunit, "Time unit"); synchronized (this) { assertNotShutdown(); long time = tunit.toMillis(idletime); if (time < 0) { time = 0; } final long deadline = System.currentTimeMillis() - time; if (this.poolEntry != null && this.poolEntry.getUpdated() <= deadline) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
@Override public void closeIdleConnections(final long idletime, final TimeUnit tunit) { Args.notNull(tunit, "Time unit"); synchronized (this) { assertNotShutdown(); long time = tunit.toMillis(idletime); if (time < 0) { time = 0; } final long deadline = System.currentTimeMillis() - time; if (this.poolEntry != null && this.poolEntry.getUpdated() <= deadline) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } } }
ManagedClientConnection getConnection(final HttpRoute route, final Object state) { Args.notNull(route, "Route"); synchronized (this) { assertNotShutdown(); if (this.log.isDebugEnabled()) { this.log.debug("Get connection for route " + route); } Asserts.check(this.conn == null, MISUSE_MESSAGE); if (this.poolEntry != null && !this.poolEntry.getPlannedRoute().equals(route)) { this.poolEntry.close(); this.poolEntry = null; } if (this.poolEntry == null) { final String id = Long.toString(COUNTER.getAndIncrement()); final OperatedClientConnection conn = this.connOperator.createConnection(); this.poolEntry = new HttpPoolEntry(this.log, id, route, conn, 0, TimeUnit.MILLISECONDS); } final long now = System.currentTimeMillis(); if (this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } this.conn = new ManagedClientConnectionImpl(this, this.connOperator, this.poolEntry); return this.conn; } }
ManagedClientConnection getConnection(final HttpRoute route, final Object state) { Args.notNull(route, "Route"); synchronized (this) { assertNotShutdown(); if (this.log.isDebugEnabled()) { this.log.debug("Get connection for route " + route); } Asserts.check(this.conn == null, MISUSE_MESSAGE); if (this.poolEntry != null && !this.poolEntry.getPlannedRoute().equals(route)) { this.poolEntry.close(); this.poolEntry = null; } if (this.poolEntry == null) { final String id = Long.toString(COUNTER.getAndIncrement()); final OperatedClientConnection opconn = this.connOperator.createConnection(); this.poolEntry = new HttpPoolEntry(this.log, id, route, opconn, 0, TimeUnit.MILLISECONDS); } final long now = System.currentTimeMillis(); if (this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } this.conn = new ManagedClientConnectionImpl(this, this.connOperator, this.poolEntry); return this.conn; } }
ManagedClientConnection getConnection(final HttpRoute route, final Object state) { Args.notNull(route, "Route"); synchronized (this) { assertNotShutdown(); if (this.log.isDebugEnabled()) { this.log.debug("Get connection for route " + route); } Asserts.check(this.conn == null, MISUSE_MESSAGE); if (this.poolEntry != null && !this.poolEntry.getPlannedRoute().equals(route)) { this.poolEntry.close(); this.poolEntry = null; } if (this.poolEntry == null) { final String id = Long.toString(COUNTER.getAndIncrement()); final OperatedClientConnection opconn = this.connOperator.createConnection(); this.poolEntry = new HttpPoolEntry(this.log, id, route, opconn, 0, TimeUnit.MILLISECONDS); } final long now = System.currentTimeMillis(); if (this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } this.conn = new ManagedClientConnectionImpl(this, this.connOperator, this.poolEntry); return this.conn; } }
ManagedClientConnection getConnection(final HttpRoute route, final Object state) { Args.notNull(route, "Route"); synchronized (this) { assertNotShutdown(); if (this.log.isDebugEnabled()) { this.log.debug("Get connection for route " + route); } Asserts.check(this.conn == null, MISUSE_MESSAGE); if (this.poolEntry != null && !this.poolEntry.getPlannedRoute().equals(route)) { this.poolEntry.close(); this.poolEntry = null; } if (this.poolEntry == null) { final String id = Long.toString(COUNTER.getAndIncrement()); final OperatedClientConnection opconn = this.connOperator.createConnection(); this.poolEntry = new HttpPoolEntry(this.log, id, route, opconn, 0, TimeUnit.MILLISECONDS); } final long now = System.currentTimeMillis(); if (this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } this.conn = new ManagedClientConnectionImpl(this, this.connOperator, this.poolEntry); return this.conn; } }