Tabnine Logo
V8Object.close
Code IndexAdd Tabnine to your IDE (free)

How to use
close
method
in
com.eclipsesource.v8.V8Object

Best Java code snippets using com.eclipsesource.v8.V8Object.close (Showing top 20 results out of 315)

origin: eclipsesource/J2V8

@Override
public void close() {
  debugObject.close();
}
origin: eclipsesource/J2V8

@Override
public void close() {
  if (!v8Object.isReleased()) {
    v8Object.close();
  }
}
origin: eclipsesource/J2V8

@Override
public void close() {
  if ((v8Object != null) && !v8Object.isReleased()) {
    v8Object.close();
    v8Object = null;
  }
}
origin: eclipsesource/J2V8

@Override
public void close() {
  if ((v8Object != null) && !v8Object.isReleased()) {
    v8Object.close();
    v8Object = null;
  }
}
origin: eclipsesource/J2V8

@Override
public void close() {
  if ((v8Object != null) && !v8Object.isReleased()) {
    v8Object.close();
    v8Object = null;
  }
}
origin: eclipsesource/J2V8

public void stop() {
  try {
    server.close();
    synchronized (clientLock) {
      if (client != null) {
        client.close();
        client = null;
      }
    }
  } catch (IOException e) {
    logError(e);
  }
  //release resources
  if (runningStateDcp != null) {
    runningStateDcp.close();
    runningStateDcp = null;
  }
  if (debugObject != null) {
    debugObject.close();
    debugObject = null;
  }
  if (stoppedStateDcp != null) {
    stoppedStateDcp.close();
    stoppedStateDcp = null;
  }
};
origin: eclipsesource/J2V8

private static V8Object toV8Object(final V8 v8, final Map<String, ? extends Object> map, final Map<Object, V8Value> cache) {
  if (cache.containsKey(map)) {
    return (V8Object) cache.get(map);
  }
  V8Object result = new V8Object(v8);
  cache.put(map, result);
  try {
    for (Entry<String, ? extends Object> entry : map.entrySet()) {
      setValue(v8, result, entry.getKey(), entry.getValue(), cache);
    }
  } catch (IllegalStateException e) {
    result.close();
    throw e;
  }
  return result;
}
origin: eclipsesource/J2V8

