Class JNIMethodScope

java.lang.Object
org.graalvm.jniutils.JNIMethodScope
All Implemented Interfaces:
AutoCloseable

public class JNIMethodScope extends Object implements AutoCloseable
Scope of a call from HotSpot to native method. This also provides access to the JNI.JNIEnv value for the current thread within the native method call. If the native method call returns a non-primitive value, the return value must be set within the try-with-resources statement and then retrieved and returned outside the try-with-resources statement. This is necessary to support use of JNI local frames.
  • Constructor Details

    • JNIMethodScope

      public JNIMethodScope(String scopeName, JNI.JNIEnv env)
      Enters the scope of an native method call.
  • Method Details