.class public Lra/a;
.super Lqa/a;
.source ""


# instance fields
.field public B:Lra/d;

.field public C:Lra/c;


# direct methods
.method public constructor <init>()V
    .registers 2

    invoke-direct {p0}, Lqa/a;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lra/a;->B:Lra/d;

    iput-object v0, p0, Lra/a;->C:Lra/c;

    return-void
.end method


# virtual methods
.method public e()V
    .registers 3

    .line 1
    :try_start_0
    iget-object v0, p0, Lka/a;->s:Lka/c;

    move-object v1, v0

    check-cast v1, Lqa/c;

    iput-object v1, p0, Lqa/a;->z:Lqa/c;
    :try_end_7
    .catch Ljava/lang/ClassCastException; {:try_start_0 .. :try_end_7} :catch_14

    .line 2
    :try_start_7
    check-cast v0, Lra/c;

    iput-object v0, p0, Lra/a;->C:Lra/c;
    :try_end_b
    .catch Ljava/lang/ClassCastException; {:try_start_7 .. :try_end_b} :catch_c

    return-void

    :catch_c
    new-instance v0, Lja/f;

    const-string v1, "config must implement interface TCPNetSyslogConfigIF"

    invoke-direct {v0, v1}, Lja/f;-><init>(Ljava/lang/String;)V

    throw v0

    .line 3
    :catch_14
    new-instance v0, Lja/f;

    const-string v1, "config must implement interface AbstractNetSyslogConfigIF"

    invoke-direct {v0, v1}, Lja/f;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public p([B)V
    .registers 5

    .line 1
    monitor-enter p0

    const/4 v0, 0x1

    :try_start_2
    invoke-virtual {p0, v0}, Lra/a;->z(Z)Lka/d;

    move-result-object v1
    :try_end_6
    .catchall {:try_start_2 .. :try_end_6} :catchall_2d

    monitor-exit p0

    .line 2
    :try_start_7
    iget-object v2, v1, Lka/d;->t:Ljava/lang/Thread;

    if-eqz v2, :cond_12

    invoke-virtual {v2}, Ljava/lang/Thread;->isAlive()Z

    move-result v2

    if-eqz v2, :cond_12

    goto :goto_13

    :cond_12
    const/4 v0, 0x0

    :goto_13
    if-eqz v0, :cond_22

    .line 3
    iget-object v0, v1, Lka/d;->s:Ljava/util/List;

    monitor-enter v0
    :try_end_18
    .catchall {:try_start_7 .. :try_end_18} :catchall_2b

    :try_start_18
    iget-object v1, v1, Lka/d;->s:Ljava/util/List;

    invoke-interface {v1, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    monitor-exit v0

    goto :goto_27

    :catchall_1f
    move-exception p1

    monitor-exit v0
    :try_end_21
    .catchall {:try_start_18 .. :try_end_21} :catchall_1f

    :try_start_21
    throw p1

    .line 4
    :cond_22
    monitor-enter v1
    :try_end_23
    .catchall {:try_start_21 .. :try_end_23} :catchall_2b

    :try_start_23
    invoke-virtual {v1, p1}, Lka/d;->e([B)V

    monitor-exit v1

    :goto_27
    return-void

    :catchall_28
    move-exception p1

    monitor-exit v1
    :try_end_2a
    .catchall {:try_start_23 .. :try_end_2a} :catchall_28

    :try_start_2a
    throw p1
    :try_end_2b
    .catchall {:try_start_2a .. :try_end_2b} :catchall_2b

    :catchall_2b
    move-exception p1

    throw p1

    :catchall_2d
    move-exception p1

    .line 5
    monitor-exit p0

    throw p1
.end method

.method public shutdown()V
    .registers 10

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lra/a;->z(Z)Lka/d;

    move-result-object v1

    if-eqz v1, :cond_5a

    check-cast v1, Lra/d;

    .line 1
    monitor-enter v1

    :try_start_a
    iget-object v2, v1, Lra/d;->x:Ljava/net/Socket;
    :try_end_c
    .catchall {:try_start_a .. :try_end_c} :catchall_57

    if-nez v2, :cond_10

    :cond_e
    :goto_e
    monitor-exit v1

    goto :goto_5a

    :cond_10
    :try_start_10
    iget-object v2, v1, Lka/d;->u:Lka/c;

    invoke-interface {v2}, Lka/c;->T()Z

    move-result v2

    if-eqz v2, :cond_51

    const/4 v2, 0x1

    iput-boolean v2, v1, Lka/d;->v:Z

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    :catch_1f
    :cond_1f
    :goto_1f
    if-nez v0, :cond_e

    iget-object v5, v1, Lra/d;->x:Ljava/net/Socket;

    if-eqz v5, :cond_4f

    invoke-virtual {v5}, Ljava/net/Socket;->isClosed()Z

    move-result v5

    if-eqz v5, :cond_2c

    goto :goto_4f

    :cond_2c
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v5

    iget-object v7, v1, Lra/d;->y:Lra/c;

    invoke-interface {v7}, Lka/c;->a()I

    move-result v7

    int-to-long v7, v7

    add-long/2addr v7, v3

    cmp-long v5, v5, v7

    if-lez v5, :cond_47

    iget-object v0, v1, Lra/d;->x:Ljava/net/Socket;

    invoke-virtual {v1, v0}, Lra/d;->f(Ljava/net/Socket;)V

    iget-object v0, v1, Lka/d;->t:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
    :try_end_46
    .catchall {:try_start_10 .. :try_end_46} :catchall_57

    move v0, v2

    :cond_47
    if-nez v0, :cond_1f

    const-wide/16 v5, 0x64

    :try_start_4b
    invoke-static {v5, v6}, Ljava/lang/Thread;->sleep(J)V
    :try_end_4e
    .catch Ljava/lang/InterruptedException; {:try_start_4b .. :try_end_4e} :catch_1f
    .catchall {:try_start_4b .. :try_end_4e} :catchall_57

    goto :goto_1f

    :cond_4f
    :goto_4f
    move v0, v2

    goto :goto_1f

    :cond_51
    :try_start_51
    iget-object v0, v1, Lra/d;->x:Ljava/net/Socket;

    invoke-virtual {v1, v0}, Lra/d;->f(Ljava/net/Socket;)V
    :try_end_56
    .catchall {:try_start_51 .. :try_end_56} :catchall_57

    goto :goto_e

    :catchall_57
    move-exception v0

    monitor-exit v1

    throw v0

    :cond_5a
    :goto_5a
    return-void
.end method

.method public declared-synchronized z(Z)Lka/d;
    .registers 4

    monitor-enter p0

    :try_start_1
    iget-object v0, p0, Lra/a;->B:Lra/d;

    if-nez v0, :cond_3e

    if-nez p1, :cond_8

    goto :goto_3e

    :cond_8
    invoke-virtual {p0}, Lka/a;->d()Lka/d;

    move-result-object p1

    check-cast p1, Lra/d;

    iput-object p1, p0, Lra/a;->B:Lra/d;

    iget-object p1, p0, Lra/a;->C:Lra/c;

    invoke-interface {p1}, Lka/c;->T()Z

    move-result p1

    if-eqz p1, :cond_3a

    iget-object p1, p0, Lra/a;->B:Lra/d;

    .line 1
    new-instance v0, Ljava/lang/Thread;

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

    .line 2
    iput-object v0, p1, Lka/d;->t:Ljava/lang/Thread;

    .line 3
    new-instance p1, Ljava/lang/StringBuffer;

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

    const-string v1, "SyslogWriter: "

    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 4
    iget-object v1, p0, Lka/a;->r:Ljava/lang/String;

    .line 5
    invoke-virtual {p1, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {p1}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 6
    :cond_3a
    iget-object p1, p0, Lra/a;->B:Lra/d;
    :try_end_3c
    .catchall {:try_start_1 .. :try_end_3c} :catchall_40

    monitor-exit p0

    return-object p1

    :cond_3e
    :goto_3e
    monitor-exit p0

    return-object v0

    :catchall_40
    move-exception p1

    monitor-exit p0

    throw p1
.end method
