public void closeExpiredConnections() { delegate.closeExpiredConnections(); }
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE") public void run() { if (cm.get() != null) { cm.get().closeExpiredConnections(); } else if (thisFuture != null) { thisFuture.cancel(false); } }
@Override public void run() { try { while (!shutdown) { synchronized (this) { wait(5000); // Close expired connections connMgr.closeExpiredConnections(); // Optionally, close connections // that have been idle longer than 30 sec connMgr.closeIdleConnections(30, TimeUnit.SECONDS); } } } catch (InterruptedException ex) { // terminate } }
@Override public void run() { try { while (!shutdown) { synchronized (this) { wait(5000); // Close expired connections connMgr.closeExpiredConnections(); // Optionally, close connections // that have been idle longer than 30 sec connMgr.closeIdleConnections(30, TimeUnit.SECONDS); } } } catch (InterruptedException ex) { // terminate } }
@Override public void run() { try { while (!shutdown) { synchronized (this) { wait(5000); // Close expired connections connMgr.closeExpiredConnections(); // Optionally, close connections // that have been idle longer than 30 sec connMgr.closeIdleConnections(30, TimeUnit.SECONDS); } } } catch (InterruptedException ex) { // terminate } }
@Override public void run() { try { while (!shutdown) { synchronized (this) { wait(5000); // Close expired connections connMgr.closeExpiredConnections(); // Optionally, close connections // that have been idle longer than 30 sec connMgr.closeIdleConnections(30, TimeUnit.SECONDS); } } } catch (InterruptedException ex) { // terminate } }
/** * Start the cleaner. */ @Override public void run() { try { while (!shutdown) { synchronized (this) { wait(timeBetweenEvictionRunsMillis); // Close expired connections connMgr.closeExpiredConnections(); // Close connections that have been idle longer than x sec connMgr.closeIdleConnections(minEvictableIdleTimeMillis, TimeUnit.MILLISECONDS); } } } catch (InterruptedException ex) { // terminate } }
public void run(){ while(true){ try{ Thread.sleep(2000); synchronized(clients){ for(String key : clients.keySet()){ HttpClientEntry entry = clients.get(key); if(entry != null){ entry.httpClient.getConnectionManager().closeExpiredConnections(); entry.httpClient.getConnectionManager().closeIdleConnections(30, TimeUnit.SECONDS); } } } }catch(Exception e){ e.printStackTrace(); } } } }, "IdleConnectionMonitorThread");
public void cleanup( final HttpRequestBase request ) { request.abort(); client.getConnectionManager() .closeExpiredConnections(); client.getConnectionManager() .closeIdleConnections( 2, TimeUnit.SECONDS ); } }
@Override public void run() { try { while (!shutdown) { synchronized (this) { wait(5000); // Close expired connections log.trace("Closing expired connections."); connMgr.closeExpiredConnections(); // Optionally, close connections // that have been idle longer than 30 sec log.trace("Closing connections idle 30s or longer."); connMgr.closeIdleConnections(30, TimeUnit.SECONDS); } } } catch (InterruptedException ex) { log.trace("Terminating."); // terminate } }
@Override public void onBeforeExit() { super.clear(); //close expired connections. HttpConnectionManager.getHttpClient().getConnectionManager().closeExpiredConnections(); }
/** 关闭网络连接 */ public void close() { if (mRequestBase != null) { mRequestBase.abort(); } IOUtils.closeQuietly(mIn); if (mHttpClient != null) { mHttpClient.getConnectionManager().closeExpiredConnections(); } } }
@Override public void run() { try { startupLatch.countDown(); // While shutdown has not been called and the thread has not // been interrupted do the following. while (!shutdown && !isInterrupted()) { try { Thread.sleep(idleCheckInterval); } catch (InterruptedException interrupted) { continue; } httpClient.getConnectionManager().closeExpiredConnections(); httpClient.getConnectionManager().closeIdleConnections( idleTimeOut, TimeUnit.MILLISECONDS); } } finally { shutdownLatch.countDown(); } }
public void run() { try { while (!shutdown) { synchronized (this) { wait(1000); for (ClientConnectionManager connectionManager : connectionManagers) { connectionManager.closeExpiredConnections(); // TODO constant connectionManager.closeIdleConnections(30, TimeUnit.SECONDS); } } } } catch (InterruptedException ex) { shutdown(); } }
public void run() { try { while (!shutdown) { synchronized (this) { wait(1000); for (ClientConnectionManager connectionManager : connectionManagers) { connectionManager.closeExpiredConnections(); // TODO constant connectionManager.closeIdleConnections(30, TimeUnit.SECONDS); } } } } catch (InterruptedException ex) { shutdown(); } }
void cleanupConnections(){ connMgr.closeExpiredConnections(); connMgr.closeIdleConnections(connIdleEvictTimeMilliSeconds.get(), TimeUnit.MILLISECONDS); }
@Override public void run() { ASConnection asConnection = asConnectionWeakReference.get(); if (asConnection != null && !asConnection.shutdown) { try { asConnection.httpClient.getConnectionManager().closeExpiredConnections(); // Defensive call to close idle connections asConnection.httpClient.getConnectionManager().closeIdleConnections(asConnection.keepAliveTimeout, TimeUnit.MILLISECONDS); } finally { // Keep cleaning the target ASConnection while it has not been marked for collection cleanerExecutor.schedule(new ConnectionManagerCleaner(asConnection), asConnection.keepAliveTimeout, TimeUnit.MILLISECONDS); } } } }
@Override public void stop() throws Exception { if (this.idleConnectionReaper != null) { this.idleConnectionReaper.stop(); } if (getHttpClient() != null) { getHttpClient().getConnectionManager().closeExpiredConnections(); getHttpClient().getConnectionManager().closeIdleConnections( getStopIdleTimeout(), TimeUnit.MILLISECONDS); getHttpClient().getConnectionManager().shutdown(); getLogger().info("Stopping the HTTP client"); } }
void cleanConnections() { httpclient.getConnectionManager().closeExpiredConnections(); httpclient.getConnectionManager().closeIdleConnections(2 * properties.getSocketTimeout(), TimeUnit.MILLISECONDS); }
void cleanConnections() { httpclient.getConnectionManager().closeExpiredConnections(); httpclient.getConnectionManager().closeIdleConnections(2 * properties.getSocketTimeout(), TimeUnit.MILLISECONDS); }