|
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.
static Object org.qore.jni.QoreJavaApi.callFunctionSave |
( |
String |
name, |
|
|
Object... |
args |
|
) |
| throws Throwable |
|
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. The top-level hash key is determined by the value of the "_jni_save"
thread-local key, if set, if not then "_jni_save"
is used instead as a literal key
- Parameters
-
name | the name of the function to call |
args | argument to the function call |
- Returns
- the result of the call
- Exceptions
-
Throwable | any Qore-language exception is rethrown here |
static Object org.qore.jni.QoreJavaApi.callFunctionSaveArgs |
( |
String |
name, |
|
|
Object [] |
args |
|
) |
| throws Throwable |
|
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 The top-level hash key is determined by the value of the "_jni_save"
thread-local key, if set, if not then "_jni_save"
is used instead as a literal key
- Parameters
-
name | the name of the function to call |
args | argument to the function call |
- Returns
- the result of the call
- Exceptions
-
Throwable | any Qore-language exception is rethrown here |
static Object org.qore.jni.QoreJavaApi.callStaticMethodSave |
( |
String |
class_name, |
|
|
String |
method_name, |
|
|
Object... |
args |
|
) |
| throws Throwable |
|
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. The top-level hash key is determined by the value of the "_jni_save"
thread-local key, if set, if not then "_jni_save"
is used instead as a literal key
- Parameters
-
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 |
- Returns
- the result of the call
- Exceptions
-
Throwable | any Qore-language exception is rethrown here |
static Object org.qore.jni.QoreJavaApi.callStaticMethodSaveArgs |
( |
String |
class_name, |
|
|
String |
method_name, |
|
|
Object [] |
args |
|
) |
| throws Throwable |
|
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 The top-level hash key is determined by the value of the "_jni_save"
thread-local key, if set, if not then "_jni_save"
is used instead as a literal key
- Parameters
-
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 |
- Returns
- the result of the call
- Exceptions
-
Throwable | any Qore-language exception is rethrown here |
static void org.qore.jni.QoreJavaApi.initQore |
( |
| ) |
throws Throwable |
|
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.