284 lines
6.9 KiB
Smali
284 lines
6.9 KiB
Smali
.class public Lcom/moji/tool/thread/wrapper/MJFutureTask;
|
|
.super Ljava/util/concurrent/FutureTask;
|
|
.source "MJFutureTask.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/moji/tool/thread/wrapper/MJPriorityComparable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<V:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/util/concurrent/FutureTask<",
|
|
"TV;>;",
|
|
"Lcom/moji/tool/thread/wrapper/MJPriorityComparable;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
.field private b:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/lang/Runnable;Ljava/lang/Object;Lcom/moji/tool/thread/ThreadPriority;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Runnable;",
|
|
"TV;",
|
|
"Lcom/moji/tool/thread/ThreadPriority;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 26
|
|
invoke-direct {p0, p1, p2}, Ljava/util/concurrent/FutureTask;-><init>(Ljava/lang/Runnable;Ljava/lang/Object;)V
|
|
|
|
.line 17
|
|
sget-object p1, Lcom/moji/tool/thread/ThreadPriority;->LOW:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
iput-object p1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
const/4 p1, -0x1
|
|
|
|
.line 18
|
|
iput p1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->b:I
|
|
|
|
.line 27
|
|
iput-object p3, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/util/concurrent/Callable;Lcom/moji/tool/thread/ThreadPriority;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/concurrent/Callable<",
|
|
"TV;>;",
|
|
"Lcom/moji/tool/thread/ThreadPriority;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 21
|
|
invoke-direct {p0, p1}, Ljava/util/concurrent/FutureTask;-><init>(Ljava/util/concurrent/Callable;)V
|
|
|
|
.line 17
|
|
sget-object p1, Lcom/moji/tool/thread/ThreadPriority;->LOW:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
iput-object p1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
const/4 p1, -0x1
|
|
|
|
.line 18
|
|
iput p1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->b:I
|
|
|
|
.line 22
|
|
iput-object p2, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Lcom/moji/tool/thread/wrapper/MJPriorityComparable;)I
|
|
.locals 1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
.line 45
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a()Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/tool/thread/ThreadPriority;->getPriorityValue()I
|
|
|
|
move-result v0
|
|
|
|
invoke-interface {p1}, Lcom/moji/tool/thread/wrapper/MJPriorityComparable;->a()Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/moji/tool/thread/ThreadPriority;->getPriorityValue()I
|
|
|
|
move-result p1
|
|
|
|
sub-int/2addr v0, p1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public a()Lcom/moji/tool/thread/ThreadPriority;
|
|
.locals 1
|
|
|
|
.line 37
|
|
iget-object v0, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public a(I)V
|
|
.locals 0
|
|
|
|
if-ltz p1, :cond_0
|
|
|
|
.line 50
|
|
iput p1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->b:I
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Lcom/moji/tool/thread/ThreadPriority;)V
|
|
.locals 0
|
|
|
|
.line 32
|
|
iput-object p1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a:Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic compareTo(Ljava/lang/Object;)I
|
|
.locals 0
|
|
|
|
.line 16
|
|
check-cast p1, Lcom/moji/tool/thread/wrapper/MJPriorityComparable;
|
|
|
|
invoke-virtual {p0, p1}, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a(Lcom/moji/tool/thread/wrapper/MJPriorityComparable;)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method protected done()V
|
|
.locals 3
|
|
|
|
.line 62
|
|
:try_start_0
|
|
invoke-virtual {p0}, Lcom/moji/tool/thread/wrapper/MJFutureTask;->get()Ljava/lang/Object;
|
|
:try_end_0
|
|
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/util/concurrent/CancellationException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 69
|
|
:goto_0
|
|
invoke-static {}, Lcom/moji/tool/thread/MJThreadManager;->a()Lcom/moji/tool/thread/MJThreadManager;
|
|
|
|
move-result-object v0
|
|
|
|
iget v1, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->b:I
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/tool/thread/MJThreadManager;->a(I)V
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_2
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
.line 66
|
|
:try_start_1
|
|
new-instance v1, Ljava/lang/RuntimeException;
|
|
|
|
const-string v2, "An error occurred while executing MJFutureTask"
|
|
|
|
.line 67
|
|
invoke-virtual {v0}, Ljava/util/concurrent/ExecutionException;->getCause()Ljava/lang/Throwable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v1, v2, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v1
|
|
|
|
:catch_1
|
|
move-exception v0
|
|
|
|
const-string v1, "MJFutureTask"
|
|
|
|
.line 64
|
|
invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:goto_1
|
|
return-void
|
|
|
|
.line 69
|
|
:goto_2
|
|
invoke-static {}, Lcom/moji/tool/thread/MJThreadManager;->a()Lcom/moji/tool/thread/MJThreadManager;
|
|
|
|
move-result-object v1
|
|
|
|
iget v2, p0, Lcom/moji/tool/thread/wrapper/MJFutureTask;->b:I
|
|
|
|
invoke-virtual {v1, v2}, Lcom/moji/tool/thread/MJThreadManager;->a(I)V
|
|
|
|
.line 70
|
|
throw v0
|
|
.end method
|
|
|
|
.method public equals(Ljava/lang/Object;)Z
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 56
|
|
instance-of v0, p1, Lcom/moji/tool/thread/wrapper/MJPriorityComparable;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
move-object v0, p1
|
|
|
|
check-cast v0, Lcom/moji/tool/thread/wrapper/MJPriorityComparable;
|
|
|
|
invoke-interface {v0}, Lcom/moji/tool/thread/wrapper/MJPriorityComparable;->a()Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0}, Lcom/moji/tool/thread/wrapper/MJFutureTask;->a()Lcom/moji/tool/thread/ThreadPriority;
|
|
|
|
move-result-object v1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
invoke-super {p0, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|