public class BrowserChannelServer extends BrowserChannel implements Runnable
Modifier and Type | Class and Description |
---|---|
static class |
BrowserChannelServer.SessionHandlerServer
Hook interface for responding to messages from the client.
|
BrowserChannel.CheckVersionsMessage, BrowserChannel.ChooseTransportMessage, BrowserChannel.FatalErrorMessage, BrowserChannel.FreeMessage, BrowserChannel.InvokeOnClientMessage, BrowserChannel.InvokeOnServerMessage, BrowserChannel.InvokeSpecialMessage, BrowserChannel.JavaObjectRef, BrowserChannel.JsObjectRef, BrowserChannel.LoadJsniMessage, BrowserChannel.LoadModuleMessage, BrowserChannel.Message, BrowserChannel.MessageType, BrowserChannel.ObjectRefFactory, BrowserChannel.OldLoadModuleMessage, BrowserChannel.ProtocolVersionMessage, BrowserChannel.QuitMessage, BrowserChannel.RemoteDeathError, BrowserChannel.RemoteObjectRef, BrowserChannel.RequestIconMessage, BrowserChannel.ReturnMessage, BrowserChannel.SessionHandler<T extends BrowserChannel>, BrowserChannel.SwitchTransportMessage, BrowserChannel.UserAgentIconMessage, BrowserChannel.Value
Modifier and Type | Field and Description |
---|---|
static String |
JSO_CLASS
Full qualified class name of JavaScriptObject.
|
PROTOCOL_VERSION_CURRENT, PROTOCOL_VERSION_GET_ICON, PROTOCOL_VERSION_OLDEST, SPECIAL_CLIENTMETHODS_OBJECT, SPECIAL_SERVERMETHODS_OBJECT
Constructor and Description |
---|
BrowserChannelServer(TreeLogger initialLogger,
Socket socket,
BrowserChannelServer.SessionHandlerServer handler,
boolean ignoreRemoteDeath)
Create a code server for the supplied socket.
|
Modifier and Type | Method and Description |
---|---|
void |
freeJsValue(int[] ids)
Indicate that Java no longer has references to the supplied JS objects.
|
DevModeSession |
getDevModeSession()
Returns the
DevModeSession representing this browser connection. |
ServerObjectsTable |
getJavaObjectsExposedInBrowser() |
int |
getProtocolVersion() |
BrowserChannel.ReturnMessage |
invoke(String methodName,
BrowserChannel.Value vthis,
BrowserChannel.Value[] vargs,
BrowserChannelServer.SessionHandlerServer handler) |
void |
invokeJavascript(CompilingClassLoader ccl,
JsValueOOPHM jsthis,
String methodName,
JsValueOOPHM[] args,
JsValueOOPHM returnJsValue) |
void |
loadJsni(String jsni)
Load the supplied JSNI code into the browser.
|
protected void |
processConnection() |
void |
reactToMessages(BrowserChannelServer.SessionHandlerServer handler)
React to messages from the other side, where no return value is expected.
|
BrowserChannel.ReturnMessage |
reactToMessagesWhileWaitingForReturn(BrowserChannelServer.SessionHandlerServer handler)
React to messages from the other side, where a return value is expected.
|
void |
run() |
void |
shutdown()
Close the connection to the browser.
|
endSession, getJavaObjectRef, getRefIdsForCleanup, getRemoteEndpoint, getStreamFromOtherSide, getStreamToOtherSide, readUtf8String, readValue, readValueType, sendFreedValues, writeJavaObject, writeJsObject, writeNull, writeTaggedBoolean, writeTaggedByte, writeTaggedChar, writeTaggedDouble, writeTaggedInt, writeTaggedShort, writeTaggedString, writeUtf8String, writeValue
public static final String JSO_CLASS
public BrowserChannelServer(TreeLogger initialLogger, Socket socket, BrowserChannelServer.SessionHandlerServer handler, boolean ignoreRemoteDeath) throws IOException
initialLogger
- socket
- handler
- ignoreRemoteDeath
- IOException
public void freeJsValue(int[] ids)
ids
- array of JS object IDs that have been freededpublic DevModeSession getDevModeSession()
DevModeSession
representing this browser connection.public ServerObjectsTable getJavaObjectsExposedInBrowser()
public int getProtocolVersion()
public BrowserChannel.ReturnMessage invoke(String methodName, BrowserChannel.Value vthis, BrowserChannel.Value[] vargs, BrowserChannelServer.SessionHandlerServer handler) throws IOException, BrowserChannelException
IOException
BrowserChannelException
public void invokeJavascript(CompilingClassLoader ccl, JsValueOOPHM jsthis, String methodName, JsValueOOPHM[] args, JsValueOOPHM returnJsValue) throws Throwable
ccl
- jsthis
- methodName
- args
- returnJsValue
- Throwable
public void loadJsni(String jsni)
jsni
- JSNI source to load into the browserpublic void reactToMessages(BrowserChannelServer.SessionHandlerServer handler)
handler
- RemoteDeathError
public BrowserChannel.ReturnMessage reactToMessagesWhileWaitingForReturn(BrowserChannelServer.SessionHandlerServer handler) throws BrowserChannelException, BrowserChannel.RemoteDeathError
handler
- BrowserChannelException
RemoteDeathError
BrowserChannel.RemoteDeathError
public void shutdown() throws IOException
IOException
protected void processConnection() throws IOException, BrowserChannelException
IOException
BrowserChannelException
Copyright © 2018. All rights reserved.