Method Invocation Syntax |
This topic describes what is needed to define the methods of Java components for RDMI. You can use the Method Lookup wizard to retrieve the method definitions from Java classes. An imported Off the Shelf component can be used as an example of how the RDMI tables are populated. Choose Define, RDMI, J2EE from the Definer menu bar and in the resulting window you can see the syntax that physical method entries use to define the mapping for the methods of components. For calls to J2EE, this syntax is a very limited subset of the Java syntax itself:
<class | object>.<physical method name> All RDMI parameters are passed to the actual call without explicitly specifying them in the physical method (classic RDMI style). The mapping of argument types is:
For example: java.lang.System.getProperty()
<class | object><physical method name>( [:n [, :m]]... ) For example: java.lang.Integer.parseInt(:0) parses a string in argument :0 into an integer.
<class | object>.<physical method name>([(<cast specifier)]<argument>, ...) For example: java.lang.Integer.toHexString((i):0) creates a hexadecimal representation of the integer in :0. Here the Integer is casted to a Java native integer. Without the cast, the native method would be called with a Java Integer Object as its argument. Java would return an invalid method call NOTE: See "Typecasts" for more information on the use of typecasts in method invocation. Possible type casts are specified in the typecast appendix. Literal arguments are understood. For example: java.lang.Integer.toHex((i)"15")
myfile=java.lang.File.createTempFile(:0, ".txt") The myfile object can be used during the lifetime of the RDMI object, so that, for example, another RDMI call can make the call: myfile.exists()
myfile=java.lang.File.createTempFile(:0, ".txt") myfile.exists()
com.usoft.connectors.JdbcTable.InsertRow(argv) argv is mapped onto a Java Array of String objects (String[]) This syntax makes it easy to define generic components that inspect their arguments before processing them. This includes the possibility of using a variable number of arguments. For example, EAI table components can implement their QueryExe method by a physical method: somejavacomponent.QueryExe(argv) The somejavacomponent component, for example, processes its arguments by looping over the argument vector as in: for (int i=0; I < argv.length; I++) process(argv[i]); |