@Override public void close() throws IOException { client.destroy(); } }
public void close() { flush(); client.destroy(); scheduler.shutdown(); }
client.destroy();
client.destroy();
@Override public void close() throws IOException { if (httpClient != null) { httpClient.destroy(); httpClient = null; } }
@Override public void close() throws IOException { client.destroy(); }
/** * Defer to {@link #destroy() } */ @Override @SuppressWarnings("FinalizeDeclaration") protected void finalize() throws Throwable { destroy(); super.finalize(); }
@Override public void teardown() { if (wsClient != null) { wsClient.destroy(); } super.teardown(); }
@Override public void teardown() { if (wsClient != null) { wsClient.destroy(); } super.teardown(); }
@Override protected void finalize() throws Throwable{ try { // Do not close the AHCClient. super.destroy(); } finally { super.finalize(); } }
@Override protected void finalize(){ try { // Do not close the AHCClient. super.destroy(); } finally { super.finalize(); } }
@Override public void cleanup() { try { this.client.getJerseyClient().destroy(); this.client.close(); } catch (IOException e) { LOG.error("Close client error: {}", e.getMessage(), e); } finally { super.cleanup(); } }
@Override public void destroy(){ try{ clientHandler.getHttpClient().close(); } finally { super.destroy(); } }
@Override public void destroy(){ try{ clientHandler.getHttpClient().close(); } finally { super.destroy(); } }
void handleClientHandlerException(ClientHandlerException che) { if (isRetryableException(che)) { atlasClientContext.getClient().destroy(); LOG.warn("Destroyed current context while handling ClientHandlerEception."); LOG.warn("Will retry and create new context."); sleepBetweenRetries(); initializeState(atlasClientContext.getBaseUrls(), atlasClientContext.getUgi(), atlasClientContext.getDoAsUser()); return; } throw che; }
void handleClientHandlerException(ClientHandlerException che) { if (isRetryableException(che)) { atlasClientContext.getClient().destroy(); LOG.warn("Destroyed current context while handling ClientHandlerEception."); LOG.warn("Will retry and create new context."); sleepBetweenRetries(); initializeState(atlasClientContext.getBaseUrls(), atlasClientContext.getUgi(), atlasClientContext.getDoAsUser()); return; } throw che; }
void handleClientHandlerException(ClientHandlerException che) { if (isRetryableException(che)) { atlasClientContext.getClient().destroy(); LOG.warn("Destroyed current context while handling ClientHandlerEception."); LOG.warn("Will retry and create new context."); sleepBetweenRetries(); initializeState(atlasClientContext.getBaseUrls(), atlasClientContext.getUgi(), atlasClientContext.getDoAsUser()); return; } throw che; }
@Test public void testGetEntityNotPresent() throws Exception { Client client = createClient(); try { URI uri = URI.create("http://localhost:" + serverPort + "/ws/v2/" + "timeline/clusters/cluster1/apps/app1/entities/app/id_10"); verifyHttpResponse(client, uri, Status.NOT_FOUND); } finally { client.destroy(); } }
@Override protected void triggerLeak() { Client client = ApacheHttpClient.create(new DefaultClientConfig()); try { // it doesn't matter where we make our call, we only want to initiate connections to create the leak WebResource webResource = client.resource("http://localhost:1234"); webResource.accept("application/json").get(ClientResponse.class); } catch (Throwable ex) { //exception thrown for a non existing url, we do not need to call a real url, only to start the relevant leaking classes } client.destroy(); }
@Override protected void triggerLeak() { Client client = ApacheHttpClient.create(new DefaultClientConfig()); try { // it doesn't matter where we make our call, we only want to initiate connections to create the leak WebResource webResource = client.resource("http://localhost:1234"); webResource.accept("application/json").get(ClientResponse.class); } catch (Throwable ex) { //exception thrown for a non existing url, we do not need to call a real url, only to start the relevant leaking classes } client.destroy(); }