@Test public void positiveMaxIdleTime() { new ApacheClient.Builder().withMaxIdleTime(100).build().shutdown(true, 0); }
@Override public ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout) { final SettableFuture<Integer> future = SettableFuture.create(); final Thread t = new Thread(getShutdownRunnable(future, immediate, timeout)); t.setName("client-shutdown"); this.running = false; t.start(); return future; }
ApacheClient implements Client { @Override public ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout) { final SettableFuture<Integer> future = SettableFuture.create(); final Thread t = new Thread(getShutdownRunnable(future, immediate, timeout)); t.setName("client-shutdown"); this.running = false; t.start(); return future; } }
ApacheClient implements Client { @Override public ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout) { final SettableFuture<Integer> future = SettableFuture.create(); final Thread t = new Thread(getShutdownRunnable(future, immediate, timeout)); t.setName("client-shutdown"); this.running = false; t.start(); return future; } private  ApacheClient(final Builder builder); }
ApacheClient implements Client { @Override public ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout) { final SettableFuture<Integer> future = SettableFuture.create(); final Thread t = new Thread(getShutdownRunnable(future, immediate, timeout)); t.setName("client-shutdown"); this.running = false; t.start(); return future; } private  ApacheClient(final Builder builder); @Override ListenableFuture<Response> execute(final Request request); @Override ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout); @Override String toString(); }
ApacheClient implements Client { @Override public ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout) { final SettableFuture<Integer> future = SettableFuture.create(); final Thread t = new Thread(getShutdownRunnable(future, immediate, timeout)); t.setName("client-shutdown"); this.running = false; t.start(); return future; } private  ApacheClient(final Builder builder); @Override ListenableFuture<Response> execute(final Request request); @Override ListenableFuture<Integer> shutdown(final boolean immediate, final int timeout); @Override String toString();  }