Tabnine Logo
V8Value.release
Code IndexAdd Tabnine to your IDE (free)

How to use
release
method
in
com.eclipsesource.v8.V8Value

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

origin: eclipsesource/J2V8

protected void addObjectReference(final long objectHandle) throws Error {
  this.objectHandle = objectHandle;
  try {
    v8.addObjRef(this);
  } catch (Error e) {
    release();
    throw e;
  } catch (RuntimeException e) {
    release();
    throw e;
  }
}
origin: jooby-project/jooby

 private void releaseNow(Object value) {
  if (value instanceof V8Value) {
   V8Value ref = (V8Value) value;
   if (!ref.isReleased()) {
    ref.release();
   }
  }
 }
}
origin: eclipsesource/J2V8

protected void addObjectReference(final long objectHandle) throws Error {
  this.objectHandle = objectHandle;
  try {
    v8.addObjRef(this);
  } catch (Error e) {
    release();
    throw e;
  } catch (RuntimeException e) {
    release();
    throw e;
  }
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

private void releaseArguments(final Object[] args, final boolean hasVarArgs) {
  if (hasVarArgs && ((args.length > 0) && (args[args.length - 1] instanceof Object[]))) {
    Object[] varArgs = (Object[]) args[args.length - 1];
    for (Object object : varArgs) {
      if (object instanceof V8Value) {
        ((V8Value) object).release();
      }
    }
  }
  for (Object arg : args) {
    if (arg instanceof V8Value) {
      ((V8Value) arg).release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

private void releaseArguments(final Object[] args, final boolean hasVarArgs) {
  if (hasVarArgs && ((args.length > 0) && (args[args.length - 1] instanceof Object[]))) {
    Object[] varArgs = (Object[]) args[args.length - 1];
    for (Object object : varArgs) {
      if (object instanceof V8Value) {
        ((V8Value) object).release();
      }
    }
  }
  for (Object arg : args) {
    if (arg instanceof V8Value) {
      ((V8Value) arg).release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

protected void addObjectReference(final long objectHandle) throws Error {
  this.objectHandle = objectHandle;
  try {
    v8.addObjRef(this);
  } catch (Error e) {
    release();
    throw e;
  } catch (RuntimeException e) {
    release();
    throw e;
  }
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

@Override
public void clear() {
  map.clear();
  for (V8Value V8Value : twinMap.keySet()) {
    V8Value.release();
  }
  twinMap.clear();
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

protected void addObjectReference(final long objectHandle) throws Error {
  this.objectHandle = objectHandle;
  try {
    v8.addObjRef(this);
  } catch (Error e) {
    release();
    throw e;
  } catch (RuntimeException e) {
    release();
    throw e;
  }
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

@Override
public V remove(final Object key) {
  V result = map.remove(key);
  V8Value twin = twinMap.remove(key);
  if (twin != null) {
    twin.release();
  }
  return result;
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

@Override
public V remove(final Object key) {
  V result = map.remove(key);
  V8Value twin = twinMap.remove(key);
  if (twin != null) {
    twin.release();
  }
  return result;
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

@Override
public void clear() {
  map.clear();
  for (V8Value V8Value : twinMap.keySet()) {
    V8Value.release();
  }
  twinMap.clear();
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

/**
 * Pushes a Java Object to a V8Array by first converting it to a V8Value if needed.
 * If the value is a boxed primitive, then the primitive will be pushed. If the object
 * is a Map / List then a deep copy will be performed, converting the object to a
 * V8Object / V8Array first.
 *
 * @param v8 The runtime on which to create any needed V8Values.
 * @param array The array to push the elements to.
 * @param value The value to push to the array.
 */
public static void pushValue(final V8 v8, final V8Array array, final Object value) {
  Map<Object, V8Value> cache = new Hashtable<Object, V8Value>();
  try {
    pushValue(v8, array, value, cache);
  } finally {
    for (V8Value v8Object : cache.values()) {
      v8Object.release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

/**
 * Pushes a Java Object to a V8Array by first converting it to a V8Value if needed.
 * If the value is a boxed primitive, then the primitive will be pushed. If the object
 * is a Map / List then a deep copy will be performed, converting the object to a
 * V8Object / V8Array first.
 *
 * @param v8 The runtime on which to create any needed V8Values.
 * @param array The array to push the elements to.
 * @param value The value to push to the array.
 */
public static void pushValue(final V8 v8, final V8Array array, final Object value) {
  Map<Object, V8Value> cache = new Hashtable<Object, V8Value>();
  try {
    pushValue(v8, array, value, cache);
  } finally {
    for (V8Value v8Object : cache.values()) {
      v8Object.release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

/**
 * Creates a V8Array from a java.util.List. This is a deep copy, so if the list
 * contains other lists (or maps) they will also be converted.
 *
 * @param v8 The runtime on which to create the result.
 * @param list The list to convert to a V8Array.
 *
 * @return A V8Array representing the list.
 */
public static V8Array toV8Array(final V8 v8, final List<? extends Object> list) {
  Map<Object, V8Value> cache = new Hashtable<Object, V8Value>();
  try {
    return toV8Array(v8, list, cache).twin();
  } finally {
    for (V8Value v8Object : cache.values()) {
      v8Object.release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

/**
 * Creates a V8Object from a java.util.Map. This is a deep copy, so if the map
 * contains other maps (or lists) they will also be converted.
 *
 * @param v8 The runtime on which to create the result.
 * @param map The map to convert to a V8Object.
 *
 * @return A V8Object representing the map.
 */
public static V8Object toV8Object(final V8 v8, final Map<String, ? extends Object> map) {
  Map<Object, V8Value> cache = new Hashtable<Object, V8Value>();
  try {
    return toV8Object(v8, map, cache).twin();
  } finally {
    for (V8Value v8Object : cache.values()) {
      v8Object.release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

/**
 * Creates a V8Object from a java.util.Map. This is a deep copy, so if the map
 * contains other maps (or lists) they will also be converted.
 *
 * @param v8 The runtime on which to create the result.
 * @param map The map to convert to a V8Object.
 *
 * @return A V8Object representing the map.
 */
public static V8Object toV8Object(final V8 v8, final Map<String, ? extends Object> map) {
  Map<Object, V8Value> cache = new Hashtable<Object, V8Value>();
  try {
    return toV8Object(v8, map, cache).twin();
  } finally {
    for (V8Value v8Object : cache.values()) {
      v8Object.release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

/**
 * Creates a V8Array from a java.util.List. This is a deep copy, so if the list
 * contains other lists (or maps) they will also be converted.
 *
 * @param v8 The runtime on which to create the result.
 * @param list The list to convert to a V8Array.
 *
 * @return A V8Array representing the list.
 */
public static V8Array toV8Array(final V8 v8, final List<? extends Object> list) {
  Map<Object, V8Value> cache = new Hashtable<Object, V8Value>();
  try {
    return toV8Array(v8, list, cache).twin();
  } finally {
    for (V8Value v8Object : cache.values()) {
      v8Object.release();
    }
  }
}
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

} finally {
  for (V8Value v8Object : cache.values()) {
    v8Object.release();
origin: com.eclipsesource.j2v8/j2v8_macosx_x86_64

/**
 * Releases this Memory Manager and all V8Objects that were created while
 * this memory manager was active.
 */
public void release() {
  v8.getLocker().checkThread();
  if (released) {
    return;
  }
  releasing = true;
  try {
    for (V8Value reference : references) {
      reference.release();
    }
    v8.removeReferenceHandler(memoryManagerReferenceHandler);
    references.clear();
  } finally {
    releasing = false;
  }
  released = true;
}
origin: com.eclipsesource.j2v8/j2v8_win32_x86_64

/**
 * Releases this Memory Manager and all V8Objects that were created while
 * this memory manager was active.
 */
public void release() {
  v8.getLocker().checkThread();
  if (released) {
    return;
  }
  releasing = true;
  try {
    for (V8Value reference : references) {
      reference.release();
    }
    v8.removeReferenceHandler(memoryManagerReferenceHandler);
    references.clear();
  } finally {
    releasing = false;
  }
  released = true;
}
com.eclipsesource.v8V8Valuerelease

Javadoc

Releases the native resources associated with this V8Value.

Popular methods of V8Value

  • isReleased
    Determine if the native resources have been released. Once released a V8 Value can no longer be used
  • isUndefined
    Determines if this value is undefined.
  • addObjectReference
  • checkReleased
  • createTwin
  • equals
  • getHandle
  • strictEquals
    Performs a JS === on the parameter and the receiver.
  • twin
    Creates a new Java object pointing at the same V8 Value as this. If the value is mutated (by adding
  • close
  • getStringRepresentaion
    Returns a string representation of the V8 Type.
  • getStringRepresentation
    Returns a string representation of the V8 Type.
  • getStringRepresentaion,
  • getStringRepresentation,
  • getV8Type,
  • getRuntime,
  • clearWeak,
  • isWeak

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Path (java.nio.file)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JFrame (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best plugins for Eclipse
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