All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jjbridge.engine.v8.inspector.Inspector Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy