public class io.quarkus.dev.testing.GrpcWebSocketProxy extends java.lang.Object
{
private static final java.util.concurrent.atomic.AtomicInteger connectionIdSeq;
private static volatile io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener;
private static final java.util.Map webSocketConnections;
public void <init>()
{
io.quarkus.dev.testing.GrpcWebSocketProxy v;
v := @this: io.quarkus.dev.testing.GrpcWebSocketProxy;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
public static java.lang.Integer addWebSocket(java.util.function.Consumer, java.util.function.Consumer)
{
io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener v, v;
java.lang.Integer v, v;
java.util.function.Consumer v, v;
java.util.concurrent.atomic.AtomicInteger v;
java.util.Map v;
int v;
v := @parameter: java.util.function.Consumer;
v := @parameter: java.util.function.Consumer;
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener>;
if v == null goto label;
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: java.util.concurrent.atomic.AtomicInteger connectionIdSeq>;
v = virtualinvoke v.<java.util.concurrent.atomic.AtomicInteger: int getAndIncrement()>();
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener>;
interfaceinvoke v.<io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener: void onOpen(int,java.util.function.Consumer)>(v, v);
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: java.util.Map webSocketConnections>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
return v;
label:
return null;
}
public static void closeAll()
{
io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener v;
java.lang.Runnable v;
java.util.Map v, v;
int v, v;
boolean v, v;
java.io.PrintStream v, v;
java.util.Iterator v;
java.util.Set v;
java.util.concurrent.TimeUnit v;
java.util.concurrent.CountDownLatch v;
java.lang.InterruptedException v;
java.lang.Object v, v, v;
v = new java.util.concurrent.CountDownLatch;
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: java.util.Map webSocketConnections>;
v = interfaceinvoke v.<java.util.Map: int size()>();
specialinvoke v.<java.util.concurrent.CountDownLatch: void <init>(int)>(v);
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: java.util.Map webSocketConnections>;
v = interfaceinvoke v.<java.util.Map: java.util.Set entrySet()>();
v = interfaceinvoke v.<java.util.Set: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = interfaceinvoke v.<java.util.Map$Entry: java.lang.Object getValue()>();
virtualinvoke v.<java.lang.Object: java.lang.Class getClass()>();
v = staticinvoke <io.quarkus.dev.testing.GrpcWebSocketProxy$countDown__3040: java.lang.Runnable bootstrap$(java.util.concurrent.CountDownLatch)>(v);
interfaceinvoke v.<java.util.function.Consumer: void accept(java.lang.Object)>(v);
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener>;
v = interfaceinvoke v.<java.util.Map$Entry: java.lang.Object getKey()>();
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
interfaceinvoke v.<io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener: void onClose(int)>(v);
goto label;
label:
v = <java.util.concurrent.TimeUnit: java.util.concurrent.TimeUnit SECONDS>;
v = virtualinvoke v.<java.util.concurrent.CountDownLatch: boolean await(long,java.util.concurrent.TimeUnit)>(5L, v);
if v != 0 goto label;
v = <java.lang.System: java.io.PrintStream err>;
virtualinvoke v.<java.io.PrintStream: void println(java.lang.String)>("Failed to close all the websockets in 5 seconds");
label:
goto label;
label:
v := @caughtexception;
v = <java.lang.System: java.io.PrintStream err>;
virtualinvoke v.<java.io.PrintStream: void println(java.lang.String)>("Interrupted while waiting for websockets to be closed");
label:
return;
catch java.lang.InterruptedException from label to label with label;
}
public static void closeWebSocket(int)
{
int v;
io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener v;
v := @parameter: int;
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener>;
interfaceinvoke v.<io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener: void onClose(int)>(v);
return;
}
public static void setWebSocketListener(io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener)
{
io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener v;
v := @parameter: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener;
<io.quarkus.dev.testing.GrpcWebSocketProxy: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener> = v;
return;
}
public static void addMessage(java.lang.Integer, java.lang.String)
{
io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener v;
int v;
java.lang.String v;
java.lang.Integer v;
v := @parameter: java.lang.Integer;
v := @parameter: java.lang.String;
v = <io.quarkus.dev.testing.GrpcWebSocketProxy: io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener webSocketListener>;
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
interfaceinvoke v.<io.quarkus.dev.testing.GrpcWebSocketProxy$WebSocketListener: void newMessage(int,java.lang.String)>(v, v);
return;
}
static void <clinit>()
{
java.util.concurrent.ConcurrentHashMap v;
java.util.concurrent.atomic.AtomicInteger v;
v = new java.util.concurrent.atomic.AtomicInteger;
specialinvoke v.<java.util.concurrent.atomic.AtomicInteger: void <init>()>();
<io.quarkus.dev.testing.GrpcWebSocketProxy: java.util.concurrent.atomic.AtomicInteger connectionIdSeq> = v;
v = new java.util.concurrent.ConcurrentHashMap;
specialinvoke v.<java.util.concurrent.ConcurrentHashMap: void <init>()>();
<io.quarkus.dev.testing.GrpcWebSocketProxy: java.util.Map webSocketConnections> = v;
return;
}
}