Qore jni Module
1.2.0
|
This class provides methods that allow Java to interface with Qore code. More...
Static Public Member Methods | |
static void | initQore () throws Throwable |
Initialize the qore library and the jni module from a native Java thread. More... | |
static Object | callFunction (String name, Object... args) throws Throwable |
Calls the given Qore function with the given arguments and returns the result. | |
static Object | callFunctionArgs (String name, Object[] args) throws Throwable |
Calls a Qore function and returns the result as a Java Object, takes a variable number of arguments. | |
static Object | callFunctionSave (String name, Object... args) throws Throwable |
Calls the given Qore function with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data. More... | |
static Object | callFunctionSaveArgs (String name, Object[] args) throws Throwable |
Calls the given Qore function with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data, takes a variable number of arguments. More... | |
static Object | callStaticMethod (String class_name, String method_name, Object... args) throws Throwable |
Calls the given Qore static method with the given arguments and returns the result. | |
static Object | callStaticMethodArgs (String class_name, String method_name, Object[] args) throws Throwable |
Calls a Qore static method and returns the result as a Java Object, takes a variable number of arguments. | |
static Object | callStaticMethodSave (String class_name, String method_name, Object... args) throws Throwable |
Calls the given Qore static method with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data. More... | |
static Object | callStaticMethodSaveArgs (String class_name, String method_name, Object[] args) throws Throwable |
Calls the given Qore static method with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data, takes a variable number of arguments. More... | |
static QoreObject | newObjectSave (String class_name, Object... args) throws Throwable |
Creates a new QoreObject from the class name and constructor arguments; a strong reference to the object is stored in thread-local data. More... | |
static QoreObject | newObjectSaveArgs (String class_name, Object[] args) throws Throwable |
Creates a new QoreObject from the class name and constructor arguments; a strong reference to the object is stored in thread-local data under the given key. More... | |
static StackTraceElement[] | getStackTrace () |
Returns the current stack trace, not including the call to this method. | |
This class provides methods that allow Java to interface with Qore code.
|
inlinestatic |
Calls the given Qore function with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data.
This method can be used to save objects in thread-local data that would otherwise go out of scope; see Managing the Lifecycle of Qore objects from Java for more information
name | the name of the function to call |
args | argument to the function call |
Throwable | any Qore-language exception is rethrown here |
|
inlinestatic |
Calls the given Qore function with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data, takes a variable number of arguments.
This method can be used to save objects in thread-local data that would otherwise go out of scope; see Managing the Lifecycle of Qore objects from Java for more information
name | the name of the function to call |
args | argument to the function call |
Throwable | any Qore-language exception is rethrown here |
|
inlinestatic |
Calls the given Qore static method with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data.
This method can be used to save objects in thread-local data that would otherwise go out of scope; see Managing the Lifecycle of Qore objects from Java for more information
class_name | the name of the class where the static method is defined; can have a namespace-justified path (ex: "Namespace::ClassName" ) |
method_name | the static method name to call |
args | argument to the static method call |
Throwable | any Qore-language exception is rethrown here |
|
inlinestatic |
Calls the given Qore static method with the given arguments and returns the result; if an object is returned, then a strong reference to the object is stored in thread-local data, takes a variable number of arguments.
This method can be used to save objects in thread-local data that would otherwise go out of scope; see Managing the Lifecycle of Qore objects from Java for more information
class_name | the name of the class where the static method is defined; can have a namespace-justified path (ex: "Namespace::ClassName" ) |
method_name | the static method name to call |
args | argument to the static method call |
Throwable | any Qore-language exception is rethrown here |
|
inlinestatic |
Initialize the qore
library and the jni
module from a native Java thread.
This method allows Qore
functionality or Java APIs backed by Qore
APIs to be used from native Java threads in an existing JVM process not started by Qore
itself.
This requires the platform-dependent qore
library to be found in a directory set in the java.library.path
or by setting the QORE_LIBRARY
environment variable to the absolute path of the qore
library.
If neither of these are set, then calling this method will result in a java.lang.UnsatisfiedLinkError
exception being raised.
This method is also safe to call when the Qore library and the jni module have been initialized already.
|
inlinestatic |
Creates a new QoreObject from the class name and constructor arguments; a strong reference to the object is stored in thread-local data.
This method can be used to save objects in thread-local data that would otherwise go out of scope; see Managing the Lifecycle of Qore objects from Java for more information
class_name | the class name or namespace-justified path (ex: "Qore::SQL::SQLStatement" ) of the object to create |
args | optional arguments to the constructor |
Throwable | any Qore-language exception is rethrown here |
|
inlinestatic |
Creates a new QoreObject from the class name and constructor arguments; a strong reference to the object is stored in thread-local data under the given key.
This method can be used to save objects in thread-local data that would otherwise go out of scope; see Managing the Lifecycle of Qore objects from Java for more information
class_name | the class name or namespace-justified path (ex: "Qore::SQL::SQLStatement" ) of the object to create |
args | optional arguments to the constructor |
Throwable | any Qore-language exception is rethrown here |