RWebServices (version 1.36.0)

generateFunctionMap: Create java wrapper functions for a list of R functions

Description

The generateFunctionMap function generates java wrapper functions for a list of R functions. It also generates java beans and R--Java data type conversions for any R data types that are related to the function but unavailable in the environment lookup. This function also updates environments lookup and cvtImport (see arguments below) as a side effect.

Usage

generateFunctionMap(rTypeInfo, genTest = TRUE, workDir = getwd(), verbose = FALSE, deployModeName = "jms", typeModeName = "javalib", wsdlStyle = "WRAPPED", wsdlUse = "LITERAL", extraClasses = "", pkgRoot="org.bioconductor", ...)

Arguments

rTypeInfo
a list, each component is an instance of RJavaSignature-class and represents the signature of a R function.
genTest
logical, TRUE if want to generate a java program to test the java wrapper functions generated by generateFunctionMap, FALSE otherwise.
workDir
a character string, the path of the directory where this function generates all its outputs.
verbose
logical, TRUE if want to print out debug information, FALSE otherwise.
deployModeName
Character, either "demo" or "jms". How the service will be deployed. "demo" is no longer supported.
typeModeName
Character, either "robject" or "javalib". How Java objects should be generated; see generateDataMap and converters
wsdlStyle
Style of wsdl to create. A value of “WRAPPED” adds “_PortType” to the short name of the main service interface; all other values do not add “_PortType”.
wsdlUse
Whether SOAP bindings are document/literal (value “LITERAL” or document/encoded (any other value). Only “LITERAL” is currently supported.
extraClasses
character. Extra classes requied to convert function argument or return values, e.g., an argument of type list might require information about the classes present in the list. Usually this argument is not required, as S4 classes are parsed to their constituent parts
pkgRoot
character. Root package name of the java classes classes being created. It should be a sequence of one or more character strings delimited by dot, and no dot after the last string
...
Additional arguments, to be compatiable with createMap.

Value

A list, each component is an instance of RJavaSignature-class and represents the signature of a java wrapper function. The return value has a one-to-one mapping relation with input parameter rTypeInfo, i.e. the java wrapper function that is represented by the ith component in the return list, is the wrapper for the R function that is represend by the ith component in rTypeInfo.

Details

The java mappings generated under workDir are organized as following:

  • biocJavaMap The base directory

  • biocJavaMap/package1 Java mappings for functions and data types defined in R package1
  • biocJavaMap/package1/data Java beans and java <-> R mapping functions (in R) for data types defined in pacakge1
  • biocJavaMap/package1/function Java wrapper functions for functions defined in package1
  • biocJavaMap/package2 Java mappings for functions and data types defined in package2
  • biocJavaMap/mainService Main java API, which invokes the java mapping functions for package1, package2, etc. mainService value is provided by user as input.
  • Examples

    Run this code
    ##  This function is usually invoked by createMap.
    

    Run the code above in your browser using DataCamp Workspace