Invoke operation on CORBA server from R.

Usage

.Corba(.server, .methodName, ..., .wait=T, .deferred=character(1), .send=T)

Arguments

.server CORBA object identifier (IOR or CORBA name) identifying the server whose method will be invoked.
.methodName Name of the server's method to be invoked.
... R arguments to the CORBA call, converted using the default converters.
.wait with .deferred, controls whether the call should be blocking, one-way or deferred.
.deferred If specified, provides the name of a grouping in which one or more background requests will be stored. These can then be queried later.
.send if FALSE, the template request is stored for dispatch in the future. Useful for constructing a collection of calls when arguments are available and deferring their calls until a future time.

Description

Invokes an operation or field accessor in a CORBA server. If the method identifies a CORBA attribute, and no arguments are supplied, its value is retrieved. Alternatively, if a single value is provided, an attempt to set the attribute of the CORBA server is made. If the .methodName identifies The available methods can be dynamically discovered using the function idlInterface.

Details

The arguments can be primitive or more complex R objects. An attempt is made to convert these to the IDL types identified by the parameters of the CORBA operation definition. Conversion to CORBA primitives are defined by the C++ code. Conversion to IDL interfaces can be controlled by registering functions or C/C++ routines to convert R objects. If no converters are registered for the target IDL type, the dynamic conversion process is used, which takes the R object and stores it in a proxy CORBA server. All CORBA calls to it are transferred to it as function calls via the function CorbaMethodEval. In this way, R arguments can become CORBA servers. These function calls will take place in the calling frame of the .Corba.

If any of the arguments are IDL `out' arguments, they can be omitted provided all of the other arguments are named with the same names as used in the IDL. A simple argument matching is performed.

If the call is performed as a background invocation and not one-way, then the .deferred object identifies a table or list in which the request will be stored. The functions getRequestStatus() and getRequestValue can be used to poll the status of the outstanding calls and obtain the result when it has finished.

Value

In a standard blocking call, the value of the method invocation is returned. If this is a CORBA primitve or sequence of primitives, it is converted to an appropriate R type. Otherwise, we search for a converter from the IDL type of the result to an R object. If one exists it is invoked and the result returned. Otherwise, a dynamic reference to the CORBA object is returned, and this can be used in other .Corba calls.

If an exception occurs, this is

Author(s)

Duncan Temple Lang

References

Henning and Vinoski, Allan Pope, OMG CORBA Spec, Papers accompanying this library/ http://www.omegahat.org/CORBA/

See Also

.CorbaServer, idlInterface, addCorbaConverter

Examples


  # Assume there is a CORBA server with the name
  # R/Server and that it has a plot method
  # that takes a CORBA matrix.
 server <- namedCorbaObject("R","Server")
   # Assume that the default and registered converters 
   # will convert an R matrix to a CORBA matrix
 .Corba(server,"plot", matrix(rnorm(3*100),100,3))


[Package Contents]