.class public final Lcom/alipay/android/phone/mrpc/core/af;
.super Ljava/lang/Object;


# static fields
.field private static final a:Ljava/lang/ThreadLocal;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ThreadLocal<",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field private static final b:Ljava/lang/ThreadLocal;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ThreadLocal<",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;"
        }
    .end annotation
.end field

.field private static final c:B = 0x0t

.field private static final d:B = 0x1t


# instance fields
.field private e:B

.field private f:Ljava/util/concurrent/atomic/AtomicInteger;

.field private g:Lcom/alipay/android/phone/mrpc/core/ad;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/lang/ThreadLocal;

    invoke-direct {v0}, Ljava/lang/ThreadLocal;-><init>()V

    sput-object v0, Lcom/alipay/android/phone/mrpc/core/af;->a:Ljava/lang/ThreadLocal;

    new-instance v0, Ljava/lang/ThreadLocal;

    invoke-direct {v0}, Ljava/lang/ThreadLocal;-><init>()V

    sput-object v0, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    return-void
.end method

.method public constructor <init>(Lcom/alipay/android/phone/mrpc/core/ad;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    iput-byte v0, p0, Lcom/alipay/android/phone/mrpc/core/af;->e:B

    iput-object p1, p0, Lcom/alipay/android/phone/mrpc/core/af;->g:Lcom/alipay/android/phone/mrpc/core/ad;

    new-instance p1, Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-direct {p1}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V

    iput-object p1, p0, Lcom/alipay/android/phone/mrpc/core/af;->f:Ljava/util/concurrent/atomic/AtomicInteger;

    return-void
.end method

.method private a(Ljava/lang/reflect/Method;ILjava/lang/String;[BZ)Lcom/alipay/android/phone/mrpc/core/aa;
    .locals 8

    new-instance v7, Lcom/alipay/android/phone/mrpc/core/l;

    iget-object v0, p0, Lcom/alipay/android/phone/mrpc/core/af;->g:Lcom/alipay/android/phone/mrpc/core/ad;

    .line 12000
    iget-object v1, v0, Lcom/alipay/android/phone/mrpc/core/ad;->a:Lcom/alipay/android/phone/mrpc/core/h;

    move-object v0, v7

    move-object v2, p1

    move v3, p2

    move-object v4, p3

    move-object v5, p4

    move v6, p5

    invoke-direct/range {v0 .. v6}, Lcom/alipay/android/phone/mrpc/core/l;-><init>(Lcom/alipay/android/phone/mrpc/core/h;Ljava/lang/reflect/Method;ILjava/lang/String;[BZ)V

    return-object v7
.end method

.method private static a(Ljava/lang/reflect/Type;[B)Lcom/alipay/android/phone/mrpc/core/gwprotocol/c;
    .locals 1

    new-instance v0, Lcom/alipay/android/phone/mrpc/core/gwprotocol/d;

    invoke-direct {v0, p0, p1}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/d;-><init>(Ljava/lang/reflect/Type;[B)V

    return-object v0
.end method

.method private static a(ILjava/lang/String;[Ljava/lang/Object;)Lcom/alipay/android/phone/mrpc/core/gwprotocol/f;
    .locals 1

    new-instance v0, Lcom/alipay/android/phone/mrpc/core/gwprotocol/e;

    invoke-direct {v0, p0, p1, p2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/e;-><init>(ILjava/lang/String;Ljava/lang/Object;)V

    return-object v0
.end method

.method private static a()V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()V"
        }
    .end annotation

    return-void
.end method

.method private static a(Lcom/alipay/android/phone/mrpc/core/ac;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/alipay/android/phone/mrpc/core/ac;",
            ")V"
        }
    .end annotation

    throw p0
.end method

.method private static a(Ljava/lang/String;Ljava/lang/Object;)V
    .locals 2

    sget-object v0, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object v0

    if-nez v0, :cond_0

    sget-object v0, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    invoke-virtual {v0, v1}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V

    :cond_0
    sget-object v0, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map;

    invoke-interface {v0, p0, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method private a(Ljava/lang/reflect/Method;[Ljava/lang/Object;Ljava/lang/String;IZ)[B
    .locals 8

    .line 9000
    new-instance v0, Lcom/alipay/android/phone/mrpc/core/gwprotocol/e;

    invoke-direct {v0, p4, p3, p2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/e;-><init>(ILjava/lang/String;Ljava/lang/Object;)V

    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {p2}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object p2

    if-eqz p2, :cond_0

    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {p2}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object p2

    invoke-interface {v0, p2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/f;->a(Ljava/lang/Object;)V

    :cond_0
    invoke-interface {v0}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/f;->a()[B

    move-result-object v6

    .line 10000
    new-instance p2, Lcom/alipay/android/phone/mrpc/core/l;

    iget-object v0, p0, Lcom/alipay/android/phone/mrpc/core/af;->g:Lcom/alipay/android/phone/mrpc/core/ad;

    .line 11000
    iget-object v2, v0, Lcom/alipay/android/phone/mrpc/core/ad;->a:Lcom/alipay/android/phone/mrpc/core/h;

    move-object v1, p2

    move-object v3, p1

    move v4, p4

    move-object v5, p3

    move v7, p5

    .line 10000
    invoke-direct/range {v1 .. v7}, Lcom/alipay/android/phone/mrpc/core/l;-><init>(Lcom/alipay/android/phone/mrpc/core/h;Ljava/lang/reflect/Method;ILjava/lang/String;[BZ)V

    invoke-interface {p2}, Lcom/alipay/android/phone/mrpc/core/aa;->a()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, [B

    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    const/4 p3, 0x0

    invoke-virtual {p2, p3}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V

    return-object p1
.end method

.method private static b()V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()V"
        }
    .end annotation

    return-void
.end method

.method private c()V
    .locals 1

    const/4 v0, 0x1

    iput-byte v0, p0, Lcom/alipay/android/phone/mrpc/core/af;->e:B

    return-void
.end method

.method private d()Ljava/util/concurrent/FutureTask;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/concurrent/FutureTask<",
            "*>;"
        }
    .end annotation

    const/4 v0, 0x0

    iput-byte v0, p0, Lcom/alipay/android/phone/mrpc/core/af;->e:B

    const/4 v0, 0x0

    return-object v0
.end method


# virtual methods
.method public final a(Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/reflect/Method;",
            "[",
            "Ljava/lang/Object;",
            ")",
            "Ljava/lang/Object;"
        }
    .end annotation

    .line 1000
    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-eqz v0, :cond_0

    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v3

    if-ne v0, v3, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    if-nez v0, :cond_5

    const-class v0, Lcom/alipay/mobile/framework/service/annotation/a;

    invoke-virtual {p1, v0}, Ljava/lang/reflect/Method;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v0

    check-cast v0, Lcom/alipay/mobile/framework/service/annotation/a;

    const-class v3, Lcom/alipay/mobile/framework/service/annotation/b;

    invoke-virtual {p1, v3}, Ljava/lang/reflect/Method;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

    move-result-object v3

    if-eqz v3, :cond_1

    const/4 v10, 0x1

    goto :goto_1

    :cond_1
    const/4 v10, 0x0

    :goto_1
    invoke-virtual {p1}, Ljava/lang/reflect/Method;->getGenericReturnType()Ljava/lang/reflect/Type;

    move-result-object v1

    invoke-virtual {p1}, Ljava/lang/reflect/Method;->getAnnotations()[Ljava/lang/annotation/Annotation;

    sget-object v2, Lcom/alipay/android/phone/mrpc/core/af;->a:Ljava/lang/ThreadLocal;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V

    sget-object v2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {v2, v3}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V

    if-eqz v0, :cond_4

    invoke-interface {v0}, Lcom/alipay/mobile/framework/service/annotation/a;->a()Ljava/lang/String;

    move-result-object v0

    iget-object v2, p0, Lcom/alipay/android/phone/mrpc/core/af;->f:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v2}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I

    move-result v7

    :try_start_0
    iget-byte v2, p0, Lcom/alipay/android/phone/mrpc/core/af;->e:B

    if-nez v2, :cond_3

    .line 3000
    new-instance v2, Lcom/alipay/android/phone/mrpc/core/gwprotocol/e;

    invoke-direct {v2, v7, v0, p2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/e;-><init>(ILjava/lang/String;Ljava/lang/Object;)V

    .line 2000
    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {p2}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object p2

    if-eqz p2, :cond_2

    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {p2}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object p2

    invoke-interface {v2, p2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/f;->a(Ljava/lang/Object;)V

    :cond_2
    invoke-interface {v2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/f;->a()[B

    move-result-object v9

    .line 4000
    new-instance p2, Lcom/alipay/android/phone/mrpc/core/l;

    iget-object v2, p0, Lcom/alipay/android/phone/mrpc/core/af;->g:Lcom/alipay/android/phone/mrpc/core/ad;

    .line 5000
    iget-object v5, v2, Lcom/alipay/android/phone/mrpc/core/ad;->a:Lcom/alipay/android/phone/mrpc/core/h;

    move-object v4, p2

    move-object v6, p1

    move-object v8, v0

    .line 4000
    invoke-direct/range {v4 .. v10}, Lcom/alipay/android/phone/mrpc/core/l;-><init>(Lcom/alipay/android/phone/mrpc/core/h;Ljava/lang/reflect/Method;ILjava/lang/String;[BZ)V

    .line 2000
    invoke-interface {p2}, Lcom/alipay/android/phone/mrpc/core/aa;->a()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, [B

    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->b:Ljava/lang/ThreadLocal;

    invoke-virtual {p2, v3}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V

    .line 6000
    new-instance p2, Lcom/alipay/android/phone/mrpc/core/gwprotocol/d;

    invoke-direct {p2, v1, p1}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/d;-><init>(Ljava/lang/reflect/Type;[B)V

    invoke-interface {p2}, Lcom/alipay/android/phone/mrpc/core/gwprotocol/c;->a()Ljava/lang/Object;

    move-result-object p1

    sget-object p2, Ljava/lang/Void;->TYPE:Ljava/lang/Class;

    if-eq v1, p2, :cond_3

    sget-object p2, Lcom/alipay/android/phone/mrpc/core/af;->a:Ljava/lang/ThreadLocal;

    invoke-virtual {p2, p1}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V
    :try_end_0
    .catch Lcom/alipay/android/phone/mrpc/core/ac; {:try_start_0 .. :try_end_0} :catch_0

    .line 8000
    :cond_3
    sget-object p1, Lcom/alipay/android/phone/mrpc/core/af;->a:Ljava/lang/ThreadLocal;

    invoke-virtual {p1}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object p1

    return-object p1

    :catch_0
    move-exception p1

    .line 7000
    iput-object v0, p1, Lcom/alipay/android/phone/mrpc/core/ac;->a:Ljava/lang/String;

    .line 8000
    throw p1

    .line 1000
    :cond_4
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "OperationType must be set."

    invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1

    :cond_5
    new-instance p1, Ljava/lang/IllegalThreadStateException;

    const-string p2, "can\'t in main thread call rpc ."

    invoke-direct {p1, p2}, Ljava/lang/IllegalThreadStateException;-><init>(Ljava/lang/String;)V

    throw p1
.end method