private void setupDebugObject(final V8 runtime) {
  V8Object outerDebug = runtime.getObject(DEBUG_OBJECT_NAME);
  try {
    debugObject = outerDebug.getObject(V8_DEBUG_OBJECT);
  } finally {
    outerDebug.close();
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the value of this property.
 *
 * @return The value of this property.
 */
public Mirror getValue() {
  V8Object mirror = v8Object.executeObjectFunction("value", null);
  try {
    return createMirror(mirror);
  } finally {
    mirror.close();
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the PropertyMiror at a given index.
 *
 * @param index The index of the property
 * @return The property at the given index
 */
public PropertyMirror getProperty(final int index) {
  V8Object result = v8Array.getObject(index);
  try {
    return new PropertyMirror(result);
  } finally {
    result.close();
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the name of the Script associated with
 * this FunctionMirror.
 *
 * @return The name of the script.
 */
public String getScriptName() {
  V8Object script = v8Object.executeObjectFunction(SCRIPT, null);
  try {
    return script.executeStringFunction(NAME, null);
  } finally {
    script.close();
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the underlying V8Object that represents this scope.
 *
 * @return The underlying V8Object that represents this scope.
 */
public ObjectMirror getScopeObject() {
  V8Object mirror = null;
  try {
    mirror = v8Object.executeObjectFunction(SCOPE_OBJECT, null);
    return (ObjectMirror) createMirror(mirror);
  } finally {
    if ( mirror != null ) {
      mirror.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the Function associated with this particular debug frame.
 *
 * @return The Function for this debug frame.
 */
public FunctionMirror getFunction() {
  V8Object function = null;
  try {
    function = v8Object.executeObjectFunction(FUNC, null);
    return new FunctionMirror(function);
  } finally {
    if (function != null) {
      function.close();
    }
  }
}
origin: eclipsesource/J2V8

private void sendCompileEvent(final V8Object eventData) throws IOException {
  if (!isConnected()) {
    return;
  }
  //send event to debugger
  int type = eventData.getInteger("type_");
  V8Object script = eventData.getObject("script_");
  V8Object event = null;
  V8Array params = new V8Array(runtime);
  try {
    params.push(script);
    params.push(type);
    event = debugObject.executeObjectFunction(MAKE_COMPILE_EVENT, params);
    String json = event.executeStringFunction("toJSONProtocol", null);
    if (traceCommunication) {
      System.out.println("Sending event (CompileEvent):\n" + json.substring(0, Math.min(json.length(), 1000)));
    }
    if (json.length() > 0) {
      sendJson(json);
    }
  } finally {
    params.close();
    script.close();
    if (event != null) {
      event.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the value of the argument at the given index.
 *
 * @param index The index of the argument value to return.
 * @return The value of argument at the given index.
 */
public ValueMirror getArgumentValue(final int index) {
  V8Array parameters = new V8Array(v8Object.getRuntime());
  parameters.push(index);
  V8Object result = null;
  try {
    result = v8Object.executeObjectFunction(ARGUMENT_VALUE, parameters);
    if (!isValue(result)) {
      throw new IllegalStateException("Argument value is not a ValueMirror");
    }
    return new ValueMirror(result);
  } finally {
    parameters.close();
    if (result != null) {
      result.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the value of the local variable at the given index.
 *
 * @param index The index of the local to return.
 * @return The value of local at the given index.
 */
public ValueMirror getLocalValue(final int index) {
  V8Array parameters = new V8Array(v8Object.getRuntime());
  parameters.push(index);
  V8Object result = null;
  try {
    result = v8Object.executeObjectFunction(LOCAL_VALUE, parameters);
    if (!isValue(result)) {
      throw new IllegalStateException("Local value is not a ValueMirror");
    }
    return createMirror(result);
  } finally {
    parameters.close();
    if (result != null) {
      result.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the Frame at a given index
 *
 * @param index The stack index
 * @return The stack frame at a given index
 */
public Frame getFrame(final int index) {
  V8Array parameters = new V8Array(v8Object.getRuntime());
  parameters.push(index);
  V8Object frame = null;
  try {
    frame = v8Object.executeObjectFunction(FRAME, parameters);
    return new Frame(frame);
  } finally {
    parameters.close();
    if (frame != null) {
      frame.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Returns the scope at a given index.
 *
 * @param index The index
 * @return The scope
 */
public Scope getScope(final int index) {
  V8Array parameters = new V8Array(v8Object.getRuntime());
  parameters.push(index);
  V8Object scope = null;
  try {
    scope = v8Object.executeObjectFunction(SCOPE, parameters);
    return new Scope(scope);
  } finally {
    parameters.close();
    if (scope != null) {
      scope.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Get the BreakPoint as referenced by the given ID.
 *
 * @param breakPointID The BreakPoint ID.
 * @return The BreakPoint as referenced by the given ID.
 */
public ScriptBreakPoint getScriptBreakPoint(final int breakPointID) {
  V8Array parameters = new V8Array(runtime);
  parameters.push(breakPointID);
  parameters.push(false);
  V8Object scriptBreakPoint = null;
  try {
    scriptBreakPoint = debugObject.executeObjectFunction(FIND_SCRIPT_BREAK_POINT, parameters);
    return new ScriptBreakPoint(scriptBreakPoint);
  } finally {
    parameters.close();
    if (scriptBreakPoint != null) {
      scriptBreakPoint.close();
    }
  }
}
origin: eclipsesource/J2V8

/**
 * Get all the BreakPoint IDs as an array.
 *
 * @return A list of BreakPoint IDs.
 */
public int[] getScriptBreakPointIDs() {
  V8Array breakPoints = debugObject.executeArrayFunction(SCRIPT_BREAK_POINTS, null);
  try {
    int[] result = new int[breakPoints.length()];
    for (int i = 0; i < breakPoints.length(); i++) {
      V8Object breakPoint = breakPoints.getObject(i);
      try {
        result[i] = breakPoint.executeIntegerFunction(NUMBER, null);
      } finally {
        breakPoint.close();
      }
    }
    return result;
  } finally {
    breakPoints.close();
  }
}
com.eclipsesource.v8V8Objectclose

Popular methods of V8Object

  • registerJavaMethod
    Register a Java method reflectively given it's name a signature. The option to include the JS Object
  • <init>
  • get
    Returns the value associated with this key. Values are Java Objects. If the value is a primitive, it
  • executeObjectFunction
    Invoke a JavaScript function and return the result as a V8Object. If the result is not a V8Object th
  • executeStringFunction
    Invoke a JavaScript function and return the result as a String. If the result is not a String, or do
  • executeVoidFunction
    Invokes a JavaScript function which does not return a result.
  • getKeys
    Returns all the keys associated with this JavaScript Object. Keys associated with the objects protot
  • isUndefined
  • release
  • add
    Adds a key value pair to the receiver where the value is a boolean.
  • getArray
    Returns the V8Array value associated with this key. If the value associated with this key does not e
  • getString
    Returns the String value associated with this key. If the value associated with this key does not ex
  • getArray,
  • getString,
  • toString,
  • addUndefined,
  • equals,
  • executeArrayFunction,
  • executeBooleanFunction,
  • executeFunction,
  • executeIntegerFunction,
  • getInteger

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Join (org.hibernate.mapping)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now