Tabnine Logo
ListenableFuture$CompletedFailure
Code IndexAdd Tabnine to your IDE (free)

How to use
ListenableFuture$CompletedFailure
in
com.ning.http.client

Best Java code snippets using com.ning.http.client.ListenableFuture$CompletedFailure (Showing top 8 results out of 315)

origin: com.ning/async-http-client

IOException e = new IOException("AsyncHttpClient has been closed.");
asyncHandler.onThrowable(e);
return new ListenableFuture.CompletedFailure<>(e);
origin: javaee/grizzly-ahc

IOException e = new IOException("AsyncHttpClient has been closed.");
asyncHandler.onThrowable(e);
return new ListenableFuture.CompletedFailure<>(e);
origin: org.glassfish.grizzly/grizzly-http-client

IOException e = new IOException("AsyncHttpClient has been closed.");
asyncHandler.onThrowable(e);
return new ListenableFuture.CompletedFailure<>(e);
origin: javaee/grizzly-ahc

/**
 * Execute an HTTP request.
 *
 * @param request {@link Request}
 * @param handler an instance of {@link AsyncHandler}
 * @param <T>     Type of the value that will be returned by the associated {@link java.util.concurrent.Future}
 * @return a {@link Future} of type T
 */
public <T> ListenableFuture<T> executeRequest(Request request, AsyncHandler<T> handler) {
  if (config.getRequestFilters().isEmpty()) {
    return httpProvider.execute(request, handler);
  } else {
    FilterContext<T> fc = new FilterContext.FilterContextBuilder<T>().asyncHandler(handler).request(request).build();
    try {
      fc = preProcessRequest(fc);
    } catch (Exception e) {
      handler.onThrowable(e);
      return new ListenableFuture.CompletedFailure<T>("preProcessRequest failed", e);
    }
    
    return httpProvider.execute(fc.getRequest(), fc.getAsyncHandler());
  }
}
origin: org.glassfish.grizzly/grizzly-http-client

/**
 * Execute an HTTP request.
 *
 * @param request {@link Request}
 * @param handler an instance of {@link AsyncHandler}
 * @param <T>     Type of the value that will be returned by the associated {@link java.util.concurrent.Future}
 * @return a {@link Future} of type T
 */
public <T> ListenableFuture<T> executeRequest(Request request, AsyncHandler<T> handler) {
  if (config.getRequestFilters().isEmpty()) {
    return httpProvider.execute(request, handler);
  } else {
    FilterContext<T> fc = new FilterContext.FilterContextBuilder<T>().asyncHandler(handler).request(request).build();
    try {
      fc = preProcessRequest(fc);
    } catch (Exception e) {
      handler.onThrowable(e);
      return new ListenableFuture.CompletedFailure<T>("preProcessRequest failed", e);
    }
    
    return httpProvider.execute(fc.getRequest(), fc.getAsyncHandler());
  }
}
origin: com.ning/async-http-client

/**
 * Execute an HTTP request.
 *
 * @param request {@link Request}
 * @param handler an instance of {@link AsyncHandler}
 * @param <T>     Type of the value that will be returned by the associated {@link java.util.concurrent.Future}
 * @return a {@link Future} of type T
 */
public <T> ListenableFuture<T> executeRequest(Request request, AsyncHandler<T> handler) {
  if (config.getRequestFilters().isEmpty()) {
    return httpProvider.execute(request, handler);
  } else {
    FilterContext<T> fc = new FilterContext.FilterContextBuilder<T>().asyncHandler(handler).request(request).build();
    try {
      fc = preProcessRequest(fc);
    } catch (Exception e) {
      handler.onThrowable(e);
      return new ListenableFuture.CompletedFailure<T>("preProcessRequest failed", e);
    }
    
    return httpProvider.execute(fc.getRequest(), fc.getAsyncHandler());
  }
}
origin: com.ning/async-http-client

public <T> ListenableFuture<T> execute(Request request, AsyncHandler<T> handler) {
  try {
    return execute(request, handler, null);
  } catch (IOException e) {
    handler.onThrowable(e);
    return new ListenableFuture.CompletedFailure<>(e);
  }
}
origin: com.ning/async-http-client

@Override
public <T> ListenableFuture<T> execute(Request request, final AsyncHandler<T> asyncHandler) {
  try {
    return requestSender.sendRequest(request, asyncHandler, null, false);
  } catch (Exception e) {
    asyncHandler.onThrowable(e);
    return new ListenableFuture.CompletedFailure<>(e);
  }
}
com.ning.http.clientListenableFuture$CompletedFailure

Most used methods

  • <init>

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JOptionPane (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now