Change history for R-Java Omegahat Interface

(Old versions can be downloaded by clicking on the link in the section title for that version.)

SJava_0.69-3

  • User-level converters are now processed always, even if the value is a "built-in" data type.
  • Changed the order in which converters are registered.
  • Added some C-level routines for converting standard types e.g. int[], double[], boolean[] etc. which can be called directly via the .convert argument of SJava and that are registered in the user converters and so can be replaced, prefixed, etc.
  • SJava_0.69-2

  • Errors in R are passed to Java as org.omegahat.R.Java.RException objects.
    This has been waiting for the R exception mechanism and more changes will be necessary when we determine how to reliably access the different classes of R errors.
  • R error messages are not displayed twice when R is embedded within Java.
  • Convert arrays of booleans and Boolean objects properly.
  • Look for libR.so in lib/ not bin/ as it used to be a long time ago.
  • SJava_0.69-0

  • .convert argument for .Java() can now be a routine (native symbol reference) or an R function which avoids the extensive lookup through the different registered converters, but still allows for using the dynamic registered converters if .convert = TRUE. This applies to the .JNew()/.JavaConstructor() and .OmegahatExpression() functions also.

    When we dynamically generate R code to interface to Java classes, we can use this to specify the precise conversion desired and speed up the conversion by avoiding the lookup through the entire collection of dynamic converters.

    See funcConverter.S and routine.S in inst/examples/ of the source distribution.
  • javaIs() uses .convert = getNativeSymbolInfo("R_getJavaBoolean")$address to perform the conversion and avoid recursive queries via the dynamic converter list.
  • This version no longer depends on an old version of antlr (2.4.0) and ships with the latest antlr (2.7.5). This allows the SJava package to be used with Java classes that require more recent versions of antlr. Currently, the limitation that this introduces is that the underlying Omegahat interpreter cannot parse Omegahat/Java textual input into expressions. So the .OmegahatExpression() function no longer works and raises an exception. This may be fixed in the future if there is a desired by "users" to exploit this facility. Everything can be done via the .JNew() and .Java() functions.
  • SJava_0.68-1

  • Add a new default converter for named lists in R to Java java.util.HashMap objects.
    We could use an OrderedTable. One can replace this converter or insert a different one before it via setJavaFunctionConverter( fromJava = FALSE, position = 1).
  • Fixed the conversion of boolean arrays from Java to R.
  • setJavaFunctionConverter() with a non-negative position argument would silently discard all the converters after that position, having added the new one.
  • setJavaFunctionConverter() and the internal mechanism now support/honor the position for the converters from R to Java.
    Previously they ignored such arguments.
  • The converter for dealing with arrays uses simplifyListToVector so, for example, a list of strings (character vectors of length 1) will collapse to a single character vector via unlist().
  • simplifyListToVector returns the original object if it can't be simplified, rather than the erroneous NULL!
  • SJava_0.68-0

  • Unset CLASSPATH environment variable doesn' cause a problem on initialization of the JVM.
  • Marshalling to and from Java uses S functions for many more types via the dynamic user-level conversion mechanism.
  • Added an autoArray argument to setJavaFunctionConverter for converting from Java to R.
  • Additional tests in the tests/ directory.
    TestTypes, etc.
  • Exceptions in Java calls are raised as errors in R.
    This includes cases when there is no method identified either because there are multiple possible methods, or none but a matching field name.
  • The most recent exception object in Java is stored in the Omegahat evaluator's database under the name .Last.exception.
  • Exceptions that arise in Java are raised as JavaException conditions in R and can be processed via tryCatch() calls with a handler for JavaException. The error object is a reference to the java.lang.Exception object and one can do various things with it.
  • Errors when calling R from Java are now raised as org.omegahat.Java.R.RException objects in Java.
    In the future, we hope to introduce additional types of exceptions in both R and Java.
  • Shortcuts for accessing (public) fields in objects via the [[ operator (as in the RDCOMClient package.
    Use obj[["field"]] and obj[["field"]] = pi
  • AnonymousOmegahatReference and NamedOmegahatReference share a common ancestor class - OmegahatReference. These are used to represent a Java object by reference as an R object.
  • The options argument in .JavaInit() are being processed correctly.
    e.g. things like -Xusealtsigs are added to the options in the C call.
  • SJava_0.67-0

  • Argument .convert for .JavaConstructor defaults to FALSE now.
  • Convert the class name in setJavaConverter back to . form (rather than JNI) when calling setJavaConvertible().
  • Removed out of date declaration for R_FindSymbol to make the converters work correctly.
  • Default base class used by ForeignReferenceClassGenerator is RJavaInstance which allows control of whether we split ignore unimplemented methods.
  • Syncrhonized access to the R evaluator so that different Java threads must wait to get access to the evaluator when invoking R functions or evaluating R expressions.
  • SJava_0.66-1

    Patch to release objects returned from Java calls.
    Cleverly found and fixed by Ingo von Otte.

    SJava_0.66-0

    Allow options to be passed to the JVM initialization, motivated by Ingo von Otte.
    This allows command line arguments to the JVM to be passed from R to control things such as and so on.

    SJava_0.65-0

  • Note: The initialization of the Java virtual machine is no longer done in the loading of the the library. Instead it must be done explicitly by the user. This provides greater flexibility in specifying entries for javaConfig(), e.g. classpath, properties and library path elements.
  • javaConfig() now uses the values of the CLASSPATH and LD_LIBRARY_PATH environment variables if these are not specified in the first argument.
  • SJava_0.64-0

    Fixes due to segmentation violation resulting from examples provided by Michael Meyer.
  • Initialization of Java Virtual Machine done automatically and checks whether it has already been started. This simplifies loading the library from within a Java-based application.
  • Protected some global C-level Java variables from garbage collection.
  • SJava_0.63-0

  • Added a position argument when adding a from-Java converter at the R level.
    This allows one to specify the precise position and order within the converter list.
  • Fixed the way we handled references (i.e. AnonymousOmegahatReference and NamedOmegahatReference objects) when we called the user-level conversion.
    We were creating a reference to this reference rather than leaving it as is!
    Fixed S-Plus specific representation when converting float array from Java.
  • SJava_0.62-8

    Rebuild for Windows, version 1.4.*
    Some minor changes to the configuration files for Windows.

    SJava_0.62-7

  • Support for calling R from a Java application under Windows
    See Calling R From Java and the callR.win script in the scripts/ directory.
  • SJava_0.62-6

  • Binary built for R-1.3.1 for Windows.
  • SJava_0.62

  • Additions to the documentation
  • Corrections in scripts looking for the package by its old name, Java, rather than SJava.
  • Changed the name of the package to SJava.
    This avoids conflicts in windows with the DLL for this package and the one provided by the SDK named java.dll (the case is important).
  • The contents of .javaConfig are now computed at run time (when the library is attached), rather than at configuration time, making it easier to configure Windows.
  • Java_0.61

  • Added converters for two-level primitive arrays.
  • Facilities for calling R functions and evaluating R expressions from within Java code directly.
    Documentation in RFromJava
  • Recognize references to arrays and make them S objects of class JavaArrayReference. The [ and [<- operators work for these values.
        z <- .Java(NULL, "testBooleanArrays")
        z[1]
        z[2]
        z[3]
    
  • Example of fitting a linear model in R from Java and getting the results back. (See lmTest.java, lmConvert.R and SLinearModelFit.java all created from RFromJava.nw)
  • Version 0.56

  • Added the C routine getOmegahatReferenceValue to allow converter routines to easily obtain the Java object corresponding to an R reference.
  • Version 0.55

  • Version 0.54

  • Now works with the new Generational Garbage Collection systems introduced in the development branch of R.
    This compiles with 1.1.0 and 1.2.0.
  • Version .53

  • Introduced .JNew .JClass getJavaMethods, getJavaConstuctors
  • In the event of .JavaInit() failing because the manager class was not found, the virtual machine is terminated.
    The intent is to allow it be restarted with different arguments to .JavaInit(). However, this is not usually possible as most JVM implementations only allow one call to JNI_CreateJavaVM. However, the restart mechanism is in place in our code.
  • An EvaluatorManager is now created and registered.
    This means that findFile will work correctly and the environment behaves more like the interactive Omegahat environment.
    Thanks to Ed Kademan's bug report.
  • Set some of the Java System properties in .javaConfig to override some of the properties in OmegaOptions (in the Environment.jar file).
    The new ones are OMEGA_HOME and OmegaSearchPath. This makes the file location within Environment.jar work.
  • Fixed the installation's detection of the version to handle different string values.
    Thanks to Ed Kademan's bug report.
  • Version .52

  • Added the --enable-force argument to the configure script.
    This allows the configuration to ignore unrecognized JVMs or incorrect versions.

    Motivated by Ed Kademan's bug report.

  • Version .51

  • Recognize the Blackdown 1.2.2 JDK in the configuration.
    Thanks to Tony Rossini and Friedrich Leisch.
  • Added more checks to determine if the JVM had been initialized before calling .JavaConstructor and friends.
    Thanks to Friedrich Leisch.
  • Version .50

  • Initial release for R.

  • Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Mon Jan 16 14:17:44 PST 2006