类 GaePendingResult<T,R extends ApiResponse<T>>
java.lang.Object
ai.nextbillion.maps.internal.GaePendingResult<T,R>
- 所有已实现的接口:
PendingResult<T>
public class GaePendingResult<T,R extends ApiResponse<T>> extends java.lang.Object implements PendingResult<T>
A PendingResult backed by a HTTP call executed by Google App Engine URL Fetch capability, a
deserialization step using Gson, and a retry policy.
T is the type of the result of this pending result, and R is the type of the
request.
-
嵌套类概要
-
构造器概要
构造器 构造器 说明 GaePendingResult(com.google.appengine.api.urlfetch.HTTPRequest request, com.google.appengine.api.urlfetch.URLFetchService client, java.lang.Class<R> responseClass, com.google.gson.FieldNamingPolicy fieldNamingPolicy, long errorTimeOut, java.lang.Integer maxRetries, ExceptionsAllowedToRetry exceptionsAllowedToRetry, RequestMetrics metrics) -
方法概要
修饰符和类型 方法 说明 Tawait()Performs the request synchronously.TawaitIgnoreError()Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.voidcancel()Attempts to cancel the request.voidsetCallback(PendingResult.Callback<T> callback)
-
构造器详细资料
-
GaePendingResult
public GaePendingResult(com.google.appengine.api.urlfetch.HTTPRequest request, com.google.appengine.api.urlfetch.URLFetchService client, java.lang.Class<R> responseClass, com.google.gson.FieldNamingPolicy fieldNamingPolicy, long errorTimeOut, java.lang.Integer maxRetries, ExceptionsAllowedToRetry exceptionsAllowedToRetry, RequestMetrics metrics)- 参数:
request- HTTP request to execute.client- The client used to execute the request.responseClass- Model class to unmarshal JSON body content.fieldNamingPolicy- FieldNamingPolicy for unmarshaling JSON.errorTimeOut- Number of milliseconds to re-send erroring requests.maxRetries- Number of times allowed to re-send erroring requests.exceptionsAllowedToRetry- exceptionsAllowedToRetrymetrics- metrics
-
-
方法详细资料
-
setCallback
从接口复制的说明:PendingResultPerforms the request asynchronously, callingonResultoronFailureafter the request has been completed.- 指定者:
setCallback在接口中PendingResult<T>- 参数:
callback- The callback to call on completion.
-
await
从接口复制的说明:PendingResultPerforms the request synchronously.- 指定者:
await在接口中PendingResult<T>- 返回:
- The result.
- 抛出:
ApiException- Thrown if the API Returned result is an error.java.io.IOException- Thrown when an I/O exception of some sort has occurred.java.lang.InterruptedException- Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted.
-
awaitIgnoreError
从接口复制的说明:PendingResultPerforms the request synchronously, ignoring exceptions while performing the request and errors returned by the server.- 指定者:
awaitIgnoreError在接口中PendingResult<T>- 返回:
- The result, or null if there was any error or exception ignored.
-
cancel
public void cancel()从接口复制的说明:PendingResultAttempts to cancel the request.- 指定者:
cancel在接口中PendingResult<T>
-