ServerConnectionEventHandler.smali

.class public abstract Lorg/bitcoinj/protocols/channels/ServerConnectionEventHandler;
.super Ljava/lang/Object;
.source "ServerConnectionEventHandler.java"


# instance fields
.field private connectionChannel:Lorg/bitcoinj/net/ProtobufConnection;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lorg/bitcoinj/net/ProtobufConnection",
            "<",
            "Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage;",
            ">;"
        }
    .end annotation
.end field


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

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

    return-void
.end method


# virtual methods
.method public abstract channelClosed(Lorg/bitcoinj/protocols/channels/PaymentChannelCloseException$CloseReason;)V
.end method

.method public abstract channelOpen(Lorg/bitcoinj/core/Sha256Hash;)V
.end method

.method protected final declared-synchronized closeChannel()V
    .registers 4

    .prologue
    .line 54
    monitor-enter p0

    :try_start_1
    iget-object v0, p0, Lorg/bitcoinj/protocols/channels/ServerConnectionEventHandler;->connectionChannel:Lorg/bitcoinj/net/ProtobufConnection;

    if-nez v0, :cond_10

    .line 55
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "Channel is not fully initialized/has already been closed"

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

    throw v0
    :try_end_d
    .catchall {:try_start_1 .. :try_end_d} :catchall_d

    .line 54
    :catchall_d
    move-exception v0

    monitor-exit p0

    throw v0

    .line 56
    :cond_10
    :try_start_10
    iget-object v0, p0, Lorg/bitcoinj/protocols/channels/ServerConnectionEventHandler;->connectionChannel:Lorg/bitcoinj/net/ProtobufConnection;

    invoke-static {}, Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage;->newBuilder()Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$Builder;

    move-result-object v1

    sget-object v2, Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$MessageType;->CLOSE:Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$MessageType;

    .line 57
    invoke-virtual {v1, v2}, Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$Builder;->setType(Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$MessageType;)Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$Builder;

    move-result-object v1

    .line 58
    invoke-virtual {v1}, Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage$Builder;->build()Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage;

    move-result-object v1

    .line 56
    invoke-virtual {v0, v1}, Lorg/bitcoinj/net/ProtobufConnection;->write(Lcom/google/protobuf/MessageLite;)V

    .line 59
    iget-object v0, p0, Lorg/bitcoinj/protocols/channels/ServerConnectionEventHandler;->connectionChannel:Lorg/bitcoinj/net/ProtobufConnection;

    invoke-virtual {v0}, Lorg/bitcoinj/net/ProtobufConnection;->closeConnection()V
    :try_end_28
    .catchall {:try_start_10 .. :try_end_28} :catchall_d

    .line 60
    monitor-exit p0

    return-void
.end method

.method public abstract paymentIncrease(Lorg/bitcoinj/core/Coin;Lorg/bitcoinj/core/Coin;Lcom/google/protobuf/ByteString;)Lcom/google/common/util/concurrent/y;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/bitcoinj/core/Coin;",
            "Lorg/bitcoinj/core/Coin;",
            "Lcom/google/protobuf/ByteString;",
            ")",
            "Lcom/google/common/util/concurrent/y",
            "<",
            "Lcom/google/protobuf/ByteString;",
            ">;"
        }
    .end annotation
.end method

.method declared-synchronized setConnectionChannel(Lorg/bitcoinj/net/ProtobufConnection;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/bitcoinj/net/ProtobufConnection",
            "<",
            "Lorg/bitcoin/paymentchannel/Protos$TwoWayChannelMessage;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 37
    monitor-enter p0

    :try_start_1
    iput-object p1, p0, Lorg/bitcoinj/protocols/channels/ServerConnectionEventHandler;->connectionChannel:Lorg/bitcoinj/net/ProtobufConnection;
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_5

    monitor-exit p0

    return-void

    :catchall_5
    move-exception v0

    monitor-exit p0

    throw v0
.end method