public abstract class AsyncHttpStack extends BaseHttpStack
BaseHttpStack class.
WARNING: This API is experimental and subject to breaking changes. Please see https://github.com/google/volley/wiki/Asynchronous-Volley for more details.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AsyncHttpStack.OnRequestComplete |
| Constructor and Description |
|---|
AsyncHttpStack() |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
executeRequest(Request<?> request,
java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
Performs an HTTP request with the given parameters.
|
abstract void |
executeRequest(Request<?> request,
java.util.Map<java.lang.String,java.lang.String> additionalHeaders,
AsyncHttpStack.OnRequestComplete callback)
Makes an HTTP request with the given parameters, and calls the
AsyncHttpStack.OnRequestComplete
callback, with either the HttpResponse or error that was thrown. |
protected java.util.concurrent.ExecutorService |
getBlockingExecutor()
Gets blocking executor to perform any potentially blocking tasks.
|
protected java.util.concurrent.ExecutorService |
getNonBlockingExecutor()
Gets non-blocking executor to perform any non-blocking tasks.
|
void |
setBlockingExecutor(java.util.concurrent.ExecutorService executor)
This method sets the blocking executor to be used by the stack for potentially blocking
tasks.
|
void |
setNonBlockingExecutor(java.util.concurrent.ExecutorService executor)
This method sets the non blocking executor to be used by the stack for non-blocking tasks.
|
performRequestpublic abstract void executeRequest(Request<?> request, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, AsyncHttpStack.OnRequestComplete callback)
AsyncHttpStack.OnRequestComplete
callback, with either the HttpResponse or error that was thrown.request - to performadditionalHeaders - to be sent together with Request.getHeaders()callback - to be called after retrieving the HttpResponse or throwing an error.public void setNonBlockingExecutor(java.util.concurrent.ExecutorService executor)
public void setBlockingExecutor(java.util.concurrent.ExecutorService executor)
protected java.util.concurrent.ExecutorService getBlockingExecutor()
protected java.util.concurrent.ExecutorService getNonBlockingExecutor()
public final HttpResponse executeRequest(Request<?> request, java.util.Map<java.lang.String,java.lang.String> additionalHeaders) throws java.io.IOException, AuthFailureError
executeRequest in class BaseHttpStackrequest - the request to performadditionalHeaders - additional headers to be sent together with Request.getHeaders()HttpResponsejava.io.IOException - if an I/O error occurs during the requestAuthFailureError - if an authentication failure occurs during the request