CORBA reference binding will use CORBA reference invocation mechanism, which can be used like this:
DynaCorbaRequest request1 = new DynaCorbaRequest(refCalcObject, "div");
//arguments, output type, exceptions configuration
request1.addArgument(2d);
request1.addArgument(2d);
request1.setOutputType(Double.class);
request1.addExceptionType(DivByZeroException.class);
try {
//invocation
DynaCorbaResponse response = request1.invoke();
Double result = (Double) response.getContent(); //retrieve what you want
} catch (Exception e) {
}
Mechanism arguments, return types, exceptions are configured by Java types, which matches with CORBA types. This API will not be used by end user, but knowledge of remote structures and how they maps to Java is required to consume CORBA objects with success.
Feature |
Description |
Solution |
|
TODOs |
|---|---|---|---|---|
Integration with reference binding provider |
CORBA reference binding needs to use CORBA reference mechanism API (DynaCorbaRequest, DynaCorbaResponse classes) |
|
|
Implementation |
Primitives |
Passing variables as an arguments and retrieving return values |
Primitives are mapped as follows (Java - IDL): |
|
INOUT/OUT modifiers |
Structures |
Passing variables as an arguments and retrieving return values |
User defines CORBA structures as simple Java classes, with public fields, ie. |
|
1. Recurrent structures are not handled, ie. |
Sequences |
Passing variables as an arguments and retrieving return values |
User defines CORBA sequence as an array, which may be multidimentional, ie operation: |
|
1. INOUT/OUT modifiers |
References |
Retrieving and passing CORBA references as arguments, return types |
References matches to Java interfaces. Remote objects can be retrieved and dynamic implementation for its interface will be created. Dynamic implementation will allow further CORBA invocations on remote object - those references won't be managed be Apache Tuscany. |
|
1. INOUT/OUT modifiers |
Unions |
Generated Java classes (which bases on idl files) contains discriminator. |
? |
|
Propose a solution |
Arrays |
Cannot distinguish them from sequences. Need to have compile-time info about array size. |
Can be done by annotating variable declared as an argument, or as a structure member, ie. |
|
Chose a solution |
INOUT and OUT argument types |
In CORBA, operation argument value can be changed. As we know Java supports passing arguments by values only, so update on argument is not possible. Such was solved in Java by wrapping arguments in holder classes, ie: |
Solution for determining if Java object was meant to be passed as an IN, INOUT or OUT argument: |
|
Chose a solution |
Exception handling |
|
Actual solution works fine form single exception operations. If operation has more than one declared exception and application exception will occur, then general ExceptionTranslationException will be raised. |
|
Chose a solution |