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: 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 start local 1 start local 2 0: aload 0
invokespecial java.lang.Thread.<init>:()V
1: aload 0
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: aload 0
aload 0
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: aload 0
iconst_0
putfield org.I0Itec.zkclient.GatewayThread._running:Z
4: aload 0
iload 1
putfield org.I0Itec.zkclient.GatewayThread._port:I
5: aload 0
iload 2
putfield org.I0Itec.zkclient.GatewayThread._destinationPort:I
6: aload 0
iconst_1
invokevirtual org.I0Itec.zkclient.GatewayThread.setDaemon:(Z)V
7: return
end local 2 end local 1 end local 0 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 0: new java.util.Vector
dup
invokespecial java.util.Vector.<init>:()V
astore 1
start local 1 1: 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
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
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: aload 0
new java.net.ServerSocket
dup
aload 0
getfield org.I0Itec.zkclient.GatewayThread._port:I
invokespecial java.net.ServerSocket.<init>:(I)V
putfield org.I0Itec.zkclient.GatewayThread._serverSocket:Ljava/net/ServerSocket;
3: aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.lock:()V
4: aload 0
iconst_1
putfield org.I0Itec.zkclient.GatewayThread._running:Z
5: aload 0
getfield org.I0Itec.zkclient.GatewayThread._runningCondition:Ljava/util/concurrent/locks/Condition;
invokeinterface java.util.concurrent.locks.Condition.signalAll:()V
6: goto 10
StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List
StackMap stack: java.lang.Throwable
7: astore 2
8: aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
9: aload 2
athrow
10: StackMap locals:
StackMap stack:
aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
11: StackMap locals:
StackMap stack:
aload 0
getfield org.I0Itec.zkclient.GatewayThread._serverSocket:Ljava/net/ServerSocket;
invokevirtual java.net.ServerSocket.accept:()Ljava/net/Socket;
astore 2
start local 2 12: 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
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: aload 2
invokevirtual java.net.Socket.getInputStream:()Ljava/io/InputStream;
astore 3
start local 3 14: aload 2
invokevirtual java.net.Socket.getOutputStream:()Ljava/io/OutputStream;
astore 4
start local 4 15: new java.net.Socket
dup
ldc "localhost"
aload 0
getfield org.I0Itec.zkclient.GatewayThread._destinationPort:I
invokespecial java.net.Socket.<init>:(Ljava/lang/String;I)V
astore 5
start local 5 16: goto 20
end local 5 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: 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
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: goto 11
start local 5 20: StackMap locals: java.net.Socket
StackMap stack:
aload 5
invokevirtual java.net.Socket.getInputStream:()Ljava/io/InputStream;
astore 6
start local 6 21: aload 5
invokevirtual java.net.Socket.getOutputStream:()Ljava/io/OutputStream;
astore 7
start local 7 22: new org.I0Itec.zkclient.GatewayThread$1
dup
aload 0
aload 1
aload 7
aload 3
aload 2
aload 5
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
start local 8 23: new org.I0Itec.zkclient.GatewayThread$2
dup
aload 0
aload 1
aload 4
aload 6
invokespecial org.I0Itec.zkclient.GatewayThread$2.<init>:(Lorg/I0Itec/zkclient/GatewayThread;Ljava/util/List;Ljava/io/OutputStream;Ljava/io/InputStream;)V
astore 9
start local 9 24: aload 8
iconst_1
invokevirtual java.lang.Thread.setDaemon:(Z)V
25: aload 9
iconst_1
invokevirtual java.lang.Thread.setDaemon:(Z)V
26: aload 8
invokevirtual java.lang.Thread.start:()V
27: aload 9
invokevirtual java.lang.Thread.start:()V
end local 9 end local 8 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 28: goto 11
29: StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List
StackMap stack: java.net.SocketException
astore 2
start local 2 30: aload 0
getfield org.I0Itec.zkclient.GatewayThread._running:Z
ifne 32
31: aload 2
invokestatic org.I0Itec.zkclient.ExceptionUtil.convertToRuntimeException:(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;
athrow
32: 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 33: goto 36
34: StackMap locals: org.I0Itec.zkclient.GatewayThread java.util.List
StackMap stack: java.lang.Exception
astore 2
start local 2 35: getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
ldc "error on gateway execution"
aload 2
invokeinterface org.slf4j.Logger.error:(Ljava/lang/String;Ljava/lang/Throwable;)V
end local 2 36: StackMap locals:
StackMap stack:
new java.util.ArrayList
dup
aload 1
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
start local 2 38: aload 2
invokevirtual java.lang.Thread.interrupt:()V
39: aload 2
invokevirtual java.lang.Thread.join:()V
40: 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 42: 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: return
end local 1 end local 0 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 start local 1 0: aload 1
invokeinterface java.io.Closeable.close:()V
1: goto 3
StackMap locals:
StackMap stack: java.io.IOException
2: pop
3: StackMap locals:
StackMap stack:
return
end local 1 end local 0 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 0: aload 0
getfield org.I0Itec.zkclient.GatewayThread._serverSocket:Ljava/net/ServerSocket;
invokevirtual java.net.ServerSocket.close:()V
1: goto 4
StackMap locals:
StackMap stack: java.lang.Exception
2: astore 1
start local 1 3: getstatic org.I0Itec.zkclient.GatewayThread.LOG:Lorg/slf4j/Logger;
ldc "error on stopping gateway"
aload 1
invokeinterface org.slf4j.Logger.error:(Ljava/lang/String;Ljava/lang/Throwable;)V
end local 1 4: StackMap locals:
StackMap stack:
aload 0
invokespecial java.lang.Thread.interrupt:()V
5: return
end local 0 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 0: aload 0
invokevirtual org.I0Itec.zkclient.GatewayThread.interrupt:()V
1: aload 0
invokevirtual org.I0Itec.zkclient.GatewayThread.join:()V
2: return
end local 0 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 0: aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.lock:()V
1: goto 3
2: StackMap locals:
StackMap stack:
aload 0
getfield org.I0Itec.zkclient.GatewayThread._runningCondition:Ljava/util/concurrent/locks/Condition;
invokeinterface java.util.concurrent.locks.Condition.await:()V
3: StackMap locals:
StackMap stack:
aload 0
getfield org.I0Itec.zkclient.GatewayThread._running:Z
ifeq 2
4: goto 11
StackMap locals:
StackMap stack: java.lang.InterruptedException
5: pop
6: invokestatic java.lang.Thread.currentThread:()Ljava/lang/Thread;
invokevirtual java.lang.Thread.interrupt:()V
7: aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
goto 12
8: StackMap locals:
StackMap stack: java.lang.Throwable
astore 1
9: aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
10: aload 1
athrow
11: StackMap locals:
StackMap stack:
aload 0
getfield org.I0Itec.zkclient.GatewayThread._lock:Ljava/util/concurrent/locks/Lock;
invokeinterface java.util.concurrent.locks.Lock.unlock:()V
12: StackMap locals:
StackMap stack:
return
end local 0 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