Tabnine Logo
ListenableFuture$CompletedFailure.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using com.ning.http.client.ListenableFuture$CompletedFailure.<init> (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: 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: 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

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

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<init>

Popular methods of ListenableFuture$CompletedFailure

    Popular in Java

    • Making http requests using okhttp
    • onCreateOptionsMenu (Activity)
    • scheduleAtFixedRate (Timer)
    • setRequestProperty (URLConnection)
    • GridBagLayout (java.awt)
      The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
    • EOFException (java.io)
      Thrown when a program encounters the end of a file or stream during an input operation.
    • FileReader (java.io)
      A specialized Reader that reads from a file in the file system. All read requests made by calling me
    • MessageDigest (java.security)
      Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
    • Enumeration (java.util)
      A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
    • Filter (javax.servlet)
      A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
    • Top plugins for Android Studio
    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