Class JNIMethodScope
java.lang.Object
org.graalvm.jniutils.JNIMethodScope
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionJNIMethodScope(String scopeName, JNI.JNIEnv env) Enters the scope of an native method call. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final intdepth()static JNI.JNIEnvenv()Gets theJNI.JNIEnvvalue for the current thread.getEnv()<R extends JNI.JObject>
Rstatic JNIMethodScopescope()Gets the inner mostJNIMethodScopevalue for the current thread.static JNIMethodScopeGets the inner mostJNIMethodScopevalue for the current thread.voidtoString()
-
Constructor Details
-
JNIMethodScope
Enters the scope of an native method call.
-
-
Method Details
-
env
Gets theJNI.JNIEnvvalue for the current thread. -
getEnv
-
scopeOrNull
Gets the inner mostJNIMethodScopevalue for the current thread. -
scope
Gets the inner mostJNIMethodScopevalue for the current thread. -
setObjectResult
-
getObjectResult
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
depth
public final int depth() -
toString
-