Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EDT:IBMi GenerationAndRuntime

Revision as of 16:32, 5 July 2012 by Jvincens.us.ibm.com (Talk | contribs) (New page: The specification for the IBMi implementation is attached to bugzilla [https://bugs.eclipse.org/bugs/show_bug.cgi?id=366706 366706]. The spec says bytes is not complete, it's been implemen...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The specification for the IBMi implementation is attached to bugzilla 366706. The spec says bytes is not complete, it's been implemented but there are no tests, so it's coded but not finished.

The generator code resides in org.eclipse.edt.gen.java.templates.eglx.jtopen.

The mofcode resides in org.eclipse.edt.mof.eglx.jtopen.

The runtime code resides in org.eclipse.edt.runtime.java.jtopen.

The jt400 jar resides in org.jtopn.

The test suite resides in the IBM CVS org.eclipse.edt.eunit.test.ibmi/thirdparty.programs. This project includes the COBOL and RPG source used by the tests. RDP was used to develop the host code. Neither the COBOL or RPG is very complicated, it adds to the values passed in.

There is a presentation for IBMi on the stakeholders meeting page under IBM i support. There are a few things that changed:

    • the annotations are now prefixed with Struct instead of AS400
    • the default connection was specified on the IBMiProgram annotation, now specified with @Resource on the proxy function
    • Limited stringis now supported, so StructText is only required when the string is not parameterized.
org.eclipse.edt.mof.eglx.jtopen:

provides the mof model support. It contains the a factory that returns Java representation of the IR parts used for the Call Statement and Function part used to drive the generator plugin org.eclipse.edt.gen.java.templates.eglx.jtopen.

  • During compilation call statements and function parts are evaluated.
    • If the call statement targets an IBMi proxy function (it has an IBMiProgram annotation) the IR created is an IBMi call statement IR.
    • If the function has an **IBMiProgram annotation the IR created is an IBMi Function.
org.eclipse.edt.gen.java.templates.eglx.jtopen:

Generates the code needed for IBMi calls. There are 2 entry points in the generator:

  • The function part: 2 are Java methods are generated.
    • The first is the named method this is generated so if other code does a simple function call there is a generated target method. The body of this method is a function invocation to the 2nd function referred to as the proxy function.
    • The proxy function contains the code that calls the host program.
      • First code is generated to handle the @Resource on the function.
      • The program name is generated
      • If it's a service program generate the procedure name and return type
      • create an array of parameter kinds
      • create an array of arguments
      • create an array of as400classes to be used for conversion of the parameters. This process uses a couple of helper classes to gen the AS400 types.
      • pass everything created to the runtime to call the host.
      • once the call returns generate code to resize the arrays based on the resize parameter/field. The resize is done by creating an array resize expression in the code.
  • The call statement. This code creates a function invocation statement. The target of the invocation is the generated proxy java method and it passes the arguments specified in the call plus the variable specified in the using expression.
org.eclipse.edt.runtime.java.jtopen:

provides the runtime support for the IBM I extension.

  • It provides the IBMi connection and classes to support the AS400ConnectionPool.
  • Data conversion extensions of jt400.jar classes. As stated in the doc and ppt data conversion is handled by the AS400 classes from the jt400.jar. If you look in org.eclipse.edt.java.jtopen.access you will see 7 conversion classes. These classes are there because the underlying AS400 class would not directly convert the data to our runtime.
    • AS400UnsignedBin8: the jtopn code uses a BigInteger and EDT uses a BigDecimal, so this class handles the conversion.
    • AS400Bin1: the jtopn code uses a byte and EDT uses a short, so the class handles the conversion.
    • AS400Text: this class handles: the trimming or preserving of trailing while white space, the character length to byte length conversion, character encoding support.
    • AS400Array handles the conversion from AS400Array to EDT runtime lists.
    • AS400Timestamp, AS400Time, and AS400Date: The jtopn code is expecting java.sql.Timestamp, Time, Date, or java.util.Date. These classes convert those types to/from our ETimestamp, ETime, EDate objects.
  • The resource binding support needed for the egldd IBMiConnection entries.
org.eclipse.edt.java.jtopen

provides a helper class for the data conversion and a class to handle the runtime conversion to bytes, call to the host and conversion from bytes back to objects.

Back to the top