SJava (version 0.98.0)

javaHandlerGenerator: Manages exporting of R objects to Java/Omegahat and calls from the latter to R objects.

Description

This creates a closure that manages objects exported from the R session to Java/Omegahat as arguments to constructors and methods in that system. When the Java code invokes a method on such a reference, the R object is resolved by this closure and the appropriate R function invoked on that object.

Usage

javaHandlerGenerator()

Arguments

Value

A closure containing the ``methods''
handler()
brokers a method request for a reference under the management of this handler, taking care of passing the arguments, identifying the appropriate method, and catching errors.
createReference()
creates an actual foreignReference object by calling the foreignReference function.
addReference
adds an object to the list being managed by this reference handler. An explicit name can be provided in the call to this method, or otherwise a unique one is generated by the manager itself.
remove
discards the identified object from the list of objects being managed by this reference handler.
getReference
retrieves a particular object being managed by this reference manager using the name of the reference.
references
returns a (named) list of all the objects being managed by this reference manager.
total
returns the number of references that have been managed by this object. This is used in constructing new unique names when an object is registered without an explicit identifier.

References

http://www.omegahat.org/RSJava

Examples

Run this code
## Not run: 
# .JavaInit(callbackHandler = javaHandlerGenerator())
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace