@Override public void close() { httpClient.close(); }
@Override public void close() { httpClient.close(); } }
@AfterClass(alwaysRun = true) public void tearDown() { httpClient.close(); httpClient = null; scheduler.shutdownNow(); scheduler = null; scheduledExecutor.shutdownNow(); scheduledExecutor = null; pageBufferClientCallbackExecutor.shutdownNow(); pageBufferClientCallbackExecutor = null; }
@AfterMethod(alwaysRun = true) public void tearDown() { serdeFactory = null; orderingCompiler = null; httpClient.close(); httpClient = null; executor.shutdownNow(); executor = null; exchangeClientFactory.stop(); exchangeClientFactory = null; }
@Override public void close() { httpClient.close(); }
@Override public void close() { httpClient.close(); } }
@Override public void close() { httpClient.close(); }
@PreDestroy public void destroy() { client.close(); } }
public class Client extends AbstractVerticle { // Convenience method so you can run it in your IDE public static void main(String[] args) { Runner.runExample(Client.class); } @Override public void start() throws Exception { HttpClient httpClient = vertx.createHttpClient().getNow(8080, "localhost", "/", resp -> { System.out.println("Got response " + resp.statusCode()); resp.bodyHandler(body -> { System.out.println("Got data " + body.toString("ISO-8859-1")); httpClient.close(); }); }); } }
@AfterMethod(alwaysRun = true) public void tearDown() throws Exception { if (server != null) { server.stop(); } httpClient.close(); }
@AfterMethod(alwaysRun = true) public void tearDown() throws Exception { if (server != null) { server.stop(); } httpClient.close(); }
@AfterClass public void tearDown() throws Exception { httpClient.close(); httpClient = null; executor.shutdownNow(); executor = null; }
HttpClient httpClient = null; // initialize try { try { // do something with httpClient } catch(Exception e) { throw new MyException("request failed : ", e); } finally { httpClient.close(); } } catch (IOException e) { throw new MyException("failed to close server conn: ", e); }
@AfterClass(alwaysRun = true) public void tearDown() { httpClient.close(); httpClient = null; scheduler.shutdownNow(); scheduler = null; scheduledExecutor.shutdownNow(); scheduledExecutor = null; pageBufferClientCallbackExecutor.shutdownNow(); pageBufferClientCallbackExecutor = null; }
@AfterClass(alwaysRun = true) public void tearDown() { httpClient.close(); httpClient = null; scheduler.shutdownNow(); scheduler = null; scheduledExecutor.shutdownNow(); scheduledExecutor = null; pageBufferClientCallbackExecutor.shutdownNow(); pageBufferClientCallbackExecutor = null; }
@AfterMethod(alwaysRun = true) public void tearDown() { serdeFactory = null; orderingCompiler = null; httpClient.close(); httpClient = null; executor.shutdownNow(); executor = null; exchangeClientFactory.stop(); exchangeClientFactory = null; }
@AfterMethod(alwaysRun = true) public void tearDown() { serdeFactory = null; orderingCompiler = null; httpClient.close(); httpClient = null; executor.shutdownNow(); executor = null; exchangeClientFactory.stop(); exchangeClientFactory = null; }