class org.springframework.boot.devtools.livereload.Connection
minor version: 0
major version: 59
flags: flags: (0x0020) ACC_SUPER
this_class: org.springframework.boot.devtools.livereload.Connection
super_class: java.lang.Object
{
private static final org.apache.commons.logging.Log logger;
descriptor: Lorg/apache/commons/logging/Log;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.util.regex.Pattern WEBSOCKET_KEY_PATTERN;
descriptor: Ljava/util/regex/Pattern;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
public static final java.lang.String WEBSOCKET_GUID;
descriptor: Ljava/lang/String;
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
private final java.net.Socket socket;
descriptor: Ljava/net/Socket;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final org.springframework.boot.devtools.livereload.ConnectionInputStream inputStream;
descriptor: Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final org.springframework.boot.devtools.livereload.ConnectionOutputStream outputStream;
descriptor: Lorg/springframework/boot/devtools/livereload/ConnectionOutputStream;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.lang.String ;
descriptor: Ljava/lang/String;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private volatile boolean webSocket;
descriptor: Z
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
private volatile boolean running;
descriptor: Z
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: ldc Lorg/springframework/boot/devtools/livereload/Connection;
invokestatic org.apache.commons.logging.LogFactory.getLog:(Ljava/lang/Class;)Lorg/apache/commons/logging/Log;
putstatic org.springframework.boot.devtools.livereload.Connection.logger:Lorg/apache/commons/logging/Log;
1: ldc "^Sec-WebSocket-Key:(.*)$"
bipush 8
invokestatic java.util.regex.Pattern.compile:(Ljava/lang/String;I)Ljava/util/regex/Pattern;
putstatic org.springframework.boot.devtools.livereload.Connection.WEBSOCKET_KEY_PATTERN:Ljava/util/regex/Pattern;
2: return
LocalVariableTable:
Start End Slot Name Signature
void <init>(java.net.Socket, java.io.InputStream, java.io.OutputStream);
descriptor: (Ljava/net/Socket;Ljava/io/InputStream;Ljava/io/OutputStream;)V
flags: (0x0000)
Code:
stack=4, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
iconst_1
putfield org.springframework.boot.devtools.livereload.Connection.running:Z
2: aload 0
aload 1
putfield org.springframework.boot.devtools.livereload.Connection.socket:Ljava/net/Socket;
3: aload 0
new org.springframework.boot.devtools.livereload.ConnectionInputStream
dup
aload 2
invokespecial org.springframework.boot.devtools.livereload.ConnectionInputStream.<init>:(Ljava/io/InputStream;)V
putfield org.springframework.boot.devtools.livereload.Connection.inputStream:Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;
4: aload 0
new org.springframework.boot.devtools.livereload.ConnectionOutputStream
dup
aload 3
invokespecial org.springframework.boot.devtools.livereload.ConnectionOutputStream.<init>:(Ljava/io/OutputStream;)V
putfield org.springframework.boot.devtools.livereload.Connection.outputStream:Lorg/springframework/boot/devtools/livereload/ConnectionOutputStream;
5: aload 0
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.inputStream:Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;
invokevirtual org.springframework.boot.devtools.livereload.ConnectionInputStream.readHeader:()Ljava/lang/String;
putfield org.springframework.boot.devtools.livereload.Connection.header:Ljava/lang/String;
6: getstatic org.springframework.boot.devtools.livereload.Connection.logger:Lorg/apache/commons/logging/Log;
ldc "Established livereload connection [%s]"
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.header:Ljava/lang/String;
invokestatic org.springframework.core.log.LogMessage.format:(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/core/log/LogMessage;
invokeinterface org.apache.commons.logging.Log.debug:(Ljava/lang/Object;)V
7: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lorg/springframework/boot/devtools/livereload/Connection;
0 8 1 socket Ljava/net/Socket;
0 8 2 inputStream Ljava/io/InputStream;
0 8 3 outputStream Ljava/io/OutputStream;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
socket
inputStream
outputStream
void run();
descriptor: ()V
flags: (0x0000)
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.header:Ljava/lang/String;
ldc "Upgrade: websocket"
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 2
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.header:Ljava/lang/String;
ldc "Sec-WebSocket-Version: 13"
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 2
1: aload 0
invokevirtual org.springframework.boot.devtools.livereload.Connection.runWebSocket:()V
2: StackMap locals:
StackMap stack:
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.header:Ljava/lang/String;
ldc "GET /livereload.js"
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 4
3: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.outputStream:Lorg/springframework/boot/devtools/livereload/ConnectionOutputStream;
aload 0
invokevirtual java.lang.Object.getClass:()Ljava/lang/Class;
ldc "livereload.js"
invokevirtual java.lang.Class.getResourceAsStream:(Ljava/lang/String;)Ljava/io/InputStream;
ldc "text/javascript"
invokevirtual org.springframework.boot.devtools.livereload.ConnectionOutputStream.writeHttp:(Ljava/io/InputStream;Ljava/lang/String;)V
4: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lorg/springframework/boot/devtools/livereload/Connection;
Exceptions:
throws java.lang.Exception
private void runWebSocket();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=7, locals=2, args_size=1
start local 0 0: aload 0
invokevirtual org.springframework.boot.devtools.livereload.Connection.getWebsocketAcceptResponse:()Ljava/lang/String;
astore 1
start local 1 1: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.outputStream:Lorg/springframework/boot/devtools/livereload/ConnectionOutputStream;
iconst_4
anewarray java.lang.String
dup
iconst_0
ldc "HTTP/1.1 101 Switching Protocols"
aastore
dup
iconst_1
ldc "Upgrade: websocket"
aastore
dup
iconst_2
ldc "Connection: Upgrade"
aastore
dup
iconst_3
2: new java.lang.StringBuilder
dup
ldc "Sec-WebSocket-Accept: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aastore
3: invokevirtual org.springframework.boot.devtools.livereload.ConnectionOutputStream.writeHeaders:([Ljava/lang/String;)V
4: new org.springframework.boot.devtools.livereload.Frame
dup
ldc "{\"command\":\"hello\",\"protocols\":[\"http://livereload.com/protocols/official-7\"],\"serverName\":\"spring-boot\"}"
invokespecial org.springframework.boot.devtools.livereload.Frame.<init>:(Ljava/lang/String;)V
5: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.outputStream:Lorg/springframework/boot/devtools/livereload/ConnectionOutputStream;
invokevirtual org.springframework.boot.devtools.livereload.Frame.write:(Ljava/io/OutputStream;)V
6: ldc 100
invokestatic java.lang.Thread.sleep:(J)V
7: aload 0
iconst_1
putfield org.springframework.boot.devtools.livereload.Connection.webSocket:Z
8: goto 10
9: StackMap locals: java.lang.String
StackMap stack:
aload 0
invokevirtual org.springframework.boot.devtools.livereload.Connection.readWebSocketFrame:()V
10: StackMap locals:
StackMap stack:
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.running:Z
ifne 9
11: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lorg/springframework/boot/devtools/livereload/Connection;
1 12 1 accept Ljava/lang/String;
Exceptions:
throws java.lang.Exception
private void readWebSocketFrame();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=2, args_size=1
start local 0 0: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.inputStream:Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;
invokestatic org.springframework.boot.devtools.livereload.Frame.read:(Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;)Lorg/springframework/boot/devtools/livereload/Frame;
astore 1
start local 1 1: aload 1
invokevirtual org.springframework.boot.devtools.livereload.Frame.getType:()Lorg/springframework/boot/devtools/livereload/Frame$Type;
getstatic org.springframework.boot.devtools.livereload.Frame$Type.PING:Lorg/springframework/boot/devtools/livereload/Frame$Type;
if_acmpne 4
2: aload 0
new org.springframework.boot.devtools.livereload.Frame
dup
getstatic org.springframework.boot.devtools.livereload.Frame$Type.PONG:Lorg/springframework/boot/devtools/livereload/Frame$Type;
invokespecial org.springframework.boot.devtools.livereload.Frame.<init>:(Lorg/springframework/boot/devtools/livereload/Frame$Type;)V
invokevirtual org.springframework.boot.devtools.livereload.Connection.writeWebSocketFrame:(Lorg/springframework/boot/devtools/livereload/Frame;)V
3: goto 15
4: StackMap locals: org.springframework.boot.devtools.livereload.Frame
StackMap stack:
aload 1
invokevirtual org.springframework.boot.devtools.livereload.Frame.getType:()Lorg/springframework/boot/devtools/livereload/Frame$Type;
getstatic org.springframework.boot.devtools.livereload.Frame$Type.CLOSE:Lorg/springframework/boot/devtools/livereload/Frame$Type;
if_acmpne 6
5: new org.springframework.boot.devtools.livereload.ConnectionClosedException
dup
invokespecial org.springframework.boot.devtools.livereload.ConnectionClosedException.<init>:()V
athrow
6: StackMap locals:
StackMap stack:
aload 1
invokevirtual org.springframework.boot.devtools.livereload.Frame.getType:()Lorg/springframework/boot/devtools/livereload/Frame$Type;
getstatic org.springframework.boot.devtools.livereload.Frame$Type.TEXT:Lorg/springframework/boot/devtools/livereload/Frame$Type;
if_acmpne 9
7: getstatic org.springframework.boot.devtools.livereload.Connection.logger:Lorg/apache/commons/logging/Log;
ldc "Received LiveReload text frame %s"
aload 1
invokestatic org.springframework.core.log.LogMessage.format:(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/core/log/LogMessage;
invokeinterface org.apache.commons.logging.Log.debug:(Ljava/lang/Object;)V
8: goto 15
9: StackMap locals:
StackMap stack:
new java.io.IOException
dup
new java.lang.StringBuilder
dup
ldc "Unexpected Frame Type "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual org.springframework.boot.devtools.livereload.Frame.getType:()Lorg/springframework/boot/devtools/livereload/Frame$Type;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
end local 1 10: StackMap locals: org.springframework.boot.devtools.livereload.Connection
StackMap stack: java.net.SocketTimeoutException
pop
11: aload 0
new org.springframework.boot.devtools.livereload.Frame
dup
getstatic org.springframework.boot.devtools.livereload.Frame$Type.PING:Lorg/springframework/boot/devtools/livereload/Frame$Type;
invokespecial org.springframework.boot.devtools.livereload.Frame.<init>:(Lorg/springframework/boot/devtools/livereload/Frame$Type;)V
invokevirtual org.springframework.boot.devtools.livereload.Connection.writeWebSocketFrame:(Lorg/springframework/boot/devtools/livereload/Frame;)V
12: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.inputStream:Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;
invokestatic org.springframework.boot.devtools.livereload.Frame.read:(Lorg/springframework/boot/devtools/livereload/ConnectionInputStream;)Lorg/springframework/boot/devtools/livereload/Frame;
astore 1
start local 1 13: aload 1
invokevirtual org.springframework.boot.devtools.livereload.Frame.getType:()Lorg/springframework/boot/devtools/livereload/Frame$Type;
getstatic org.springframework.boot.devtools.livereload.Frame$Type.PONG:Lorg/springframework/boot/devtools/livereload/Frame$Type;
if_acmpeq 15
14: new java.lang.IllegalStateException
dup
ldc "No Pong"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
end local 1 15: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 16 0 this Lorg/springframework/boot/devtools/livereload/Connection;
1 10 1 frame Lorg/springframework/boot/devtools/livereload/Frame;
13 15 1 frame Lorg/springframework/boot/devtools/livereload/Frame;
Exception table:
from to target type
0 10 10 Class java.net.SocketTimeoutException
Exceptions:
throws java.io.IOException
void triggerReload();
descriptor: ()V
flags: (0x0000)
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.webSocket:Z
ifeq 3
1: getstatic org.springframework.boot.devtools.livereload.Connection.logger:Lorg/apache/commons/logging/Log;
ldc "Triggering LiveReload"
invokeinterface org.apache.commons.logging.Log.debug:(Ljava/lang/Object;)V
2: aload 0
new org.springframework.boot.devtools.livereload.Frame
dup
ldc "{\"command\":\"reload\",\"path\":\"/\"}"
invokespecial org.springframework.boot.devtools.livereload.Frame.<init>:(Ljava/lang/String;)V
invokevirtual org.springframework.boot.devtools.livereload.Connection.writeWebSocketFrame:(Lorg/springframework/boot/devtools/livereload/Frame;)V
3: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lorg/springframework/boot/devtools/livereload/Connection;
Exceptions:
throws java.io.IOException
private void writeWebSocketFrame(org.springframework.boot.devtools.livereload.Frame);
descriptor: (Lorg/springframework/boot/devtools/livereload/Frame;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.outputStream:Lorg/springframework/boot/devtools/livereload/ConnectionOutputStream;
invokevirtual org.springframework.boot.devtools.livereload.Frame.write:(Ljava/io/OutputStream;)V
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/springframework/boot/devtools/livereload/Connection;
0 2 1 frame Lorg/springframework/boot/devtools/livereload/Frame;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
frame
private java.lang.String getWebsocketAcceptResponse();
descriptor: ()Ljava/lang/String;
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=4, args_size=1
start local 0 0: getstatic org.springframework.boot.devtools.livereload.Connection.WEBSOCKET_KEY_PATTERN:Ljava/util/regex/Pattern;
aload 0
getfield org.springframework.boot.devtools.livereload.Connection.header:Ljava/lang/String;
invokevirtual java.util.regex.Pattern.matcher:(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
astore 1
start local 1 1: aload 1
invokevirtual java.util.regex.Matcher.find:()Z
ifne 3
2: new java.lang.IllegalStateException
dup
ldc "No Sec-WebSocket-Key"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
3: StackMap locals: java.util.regex.Matcher
StackMap stack:
new java.lang.StringBuilder
dup
aload 1
iconst_1
invokevirtual java.util.regex.Matcher.group:(I)Ljava/lang/String;
invokevirtual java.lang.String.trim:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
start local 2 4: ldc "SHA-1"
invokestatic java.security.MessageDigest.getInstance:(Ljava/lang/String;)Ljava/security/MessageDigest;
astore 3
start local 3 5: aload 3
aload 2
invokevirtual java.lang.String.getBytes:()[B
iconst_0
aload 2
invokevirtual java.lang.String.length:()I
invokevirtual java.security.MessageDigest.update:([BII)V
6: aload 3
invokevirtual java.security.MessageDigest.digest:()[B
invokestatic org.springframework.util.Base64Utils.encodeToString:([B)Ljava/lang/String;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/springframework/boot/devtools/livereload/Connection;
1 7 1 matcher Ljava/util/regex/Matcher;
4 7 2 response Ljava/lang/String;
5 7 3 messageDigest Ljava/security/MessageDigest;
Exceptions:
throws java.security.NoSuchAlgorithmException
void close();
descriptor: ()V
flags: (0x0000)
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
iconst_0
putfield org.springframework.boot.devtools.livereload.Connection.running:Z
1: aload 0
getfield org.springframework.boot.devtools.livereload.Connection.socket:Ljava/net/Socket;
invokevirtual java.net.Socket.close:()V
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/springframework/boot/devtools/livereload/Connection;
Exceptions:
throws java.io.IOException
}
SourceFile: "Connection.java"
InnerClasses:
final Type = org.springframework.boot.devtools.livereload.Frame$Type of org.springframework.boot.devtools.livereload.Frame