Package com.microsoft.playwright.impl
Class JsonPipe
- java.lang.Object
-
- com.microsoft.playwright.impl.LoggingSupport
-
- com.microsoft.playwright.impl.ChannelOwner
-
- com.microsoft.playwright.impl.JsonPipe
-
- All Implemented Interfaces:
Transport
class JsonPipe extends ChannelOwner implements Transport
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJsonPipe.EventType
-
Field Summary
Fields Modifier and Type Field Description private java.util.Queue<com.google.gson.JsonObject>incomingprivate booleanisClosedprivate ListenerCollection<JsonPipe.EventType>listeners-
Fields inherited from class com.microsoft.playwright.impl.ChannelOwner
connection, guid, initializer, type
-
-
Constructor Summary
Constructors Constructor Description JsonPipe(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckIfClosed()voidclose()protected voidhandleEvent(java.lang.String event, com.google.gson.JsonObject params)(package private) voidoffClose(java.util.function.Consumer<JsonPipe> handler)(package private) voidonClose(java.util.function.Consumer<JsonPipe> handler)com.google.gson.JsonObjectpoll(java.time.Duration timeout)voidsend(com.google.gson.JsonObject message)-
Methods inherited from class com.microsoft.playwright.impl.ChannelOwner
adopt, disposeChannelOwner, runUntil, sendMessage, sendMessage, sendMessageAsync, toProtocolRef, withLogging, withWaitLogging
-
Methods inherited from class com.microsoft.playwright.impl.LoggingSupport
logApi, logApiIfEnabled, logWithTimestamp, withLogging
-
-
-
-
Field Detail
-
incoming
private final java.util.Queue<com.google.gson.JsonObject> incoming
-
listeners
private ListenerCollection<JsonPipe.EventType> listeners
-
isClosed
private boolean isClosed
-
-
Constructor Detail
-
JsonPipe
JsonPipe(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
-
Method Detail
-
send
public void send(com.google.gson.JsonObject message)
-
poll
public com.google.gson.JsonObject poll(java.time.Duration timeout)
-
close
public void close() throws java.io.IOException
-
onClose
void onClose(java.util.function.Consumer<JsonPipe> handler)
-
offClose
void offClose(java.util.function.Consumer<JsonPipe> handler)
-
handleEvent
protected void handleEvent(java.lang.String event, com.google.gson.JsonObject params)- Overrides:
handleEventin classChannelOwner
-
checkIfClosed
private void checkIfClosed()
-
-