/** * Initiates a message exchange using the given handler. * <p> * Once the endpoint is no longer needed it MUST be released with {@link #releaseAndReuse()} * or {@link #releaseAndDiscard()}. */ public void execute( final AsyncClientExchangeHandler exchangeHandler, final HttpContext context) { execute(exchangeHandler, null, context); }
@Override public void releaseResources() { final AsyncClientEndpoint endpoint = endpointRef.getAndSet(null); if (endpoint != null) { endpoint.releaseAndDiscard(); } }
public void execute() { if (requestCount.decrementAndGet() >= 0) { AsyncClientEndpoint endpoint = endpointRef.get(); if (endpoint != null && !endpoint.isConnected()) { endpoint.releaseAndDiscard(); endpoint = null; endpoint.execute( createRequestProducer(), createResponseConsumer(),
public void execute() { if (requestCount.decrementAndGet() >= 0) { AsyncClientEndpoint endpoint = endpointRef.get(); if (endpoint != null && !endpoint.isConnected()) { endpoint.releaseAndDiscard(); endpoint = null; endpoint.execute( createRequestProducer(), createResponseConsumer(),
/** * Initiates a message exchange using the given request producer and response consumer. * <p> * Once the endpoint is no longer needed it MUST be released with {@link #releaseAndReuse()} * or {@link #releaseAndDiscard()}. */ public final <T> Future<T> execute( final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final FutureCallback<T> callback) { return execute(requestProducer, responseConsumer, null, null, callback); }
@Override public void releaseResources() { final AsyncClientEndpoint endpoint = endpointRef.getAndSet(null); if (endpoint != null) { endpoint.releaseAndDiscard(); } }
/** * Initiates a message exchange using the given request producer and response consumer. * <p> * Once the endpoint is no longer needed it MUST be released with {@link #releaseAndReuse()} * or {@link #releaseAndDiscard()}. */ public final <T> Future<T> execute( final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final FutureCallback<T> callback) { return execute(requestProducer, responseConsumer, null, null, callback); }
/** * Initiates a message exchange using the given handler. * <p> * Once the endpoint is no longer needed it MUST be released with {@link #releaseAndReuse()} * or {@link #releaseAndDiscard()}. */ public void execute( final AsyncClientExchangeHandler exchangeHandler, final HttpContext context) { execute(exchangeHandler, null, context); }
/** * Initiates message exchange using the given request producer and response consumer. * <p> * Once the endpoint is no longer needed it MUST be released with {@link #releaseAndReuse()} * or {@link #releaseAndDiscard()}. */ public final <T> Future<T> execute( final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HttpContext context, final FutureCallback<T> callback) { return execute(requestProducer, responseConsumer, null, context, callback); }
/** * Initiates message exchange using the given request producer and response consumer. * <p> * Once the endpoint is no longer needed it MUST be released with {@link #releaseAndReuse()} * or {@link #releaseAndDiscard()}. */ public final <T> Future<T> execute( final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HttpContext context, final FutureCallback<T> callback) { return execute(requestProducer, responseConsumer, null, context, callback); }
@Override public void completed(final AsyncClientEndpoint endpoint) { endpointRef.set(endpoint); endpoint.execute( createRequestProducer(), createResponseConsumer(), context, new FutureCallback<Void>() { @Override public void completed(final Void result) { execute(); } @Override public void failed(final Exception cause) { execute(); } @Override public void cancelled() { completionLatch.countDown(); } }); }
@Override public void completed(final AsyncClientEndpoint endpoint) { endpointRef.set(endpoint); endpoint.execute( createRequestProducer(), createResponseConsumer(), context, new FutureCallback<Void>() { @Override public void completed(final Void result) { execute(); } @Override public void failed(final Exception cause) { execute(); } @Override public void cancelled() { completionLatch.countDown(); } }); }
final FutureCallback<T> callback) { final BasicFuture<T> future = new BasicFuture<>(callback); execute(new BasicClientExchangeHandler<>(requestProducer, responseConsumer, new FutureCallback<T>() {
final FutureCallback<T> callback) { final BasicFuture<T> future = new BasicFuture<>(callback); execute(new BasicClientExchangeHandler<>(requestProducer, responseConsumer, new FutureCallback<T>() {