To Embed the Spotfire Enterprise Runtime for R Engine within a Java Application
The terrJava package supports starting a TERR engine from Java, and then sending expressions for TERR to evaluate.
Setting this up is more complicated than starting Java from
TERR
by executing
library(terrJava)
, but it has proven useful for Java
applications that need to call
TERR
computations.
Note: The
TERR
engine is single-threaded, so it is not possible to run more than one
TERR
engine at the same time within a given operating system process. If your Java
application wants to create multiple
TERR
engines, the application must create the engines in multiple operating system
processes. This can be done by creating multiple Java processes with embedded
TERR
engines, and managing communication between them. Alternatively, you can use
the
TerrJavaRemote
class to spawn and control multiple
processes with embedded
TERR
engines, as described in
Setting
up environment variables for a Java application to use Spotfire Enterprise
Runtime for R.
- Setting Up Environment Variables for a Java Application to Use Spotfire Enterprise Runtime for R
For a Java application to use the embedded TERR engine, you must prepare the environment. - Java API for Using an Embedded Spotfire Enterprise Runtime for R Engine
The classcom.tibco.terr.TerrJava
contains a set of static methods that a Java application can call to start an embedded TERR engine, send expressions to be evaluated, add hooks for text input and output, and interrupt a running computation. - To Pass Data Between Java and Spotfire Enterprise Runtime for R
TerrJava methods have limitations for evaluating expressions. - Implement a Console Using the TerrJava API
We have provided the example Java code in both Windows and Linux for a Java application that implements a simple TERR console using the TerrJava API. This is similar to the console application inTerrJava.main
, except that it accesses the TerrJava methods from another class.
- Setting Up Environment Variables for a Java Application to Use Spotfire Enterprise Runtime for R
For a Java application to use the embedded TERR engine, you must prepare the environment. - Java API for Using an Embedded Spotfire Enterprise Runtime for R Engine
The classcom.tibco.terr.TerrJava
contains a set of static methods that a Java application can call to start an embedded TERR engine, send expressions to be evaluated, add hooks for text input and output, and interrupt a running computation. - To Pass Data Between Java and Spotfire Enterprise Runtime for R
TerrJava methods have limitations for evaluating expressions. - Implement a Console Using the TerrJava API
We have provided the example Java code in both Windows and Linux for a Java application that implements a simple TERR console using the TerrJava API. This is similar to the console application inTerrJava.main
, except that it accesses the TerrJava methods from another class.
Parent topic: Using TERR, the terrJava Package, and Java