@Override public void stop() throws Exception { client.close(); } });
@Override public void shutdown() { jersey2Client.close(); }
public void cleanup() { client.close(); }
@Override public void close() { client.close(); }
@Override public void close() throws IOException { if (this.client != null) { try { this.client.close(); } catch (Exception e) { } } }
/** * Clean up resources. */ @Override public void destroyResources() { if (eurekaConnCleaner != null) { // Execute the connection cleaner one final time during shutdown eurekaConnCleaner.execute(connectionCleanerTask); eurekaConnCleaner.shutdown(); } if (apacheHttpClient != null) { apacheHttpClient.close(); } }
@Override public void after() { if (recursiveCallCount.decrementAndGet() == 0) { testSupport.after(); synchronized (this) { if (client != null) { client.close(); } } } }
@Override protected void after() { if (recursiveCallCount.decrementAndGet() == 0) { testSupport.after(); synchronized (this) { if (client != null) { client.close(); } } } }
/** * Utility method that safely closes a client instance without throwing an exception. * * @param clients client instances to close. Each instance may be {@code null}. * @since 2.5 */ public static void closeIfNotNull(final Client... clients) { if (clients == null || clients.length == 0) { return; } for (final Client c : clients) { if (c == null) { continue; } try { c.close(); } catch (final Throwable t) { LOGGER.log(Level.WARNING, "Error closing a client instance.", t); } } }
@TearDown public void shutdown() { client.close(); }
@Override public void close() throws IOException { checkNotNull(client, "Factory not initialized. You probably forgot to call init()!"); client.close(); connManager.close(); }
@OnStopped public void destroyClient() { if (client != null) { client.close(); } }
@Override public void close() throws IOException { if (!Strings.isNullOrEmpty(slackConfig.shutdownMsg())) { post(slackConfig.shutdownMsg()); } client.close(); } }
client.close();
@After public void cleanUp() { restClient.close(); }
client.close();
@Override protected void resetHttpClient() { if (myNativeClient != null) myNativeClient.close(); // close client to avoid memory leak myNativeClient = null; }
@AfterClass public static void stopRestClient() throws IOException { if (client != null) { client.close(); client = null; } if (esClient != null) { esClient.close(); esClient = null; } }
@After public void tearDown() { services.forEach(Service::stop); stopTailers(); CLUSTER.stop(); if (client != null) { client.close(); } }