.class public Lorg/apache/http/concurrent/BasicFuture; .super Ljava/lang/Object; .source "BasicFuture.java" # interfaces .implements Ljava/util/concurrent/Future; .implements Lorg/apache/http/concurrent/Cancellable; # annotations .annotation system Ldalvik/annotation/Signature; value = { "", "Ljava/lang/Object;", "Ljava/util/concurrent/Future<", "TT;>;", "Lorg/apache/http/concurrent/Cancellable;" } .end annotation # instance fields .field private final callback:Lorg/apache/http/concurrent/FutureCallback; .annotation system Ldalvik/annotation/Signature; value = { "Lorg/apache/http/concurrent/FutureCallback<", "TT;>;" } .end annotation .end field .field private volatile cancelled:Z .field private volatile completed:Z .field private volatile ex:Ljava/lang/Exception; .field private volatile result:Ljava/lang/Object; .annotation system Ldalvik/annotation/Signature; value = { "TT;" } .end annotation .end field # direct methods .method public constructor (Lorg/apache/http/concurrent/FutureCallback;)V .registers 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lorg/apache/http/concurrent/FutureCallback<", "TT;>;)V" } .end annotation .line 55 invoke-direct {p0}, Ljava/lang/Object;->()V .line 56 iput-object p1, p0, Lorg/apache/http/concurrent/BasicFuture;->callback:Lorg/apache/http/concurrent/FutureCallback; return-void .end method .method private getResult()Ljava/lang/Object; .registers 3 .annotation system Ldalvik/annotation/Signature; value = { "()TT;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/util/concurrent/ExecutionException; } .end annotation .line 70 iget-object v0, p0, Lorg/apache/http/concurrent/BasicFuture;->ex:Ljava/lang/Exception; if-nez v0, :cond_11 .line 73 iget-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->cancelled:Z if-nez v0, :cond_b .line 76 iget-object v0, p0, Lorg/apache/http/concurrent/BasicFuture;->result:Ljava/lang/Object; return-object v0 .line 74 :cond_b new-instance v0, Ljava/util/concurrent/CancellationException; invoke-direct {v0}, Ljava/util/concurrent/CancellationException;->()V throw v0 .line 71 :cond_11 new-instance v0, Ljava/util/concurrent/ExecutionException; iget-object v1, p0, Lorg/apache/http/concurrent/BasicFuture;->ex:Ljava/lang/Exception; invoke-direct {v0, v1}, Ljava/util/concurrent/ExecutionException;->(Ljava/lang/Throwable;)V throw v0 .end method # virtual methods .method public cancel()Z .registers 2 const/4 v0, 0x1 .line 161 invoke-virtual {p0, v0}, Lorg/apache/http/concurrent/BasicFuture;->cancel(Z)Z move-result v0 return v0 .end method .method public cancel(Z)Z .registers 3 .line 145 monitor-enter p0 .line 146 :try_start_1 iget-boolean p1, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z if-eqz p1, :cond_8 .line 147 monitor-exit p0 const/4 p1, 0x0 return p1 :cond_8 const/4 p1, 0x1 .line 149 iput-boolean p1, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z .line 150 iput-boolean p1, p0, Lorg/apache/http/concurrent/BasicFuture;->cancelled:Z .line 151 invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V .line 152 monitor-exit p0 :try_end_11 .catchall {:try_start_1 .. :try_end_11} :catchall_19 .line 153 iget-object v0, p0, Lorg/apache/http/concurrent/BasicFuture;->callback:Lorg/apache/http/concurrent/FutureCallback; if-eqz v0, :cond_18 .line 154 invoke-interface {v0}, Lorg/apache/http/concurrent/FutureCallback;->cancelled()V :cond_18 return p1 :catchall_19 move-exception p1 .line 152 :try_start_1a monitor-exit p0 :try_end_1b .catchall {:try_start_1a .. :try_end_1b} :catchall_19 throw p1 .end method .method public completed(Ljava/lang/Object;)Z .registers 4 .annotation system Ldalvik/annotation/Signature; value = { "(TT;)Z" } .end annotation .line 114 monitor-enter p0 .line 115 :try_start_1 iget-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z if-eqz v0, :cond_8 .line 116 monitor-exit p0 const/4 p1, 0x0 return p1 :cond_8 const/4 v0, 0x1 .line 118 iput-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z .line 119 iput-object p1, p0, Lorg/apache/http/concurrent/BasicFuture;->result:Ljava/lang/Object; .line 120 invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V .line 121 monitor-exit p0 :try_end_11 .catchall {:try_start_1 .. :try_end_11} :catchall_19 .line 122 iget-object v1, p0, Lorg/apache/http/concurrent/BasicFuture;->callback:Lorg/apache/http/concurrent/FutureCallback; if-eqz v1, :cond_18 .line 123 invoke-interface {v1, p1}, Lorg/apache/http/concurrent/FutureCallback;->completed(Ljava/lang/Object;)V :cond_18 return v0 :catchall_19 move-exception p1 .line 121 :try_start_1a monitor-exit p0 :try_end_1b .catchall {:try_start_1a .. :try_end_1b} :catchall_19 throw p1 .end method .method public failed(Ljava/lang/Exception;)Z .registers 4 .line 129 monitor-enter p0 .line 130 :try_start_1 iget-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z if-eqz v0, :cond_8 .line 131 monitor-exit p0 const/4 p1, 0x0 return p1 :cond_8 const/4 v0, 0x1 .line 133 iput-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z .line 134 iput-object p1, p0, Lorg/apache/http/concurrent/BasicFuture;->ex:Ljava/lang/Exception; .line 135 invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V .line 136 monitor-exit p0 :try_end_11 .catchall {:try_start_1 .. :try_end_11} :catchall_19 .line 137 iget-object v1, p0, Lorg/apache/http/concurrent/BasicFuture;->callback:Lorg/apache/http/concurrent/FutureCallback; if-eqz v1, :cond_18 .line 138 invoke-interface {v1, p1}, Lorg/apache/http/concurrent/FutureCallback;->failed(Ljava/lang/Exception;)V :cond_18 return v0 :catchall_19 move-exception p1 .line 136 :try_start_1a monitor-exit p0 :try_end_1b .catchall {:try_start_1a .. :try_end_1b} :catchall_19 throw p1 .end method .method public declared-synchronized get()Ljava/lang/Object; .registers 2 .annotation system Ldalvik/annotation/Signature; value = { "()TT;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/InterruptedException;, Ljava/util/concurrent/ExecutionException; } .end annotation monitor-enter p0 .line 81 :goto_1 :try_start_1 iget-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z if-nez v0, :cond_9 .line 82 invoke-virtual {p0}, Ljava/lang/Object;->wait()V goto :goto_1 .line 84 :cond_9 invoke-direct {p0}, Lorg/apache/http/concurrent/BasicFuture;->getResult()Ljava/lang/Object; move-result-object v0 :try_end_d .catchall {:try_start_1 .. :try_end_d} :catchall_f monitor-exit p0 return-object v0 :catchall_f move-exception v0 :try_start_10 monitor-exit p0 :try_end_11 .catchall {:try_start_10 .. :try_end_11} :catchall_f throw v0 .end method .method public declared-synchronized get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object; .registers 10 .annotation system Ldalvik/annotation/Signature; value = { "(J", "Ljava/util/concurrent/TimeUnit;", ")TT;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/InterruptedException;, Ljava/util/concurrent/ExecutionException;, Ljava/util/concurrent/TimeoutException; } .end annotation monitor-enter p0 .line 90 :try_start_1 const-string v0, "Time unit" invoke-static {p3, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 91 invoke-virtual {p3, p1, p2}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J move-result-wide p1 const-wide/16 v0, 0x0 cmp-long p3, p1, v0 if-gtz p3, :cond_12 move-wide v2, v0 goto :goto_16 .line 92 :cond_12 invoke-static {}, Ljava/lang/System;->currentTimeMillis()J move-result-wide v2 .line 94 :goto_16 iget-boolean v4, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z if-eqz v4, :cond_20 .line 95 invoke-direct {p0}, Lorg/apache/http/concurrent/BasicFuture;->getResult()Ljava/lang/Object; move-result-object p1 :try_end_1e .catchall {:try_start_1 .. :try_end_1e} :catchall_48 monitor-exit p0 return-object p1 :cond_20 if-lez p3, :cond_42 move-wide v4, p1 .line 100 :goto_23 :try_start_23 invoke-virtual {p0, v4, v5}, Ljava/lang/Object;->wait(J)V .line 101 iget-boolean p3, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z if-eqz p3, :cond_30 .line 102 invoke-direct {p0}, Lorg/apache/http/concurrent/BasicFuture;->getResult()Ljava/lang/Object; move-result-object p1 :try_end_2e .catchall {:try_start_23 .. :try_end_2e} :catchall_48 monitor-exit p0 return-object p1 .line 104 :cond_30 :try_start_30 invoke-static {}, Ljava/lang/System;->currentTimeMillis()J move-result-wide v4 sub-long/2addr v4, v2 sub-long v4, p1, v4 cmp-long p3, v4, v0 if-lez p3, :cond_3c goto :goto_23 .line 106 :cond_3c new-instance p1, Ljava/util/concurrent/TimeoutException; invoke-direct {p1}, Ljava/util/concurrent/TimeoutException;->()V throw p1 .line 97 :cond_42 new-instance p1, Ljava/util/concurrent/TimeoutException; invoke-direct {p1}, Ljava/util/concurrent/TimeoutException;->()V throw p1 :catchall_48 move-exception p1 monitor-exit p0 :try_end_4a .catchall {:try_start_30 .. :try_end_4a} :catchall_48 throw p1 .end method .method public isCancelled()Z .registers 2 .line 61 iget-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->cancelled:Z return v0 .end method .method public isDone()Z .registers 2 .line 66 iget-boolean v0, p0, Lorg/apache/http/concurrent/BasicFuture;->completed:Z return v0 .end method