Class JNICalls
java.lang.Object
org.graalvm.jniutils.JNICalls
Support for calling into HotSpot using JNI. In addition to calling a method using JNI, the
JNICalls also perform JNI call tracing and exception handling. All JNI calls into HotSpot
must use this support to correctly merge HotSpot and native image stack traces.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleancallBoolean(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningboolean.bytecallByte(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningbyte.charcallChar(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningchar.doublecallDouble(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningdouble.floatcallFloat(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningfloat.intcallInt(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningint.<R extends JNI.JObject>
RcallJObject(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningObject.longcallLong(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returninglong.<R extends JNI.JObject>
RcallNewObject(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod constructor, JNI.JValue args) Creates a new object instance using a given constructor.shortcallShort(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningshort.booleancallStaticBoolean(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returningboolean.intcallStaticInt(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returningint.<R extends JNI.JObject>
RcallStaticJObject(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returningObject.longcallStaticLong(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returninglong.voidcallStaticVoid(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static void method.voidcallVoid(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a void method.static JNICallsCreates a newJNICallsinstance with a custom exception handler.static JNICallsReturns aJNICallsinstance with a default exception handler.
-
Method Details
-
getDefault
Returns aJNICallsinstance with a default exception handler. The default exception handler rethrows any pending JNI exception as aJNIExceptionWrapper. -
createWithExceptionHandler
Creates a newJNICallsinstance with a custom exception handler. The given exception handler is used to handle pending JNI exceptions. -
callStaticVoid
public void callStaticVoid(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static void method. -
callStaticBoolean
public boolean callStaticBoolean(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returningboolean. -
callStaticLong
public long callStaticLong(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returninglong. -
callStaticInt
public int callStaticInt(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returningint. -
callStaticJObject
public <R extends JNI.JObject> R callStaticJObject(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a static method returningObject. -
callNewObject
public <R extends JNI.JObject> R callNewObject(JNI.JNIEnv env, JNI.JClass clazz, JNICalls.JNIMethod constructor, JNI.JValue args) Creates a new object instance using a given constructor. -
callVoid
public void callVoid(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a void method. -
callJObject
public <R extends JNI.JObject> R callJObject(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningObject. -
callBoolean
public boolean callBoolean(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningboolean. -
callShort
public short callShort(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningshort. -
callInt
Performs a JNI call of a method returningint. -
callLong
public long callLong(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returninglong. -
callDouble
public double callDouble(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningdouble. -
callFloat
public float callFloat(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningfloat. -
callByte
public byte callByte(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningbyte. -
callChar
public char callChar(JNI.JNIEnv env, JNI.JObject object, JNICalls.JNIMethod method, JNI.JValue args) Performs a JNI call of a method returningchar.
-