Qore jni Module  1.2.0
org.qore.jni.QoreClosure Class Reference

Java QoreClosure class. More...

Public Member Methods

 QoreClosure (long obj)
 creates the wrapper object with a pointer to an object; this Java object holds a weak reference to the Qore object passed here
 
long get ()
 returns the pointer to the object
 
Object call (Object... args) throws Throwable
 calls the closure / call reference with the given arguments and returns the result More...
 
Object callArgs (Object[] args) throws Throwable
 calls the closure / call reference with the given arguments and returns the result More...
 
Object callSave (Object... args) throws Throwable
 Calls the closure / call reference 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...
 
Object callArgsSave (String name, Object[] args) throws Throwable
 Calls the closure / call reference 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...
 

Private Member Methods

void finalize () throws Throwable
 releases the Qore reference
 

Private Attributes

long obj
 a pointer to the Qore object
 

Detailed Description

Java QoreClosure class.

Since
jni 1.2

Member Function Documentation

◆ call()

Object org.qore.jni.QoreClosure.call ( Object...  args) throws Throwable
inline

calls the closure / call reference with the given arguments and returns the result

Parameters
argsargument to the function call
Returns
the result of the call
Exceptions
Throwableany Qore-language exception is rethrown here
See also
callSave()

◆ callArgs()

Object org.qore.jni.QoreClosure.callArgs ( Object[]  args) throws Throwable
inline

calls the closure / call reference with the given arguments and returns the result

Parameters
argsargument to the function call
Returns
the result of the call
Exceptions
Throwableany Qore-language exception is rethrown here
See also
callMethodArgsSave()

◆ callArgsSave()

Object org.qore.jni.QoreClosure.callArgsSave ( String  name,
Object[]  args 
) throws Throwable
inline

Calls the closure / call reference 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

Parameters
argsargument to the function call
Returns
the result of the call
Exceptions
Throwableany Qore-language exception is rethrown here
See also
jni_qore_object_lifecycle_management

◆ callSave()

Object org.qore.jni.QoreClosure.callSave ( Object...  args) throws Throwable
inline

Calls the closure / call reference 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

Parameters
argsargument to the function call
Returns
the result of the call
Exceptions
Throwableany Qore-language exception is rethrown here
See also
jni_qore_object_lifecycle_management

The documentation for this class was generated from the following file: