public class FunctionPointerLogHandler extends Object implements LogHandlerExtension
LogHandler
that can use provided function pointers for each operation. If a function
pointer is missing, it forwards the operation to the delegate set in the constructor.Constructor and Description |
---|
FunctionPointerLogHandler(org.graalvm.nativeimage.LogHandler delegate) |
Modifier and Type | Method and Description |
---|---|
static void |
afterParsingVMOptions()
Notifies that
JNI_CreateJavaVM has finished parsing all JavaVMOption s. |
boolean |
fatalContext(org.graalvm.nativeimage.c.function.CodePointer callerIP,
String msg,
Throwable ex)
This method gets called if the VM finds itself in a fatal, non-recoverable error situation.
|
void |
fatalError() |
void |
flush() |
org.graalvm.nativeimage.c.function.CFunctionPointer |
getFatalErrorFunctionPointer() |
void |
log(org.graalvm.nativeimage.c.type.CCharPointer bytes,
org.graalvm.word.UnsignedWord length) |
static boolean |
parseVMOption(String optionString,
org.graalvm.nativeimage.c.type.WordPointer extraInfo)
Parses a
JavaVMOption passed to JNI_CreateJavaVM . |
public FunctionPointerLogHandler(org.graalvm.nativeimage.LogHandler delegate)
public void log(org.graalvm.nativeimage.c.type.CCharPointer bytes, org.graalvm.word.UnsignedWord length)
log
in interface org.graalvm.nativeimage.LogHandler
public void flush()
flush
in interface org.graalvm.nativeimage.LogHandler
public boolean fatalContext(org.graalvm.nativeimage.c.function.CodePointer callerIP, String msg, Throwable ex)
LogHandlerExtension
LogHandler.log(CCharPointer, UnsignedWord)
. This is requested by returning
true
. Returning false
on the other hand will let the VM know that it can skip
providing this information and immediately proceed with calling LogHandler.fatalError()
from
where it is expected to never return to the VM.
Providing this method allows to implement flood control for fatal errors. The implementor can
rely on LogHandler.fatalError()
getting called soon after this method is called.
fatalContext
in interface LogHandlerExtension
callerIP
- the address of the call-site where the fatal error occurredmsg
- provides optional text that was passed to the fatal error callex
- provides optional exception object that was passed to the fatal error callfalse
is returned the VM will skip providing more specific error related
information before calling LogHandler.fatalError()
.public void fatalError()
fatalError
in interface org.graalvm.nativeimage.LogHandler
public org.graalvm.nativeimage.c.function.CFunctionPointer getFatalErrorFunctionPointer()
public static boolean parseVMOption(String optionString, org.graalvm.nativeimage.c.type.WordPointer extraInfo)
JavaVMOption
passed to JNI_CreateJavaVM
.optionString
- value of the javaVMOption.optionString
fieldextraInfo
- value of the javaVMOption.extraInfo
fieldtrue
iff the option was consumed by this methodpublic static void afterParsingVMOptions()
JNI_CreateJavaVM
has finished parsing all JavaVMOption
s.