public class org.I0Itec.zkclient.GatewayThread extends java.lang.Thread
  minor version: 0
  major version: 59
  flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
  this_class: org.I0Itec.zkclient.GatewayThread
  super_class: java.lang.Thread
{
  protected static final org.slf4j.Logger LOG;
    descriptor: Lorg/slf4j/Logger;
    flags: (0x001c) ACC_PROTECTED, ACC_STATIC, ACC_FINAL

  private final int _port;
    descriptor: I
    flags: (0x0012) ACC_PRIVATE, ACC_FINAL

  private final int _destinationPort;
    descriptor: I
    flags: (0x0012) ACC_PRIVATE, ACC_FINAL

  private java.net.ServerSocket _serverSocket;
    descriptor: Ljava/net/ServerSocket;
    flags: (0x0002) ACC_PRIVATE

  private java.util.concurrent.locks.Lock _lock;
    descriptor: Ljava/util/concurrent/locks/Lock;
    flags: (0x0002) ACC_PRIVATE

  private java.util.concurrent.locks.Condition _runningCondition;
    descriptor: Ljava/util/concurrent/locks/Condition;
    flags: (0x0002) ACC_PRIVATE

  private boolean _running;
    descriptor: Z
    flags: (0x0002) ACC_PRIVATE

  static void <clinit>();
    descriptor: ()V
    flags: (0x0008) ACC_STATIC
    Code:
      stack=1, locals=0, args_size=0
         0: .line 37
            ldc Lorg/I0Itec/zkclient/GatewayThread;
            invokestatic org.slf4j.LoggerFactory.getLogger:(Ljava/lang/Class;)Lorg/slf4j/Logger;
            putstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            return
      LocalVariableTable:
        Start  End  Slot  Name  Signature

  public void <init>(int, int);
    descriptor: (II)V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=3, locals=3, args_size=3
        start local 0 // org.I0Itec.zkclient.GatewayThread this
        start local 1 // int port
        start local 2 // int destinationPort
         0: .line 46
            aload 0 /* this */
            invokespecial java.lang.Thread.<init>:()V
         1: .line 42
            aload 0 /* this */
            new java.util.concurrent.locks.ReentrantLock
            dup
            invokespecial java.util.concurrent.locks.ReentrantLock.<init>:()V
            putfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
         2: .line 43
            aload 0 /* this */
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.newCondition:()Ljava/util/concurrent/locks/Condition;
            putfield org.I0Itec.zkclient.GatewayThread._runningCondition:Ljava/util/concurrent/locks/Condition;
         3: .line 44
            aload 0 /* this */
            iconst_0
            putfield org.I0Itec.zkclient.GatewayThread._running:Z
         4: .line 47
            aload 0 /* this */
            iload 1 /* port */
            putfield org.I0Itec.zkclient.GatewayThread._port:I
         5: .line 48
            aload 0 /* this */
            iload 2 /* destinationPort */
            putfield org.I0Itec.zkclient.GatewayThread._destinationPort:I
         6: .line 49
            aload 0 /* this */
            iconst_1
            invokevirtual org.I0Itec.zkclient.GatewayThread.setDaemon:(Z)V
         7: .line 50
            return
        end local 2 // int destinationPort
        end local 1 // int port
        end local 0 // org.I0Itec.zkclient.GatewayThread this
      LocalVariableTable:
        Start  End  Slot             Name  Signature
            0    8     0             this  Lorg/I0Itec/zkclient/GatewayThread;
            0    8     1             port  I
            0    8     2  destinationPort  I
    MethodParameters:
                 Name  Flags
      port             
      destinationPort  

  public void run();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=8, locals=10, args_size=1
        start local 0 // org.I0Itec.zkclient.GatewayThread this
         0: .line 54
            new java.util.Vector
            dup
            invokespecial java.util.Vector.<init>:()V
            astore 1 /* runningThreads */
        start local 1 // java.util.List runningThreads
         1: .line 56
            getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            new java.lang.StringBuilder
            dup
            ldc "Starting gateway on port "
            invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._port:I
            invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
            ldc " pointing to port "
            invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._destinationPort:I
            invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
            invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
            invokeinterface org.slf4j.Logger.info:(Ljava/lang/String;)V
         2: .line 57
            aload 0 /* this */
            new java.net.ServerSocket
            dup
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._port:I
            invokespecial java.net.ServerSocket.<init>:(I)V
            putfield org.I0Itec.zkclient.GatewayThread._serverSocket:Ljava/net/ServerSocket;
         3: .line 58
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.lock:()V
         4: .line 60
            aload 0 /* this */
            iconst_1
            putfield org.I0Itec.zkclient.GatewayThread._running:Z
         5: .line 61
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._runningCondition:Ljava/util/concurrent/locks/Condition;
            invokeinterface java.util.concurrent.locks.Condition.signalAll:()V
         6: .line 62
            goto 10
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List
      StackMap stack: java.lang.Throwable
         7: astore 2
         8: .line 63
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.unlock:()V
         9: .line 64
            aload 2
            athrow
        10: .line 63
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.unlock:()V
        11: .line 66
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._serverSocket:Ljava/net/ServerSocket;
            invokevirtual java.net.ServerSocket.accept:()Ljava/net/Socket;
            astore 2 /* socket */
        start local 2 // java.net.Socket socket
        12: .line 67
            getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            new java.lang.StringBuilder
            dup
            ldc "new client is connected "
            invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
            aload 2 /* socket */
            invokevirtual java.net.Socket.getInetAddress:()Ljava/net/InetAddress;
            invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
            invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
            invokeinterface org.slf4j.Logger.info:(Ljava/lang/String;)V
        13: .line 68
            aload 2 /* socket */
            invokevirtual java.net.Socket.getInputStream:()Ljava/io/InputStream;
            astore 3 /* incomingInputStream */
        start local 3 // java.io.InputStream incomingInputStream
        14: .line 69
            aload 2 /* socket */
            invokevirtual java.net.Socket.getOutputStream:()Ljava/io/OutputStream;
            astore 4 /* incomingOutputStream */
        start local 4 // java.io.OutputStream incomingOutputStream
        15: .line 73
            new java.net.Socket
            dup
            ldc "localhost"
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._destinationPort:I
            invokespecial java.net.Socket.<init>:(Ljava/lang/String;I)V
            astore 5 /* outgoingSocket */
        start local 5 // java.net.Socket outgoingSocket
        16: .line 74
            goto 20
        end local 5 // java.net.Socket outgoingSocket
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List java.net.Socket java.io.InputStream java.io.OutputStream
      StackMap stack: java.lang.Exception
        17: pop
        18: .line 75
            getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            new java.lang.StringBuilder
            dup
            ldc "could not connect to "
            invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._destinationPort:I
            invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
            invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
            invokeinterface org.slf4j.Logger.warn:(Ljava/lang/String;)V
        19: .line 76
            goto 11
        start local 5 // java.net.Socket outgoingSocket
        20: .line 78
      StackMap locals: java.net.Socket
      StackMap stack:
            aload 5 /* outgoingSocket */
            invokevirtual java.net.Socket.getInputStream:()Ljava/io/InputStream;
            astore 6 /* outgoingInputStream */
        start local 6 // java.io.InputStream outgoingInputStream
        21: .line 79
            aload 5 /* outgoingSocket */
            invokevirtual java.net.Socket.getOutputStream:()Ljava/io/OutputStream;
            astore 7 /* outgoingOutputStream */
        start local 7 // java.io.OutputStream outgoingOutputStream
        22: .line 81
            new org.I0Itec.zkclient.GatewayThread$1
            dup
            aload 0 /* this */
            aload 1 /* runningThreads */
            aload 7 /* outgoingOutputStream */
            aload 3 /* incomingInputStream */
            aload 2 /* socket */
            aload 5 /* outgoingSocket */
            invokespecial org.I0Itec.zkclient.GatewayThread$1.<init>:(Lorg/I0Itec/zkclient/GatewayThread;Ljava/util/List;Ljava/io/OutputStream;Ljava/io/InputStream;Ljava/net/Socket;Ljava/net/Socket;)V
            astore 8 /* writeThread */
        start local 8 // java.lang.Thread writeThread
        23: .line 111
            new org.I0Itec.zkclient.GatewayThread$2
            dup
            aload 0 /* this */
            aload 1 /* runningThreads */
            aload 4 /* incomingOutputStream */
            aload 6 /* outgoingInputStream */
            invokespecial org.I0Itec.zkclient.GatewayThread$2.<init>:(Lorg/I0Itec/zkclient/GatewayThread;Ljava/util/List;Ljava/io/OutputStream;Ljava/io/InputStream;)V
            astore 9 /* readThread */
        start local 9 // java.lang.Thread readThread
        24: .line 129
            aload 8 /* writeThread */
            iconst_1
            invokevirtual java.lang.Thread.setDaemon:(Z)V
        25: .line 130
            aload 9 /* readThread */
            iconst_1
            invokevirtual java.lang.Thread.setDaemon:(Z)V
        26: .line 132
            aload 8 /* writeThread */
            invokevirtual java.lang.Thread.start:()V
        27: .line 133
            aload 9 /* readThread */
            invokevirtual java.lang.Thread.start:()V
        end local 9 // java.lang.Thread readThread
        end local 8 // java.lang.Thread writeThread
        end local 7 // java.io.OutputStream outgoingOutputStream
        end local 6 // java.io.InputStream outgoingInputStream
        end local 5 // java.net.Socket outgoingSocket
        end local 4 // java.io.OutputStream incomingOutputStream
        end local 3 // java.io.InputStream incomingInputStream
        end local 2 // java.net.Socket socket
        28: .line 65
            goto 11
        29: .line 135
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List
      StackMap stack: java.net.SocketException
            astore 2 /* e */
        start local 2 // java.net.SocketException e
        30: .line 136
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._running:Z
            ifne 32
        31: .line 137
            aload 2 /* e */
            invokestatic org.I0Itec.zkclient.ExceptionUtil.convertToRuntimeException:(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;
            athrow
        32: .line 139
      StackMap locals: java.net.SocketException
      StackMap stack:
            getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            ldc "Stopping gateway"
            invokeinterface org.slf4j.Logger.info:(Ljava/lang/String;)V
        end local 2 // java.net.SocketException e
        33: goto 36
        34: .line 140
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List
      StackMap stack: java.lang.Exception
            astore 2 /* e */
        start local 2 // java.lang.Exception e
        35: .line 141
            getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            ldc "error on gateway execution"
            aload 2 /* e */
            invokeinterface org.slf4j.Logger.error:(Ljava/lang/String;Ljava/lang/Throwable;)V
        end local 2 // java.lang.Exception e
        36: .line 144
      StackMap locals:
      StackMap stack:
            new java.util.ArrayList
            dup
            aload 1 /* runningThreads */
            invokespecial java.util.ArrayList.<init>:(Ljava/util/Collection;)V
            invokevirtual java.util.ArrayList.iterator:()Ljava/util/Iterator;
            astore 3
            goto 42
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List top java.util.Iterator
      StackMap stack:
        37: aload 3
            invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
            checkcast java.lang.Thread
            astore 2 /* thread */
        start local 2 // java.lang.Thread thread
        38: .line 145
            aload 2 /* thread */
            invokevirtual java.lang.Thread.interrupt:()V
        39: .line 147
            aload 2 /* thread */
            invokevirtual java.lang.Thread.join:()V
        40: .line 148
            goto 42
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List java.lang.Thread java.util.Iterator
      StackMap stack: java.lang.InterruptedException
        41: pop
        end local 2 // java.lang.Thread thread
        42: .line 144
      StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List top java.util.Iterator
      StackMap stack:
            aload 3
            invokeinterface java.util.Iterator.hasNext:()Z
            ifne 37
        43: .line 152
            return
        end local 1 // java.util.List runningThreads
        end local 0 // org.I0Itec.zkclient.GatewayThread this
      LocalVariableTable:
        Start  End  Slot                  Name  Signature
            0   44     0                  this  Lorg/I0Itec/zkclient/GatewayThread;
            1   44     1        runningThreads  Ljava/util/List<Ljava/lang/Thread;>;
           12   28     2                socket  Ljava/net/Socket;
           14   28     3   incomingInputStream  Ljava/io/InputStream;
           15   28     4  incomingOutputStream  Ljava/io/OutputStream;
           16   17     5        outgoingSocket  Ljava/net/Socket;
           20   28     5        outgoingSocket  Ljava/net/Socket;
           21   28     6   outgoingInputStream  Ljava/io/InputStream;
           22   28     7  outgoingOutputStream  Ljava/io/OutputStream;
           23   28     8           writeThread  Ljava/lang/Thread;
           24   28     9            readThread  Ljava/lang/Thread;
           30   33     2                     e  Ljava/net/SocketException;
           35   36     2                     e  Ljava/lang/Exception;
           38   42     2                thread  Ljava/lang/Thread;
      Exception table:
        from    to  target  type
           4     7       7  any
          15    16      17  Class java.lang.Exception
           1    29      29  Class java.net.SocketException
           1    29      34  Class java.lang.Exception
          39    40      41  Class java.lang.InterruptedException

  protected void closeQuietly(java.io.Closeable);
    descriptor: (Ljava/io/Closeable;)V
    flags: (0x0004) ACC_PROTECTED
    Code:
      stack=1, locals=2, args_size=2
        start local 0 // org.I0Itec.zkclient.GatewayThread this
        start local 1 // java.io.Closeable closable
         0: .line 156
            aload 1 /* closable */
            invokeinterface java.io.Closeable.close:()V
         1: .line 157
            goto 3
      StackMap locals:
      StackMap stack: java.io.IOException
         2: pop
         3: .line 160
      StackMap locals:
      StackMap stack:
            return
        end local 1 // java.io.Closeable closable
        end local 0 // org.I0Itec.zkclient.GatewayThread this
      LocalVariableTable:
        Start  End  Slot      Name  Signature
            0    4     0      this  Lorg/I0Itec/zkclient/GatewayThread;
            0    4     1  closable  Ljava/io/Closeable;
      Exception table:
        from    to  target  type
           0     1       2  Class java.io.IOException
    MethodParameters:
          Name  Flags
      closable  

  public void interrupt();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=3, locals=2, args_size=1
        start local 0 // org.I0Itec.zkclient.GatewayThread this
         0: .line 165
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._serverSocket:Ljava/net/ServerSocket;
            invokevirtual java.net.ServerSocket.close:()V
         1: .line 166
            goto 4
      StackMap locals:
      StackMap stack: java.lang.Exception
         2: astore 1 /* cE */
        start local 1 // java.lang.Exception cE
         3: .line 167
            getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
            ldc "error on stopping gateway"
            aload 1 /* cE */
            invokeinterface org.slf4j.Logger.error:(Ljava/lang/String;Ljava/lang/Throwable;)V
        end local 1 // java.lang.Exception cE
         4: .line 169
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            invokespecial java.lang.Thread.interrupt:()V
         5: .line 170
            return
        end local 0 // org.I0Itec.zkclient.GatewayThread this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    6     0  this  Lorg/I0Itec/zkclient/GatewayThread;
            3    4     1    cE  Ljava/lang/Exception;
      Exception table:
        from    to  target  type
           0     1       2  Class java.lang.Exception

  public void interruptAndJoin();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
        start local 0 // org.I0Itec.zkclient.GatewayThread this
         0: .line 173
            aload 0 /* this */
            invokevirtual org.I0Itec.zkclient.GatewayThread.interrupt:()V
         1: .line 174
            aload 0 /* this */
            invokevirtual org.I0Itec.zkclient.GatewayThread.join:()V
         2: .line 175
            return
        end local 0 // org.I0Itec.zkclient.GatewayThread this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0    3     0  this  Lorg/I0Itec/zkclient/GatewayThread;
    Exceptions:
      throws java.lang.InterruptedException

  public void awaitUp();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=2, args_size=1
        start local 0 // org.I0Itec.zkclient.GatewayThread this
         0: .line 178
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.lock:()V
         1: .line 180
            goto 3
         2: .line 181
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._runningCondition:Ljava/util/concurrent/locks/Condition;
            invokeinterface java.util.concurrent.locks.Condition.await:()V
         3: .line 180
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._running:Z
            ifeq 2
         4: .line 183
            goto 11
      StackMap locals:
      StackMap stack: java.lang.InterruptedException
         5: pop
         6: .line 184
            invokestatic java.lang.Thread.currentThread:()Ljava/lang/Thread;
            invokevirtual java.lang.Thread.interrupt:()V
         7: .line 186
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.unlock:()V
            goto 12
         8: .line 185
      StackMap locals:
      StackMap stack: java.lang.Throwable
            astore 1
         9: .line 186
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.unlock:()V
        10: .line 187
            aload 1
            athrow
        11: .line 186
      StackMap locals:
      StackMap stack:
            aload 0 /* this */
            getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
            invokeinterface java.util.concurrent.locks.Lock.unlock:()V
        12: .line 188
      StackMap locals:
      StackMap stack:
            return
        end local 0 // org.I0Itec.zkclient.GatewayThread this
      LocalVariableTable:
        Start  End  Slot  Name  Signature
            0   13     0  this  Lorg/I0Itec/zkclient/GatewayThread;
      Exception table:
        from    to  target  type
           1     4       5  Class java.lang.InterruptedException
           1     7       8  any
}
SourceFile: "GatewayThread.java"
NestMembers:
  org.I0Itec.zkclient.GatewayThread$1  org.I0Itec.zkclient.GatewayThread$2
InnerClasses:
  org.I0Itec.zkclient.GatewayThread$1
  org.I0Itec.zkclient.GatewayThread$2