.class public Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler; .super Ljava/lang/Object; .source "DefaultHttpRequestRetryHandler.java" # interfaces .implements Lorg/apache/http/client/HttpRequestRetryHandler; # static fields .field public static final INSTANCE:Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler; # instance fields .field private final nonRetriableClasses:Ljava/util/Set; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/Set<", "Ljava/lang/Class<", "+", "Ljava/io/IOException;", ">;>;" } .end annotation .end field .field private final requestSentRetryEnabled:Z .field private final retryCount:I # direct methods .method static constructor ()V .registers 1 .line 59 new-instance v0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler; invoke-direct {v0}, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->()V sput-object v0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->INSTANCE:Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler; return-void .end method .method public constructor ()V .registers 3 const/4 v0, 0x3 const/4 v1, 0x0 .line 122 invoke-direct {p0, v0, v1}, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->(IZ)V return-void .end method .method public constructor (IZ)V .registers 6 const/4 v0, 0x4 .line 104 new-array v0, v0, [Ljava/lang/Class; const/4 v1, 0x0 const-class v2, Ljava/io/InterruptedIOException; aput-object v2, v0, v1 const/4 v1, 0x1 const-class v2, Ljava/net/UnknownHostException; aput-object v2, v0, v1 const/4 v1, 0x2 const-class v2, Ljava/net/ConnectException; aput-object v2, v0, v1 const/4 v1, 0x3 const-class v2, Ljavax/net/ssl/SSLException; aput-object v2, v0, v1 invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List; move-result-object v0 invoke-direct {p0, p1, p2, v0}, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->(IZLjava/util/Collection;)V return-void .end method .method protected constructor (IZLjava/util/Collection;)V .registers 4 .annotation system Ldalvik/annotation/Signature; value = { "(IZ", "Ljava/util/Collection<", "Ljava/lang/Class<", "+", "Ljava/io/IOException;", ">;>;)V" } .end annotation .line 81 invoke-direct {p0}, Ljava/lang/Object;->()V .line 82 iput p1, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->retryCount:I .line 83 iput-boolean p2, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->requestSentRetryEnabled:Z .line 84 new-instance p1, Ljava/util/HashSet; invoke-direct {p1}, Ljava/util/HashSet;->()V iput-object p1, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->nonRetriableClasses:Ljava/util/Set; .line 85 invoke-interface {p3}, Ljava/util/Collection;->iterator()Ljava/util/Iterator; move-result-object p1 :goto_12 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result p2 if-eqz p2, :cond_24 invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object p2 check-cast p2, Ljava/lang/Class; .line 86 iget-object p3, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->nonRetriableClasses:Ljava/util/Set; invoke-interface {p3, p2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z goto :goto_12 :cond_24 return-void .end method # virtual methods .method public getRetryCount()I .registers 2 .line 181 iget v0, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->retryCount:I return v0 .end method .method protected handleAsIdempotent(Lorg/apache/http/HttpRequest;)Z .registers 2 .line 188 instance-of p1, p1, Lorg/apache/http/HttpEntityEnclosingRequest; xor-int/lit8 p1, p1, 0x1 return p1 .end method .method public isRequestSentRetryEnabled()Z .registers 2 .line 174 iget-boolean v0, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->requestSentRetryEnabled:Z return v0 .end method .method protected requestIsAborted(Lorg/apache/http/HttpRequest;)Z .registers 3 .annotation runtime Ljava/lang/Deprecated; .end annotation .line 199 instance-of v0, p1, Lorg/apache/http/impl/client/RequestWrapper; if-eqz v0, :cond_a .line 200 check-cast p1, Lorg/apache/http/impl/client/RequestWrapper; invoke-virtual {p1}, Lorg/apache/http/impl/client/RequestWrapper;->getOriginal()Lorg/apache/http/HttpRequest; move-result-object p1 .line 202 :cond_a instance-of v0, p1, Lorg/apache/http/client/methods/HttpUriRequest; if-eqz v0, :cond_18 check-cast p1, Lorg/apache/http/client/methods/HttpUriRequest; invoke-interface {p1}, Lorg/apache/http/client/methods/HttpUriRequest;->isAborted()Z move-result p1 if-eqz p1, :cond_18 const/4 p1, 0x1 goto :goto_19 :cond_18 const/4 p1, 0x0 :goto_19 return p1 .end method .method public retryRequest(Ljava/io/IOException;ILorg/apache/http/protocol/HttpContext;)Z .registers 6 .line 133 const-string v0, "Exception parameter" invoke-static {p1, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 134 const-string v0, "HTTP context" invoke-static {p3, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 135 iget v0, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->retryCount:I const/4 v1, 0x0 if-le p2, v0, :cond_10 return v1 .line 139 :cond_10 iget-object p2, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->nonRetriableClasses:Ljava/util/Set; invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v0 invoke-interface {p2, v0}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z move-result p2 if-eqz p2, :cond_1d return v1 .line 142 :cond_1d iget-object p2, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->nonRetriableClasses:Ljava/util/Set; invoke-interface {p2}, Ljava/util/Set;->iterator()Ljava/util/Iterator; move-result-object p2 :cond_23 invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z move-result v0 if-eqz v0, :cond_36 invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/Class; .line 143 invoke-virtual {v0, p1}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_23 return v1 .line 148 :cond_36 invoke-static {p3}, Lorg/apache/http/client/protocol/HttpClientContext;->adapt(Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/protocol/HttpClientContext; move-result-object p1 .line 149 invoke-virtual {p1}, Lorg/apache/http/client/protocol/HttpClientContext;->getRequest()Lorg/apache/http/HttpRequest; move-result-object p2 .line 151 invoke-virtual {p0, p2}, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->requestIsAborted(Lorg/apache/http/HttpRequest;)Z move-result p3 if-eqz p3, :cond_45 return v1 .line 155 :cond_45 invoke-virtual {p0, p2}, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->handleAsIdempotent(Lorg/apache/http/HttpRequest;)Z move-result p2 const/4 p3, 0x1 if-eqz p2, :cond_4d return p3 .line 160 :cond_4d invoke-virtual {p1}, Lorg/apache/http/client/protocol/HttpClientContext;->isRequestSent()Z move-result p1 if-eqz p1, :cond_59 iget-boolean p1, p0, Lorg/apache/http/impl/client/DefaultHttpRequestRetryHandler;->requestSentRetryEnabled:Z if-eqz p1, :cond_58 goto :goto_59 :cond_58 return v1 :cond_59 :goto_59 return p3 .end method