| Modifier and Type | Method and Description |
|---|---|
JNIConfig |
build()
Builds the
JNIConfig. |
static BinaryMarshaller<StackTraceElement[]> |
defaultStackTraceMarshaller()
Returns a
BinaryMarshaller for stack trace marshalling. |
<T> JNIConfig.Builder |
registerMarshaller(Class<T> type,
BinaryMarshaller<T> marshaller)
Registers a
BinaryMarshaller for the type. |
<T> JNIConfig.Builder |
registerMarshaller(Class<T> type,
Class<? extends Annotation> annotationType,
BinaryMarshaller<T> marshaller)
|
<T> JNIConfig.Builder |
registerMarshaller(org.graalvm.polyglot.TypeLiteral<T> parameterizedType,
BinaryMarshaller<T> marshaller)
Registers a
BinaryMarshaller for the parameterizedType. |
JNIConfig.Builder |
setAttachThreadAction(LongUnaryOperator action)
Registers a callback used by the
NativeIsolate to attach the current thread to an
isolate. |
JNIConfig.Builder |
setDetachThreadAction(LongUnaryOperator action)
Registers a callback used by the
NativeIsolate to detach the current thread from
an isolate. |
JNIConfig.Builder |
setReleaseNativeObjectAction(LongBinaryOperator action)
Registers a callback used by the
NativeObject to free an object in a native image
heap referenced by the garbage-collected handle. |
JNIConfig.Builder |
setShutDownIsolateAction(LongBinaryOperator action)
Registers a callback used by the
NativeIsolate to tear down the isolate. |
JNIConfig.Builder |
setShutDownIsolateAction(LongUnaryOperator action)
Registers a callback used by the
NativeIsolate to tear down the isolate. |
public <T> JNIConfig.Builder registerMarshaller(Class<T> type, BinaryMarshaller<T> marshaller)
BinaryMarshaller for the type.type - the type to register BinaryMarshaller for.marshaller - the marshaller to register.public <T> JNIConfig.Builder registerMarshaller(org.graalvm.polyglot.TypeLiteral<T> parameterizedType, BinaryMarshaller<T> marshaller)
BinaryMarshaller for the parameterizedType.parameterizedType - the type to register BinaryMarshaller for.marshaller - the marshaller to register.public <T> JNIConfig.Builder registerMarshaller(Class<T> type, Class<? extends Annotation> annotationType, BinaryMarshaller<T> marshaller)
type - the type to register BinaryMarshaller for.annotationType - a required annotation to look up the marshaller.marshaller - the marshaller to register.public JNIConfig.Builder setAttachThreadAction(LongUnaryOperator action)
NativeIsolate to attach the current thread to an
isolate.action - a LongUnaryOperator that takes an isolate address as a parameter
and returns the isolate thread address.public JNIConfig.Builder setDetachThreadAction(LongUnaryOperator action)
NativeIsolate to detach the current thread from
an isolate.action - a LongUnaryOperator that takes an isolate thread address as a
parameter and returns 0 on success or non-zero in case of an error.public JNIConfig.Builder setShutDownIsolateAction(LongBinaryOperator action)
NativeIsolate to tear down the isolate.action - a LongBinaryOperator that takes an isolate address and an isolate
thread address as parameters and returns 0 on success or non-zero in
case of an error.public JNIConfig.Builder setShutDownIsolateAction(LongUnaryOperator action)
NativeIsolate to tear down the isolate.action - a LongUnaryOperator that takes an isolate thread address as a
parameter and returns 0 on success or non-zero in case of an error.public JNIConfig.Builder setReleaseNativeObjectAction(LongBinaryOperator action)
NativeObject to free an object in a native image
heap referenced by the garbage-collected handle. At some point after a
NativeObject is garbage collected, a call to the action is made to
release the corresponding object in the native image heap.action - a LongBinaryOperator that takes an isolate thread address and
object handle as parameters and returns 0 on success or non-zero in
case of an error.NativeObjectpublic static BinaryMarshaller<StackTraceElement[]> defaultStackTraceMarshaller()
BinaryMarshaller for stack trace marshalling.