jjbridge.engine.v8.inspector.Inspector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jjbridge-engine-v8 Show documentation
Show all versions of jjbridge-engine-v8 Show documentation
A JJBridge library bundled with the V8 JavaScript Engine
package jjbridge.engine.v8.inspector;
import jjbridge.api.inspector.Connection;
import jjbridge.api.inspector.JSBaseInspector;
import jjbridge.api.inspector.JSInspector;
import jjbridge.api.inspector.MessageHandler;
import jjbridge.engine.v8.V8;
import jjbridge.engine.v8.runtime.Runtime;
/**
* The implementation of the {@link JSInspector} using V8 inspector.
* */
public class Inspector extends JSBaseInspector
{
private final V8 v8;
public Inspector(int port, V8 v8)
{
super(port);
this.v8 = v8;
}
@Override
protected MessageHandler newMessageHandler(Connection connection, Runtime jsRuntime)
{
V8MessageHandler messageHandler = createMessageHandler(connection);
messageHandler.initNative(jsRuntime.getNativeHandle());
return messageHandler;
}
V8MessageHandler createMessageHandler(Connection connection)
{
return new V8MessageHandler(connection, v8);
}
}