|
Programming in Java |
|
|
XCICS supports Java programs, compiled by using JDK 1.4 or higher. Java programming considerations Java classes accessing XCICS services, must use the XCICS XJE APIs, by means of the classes in the package com.hite.xcics. Each Java class acting as an XCICS program must extends the abstract class com.hite.xcics.AbstractProgram, and it must implement a method run(), which is the XCICS entry point. The run() method must be public and must throw ProgramTerminated exception. i.e. public void run() throws ProgramTerminated { Accessing XCICS services XCICS services are invoked by means of an instance of com.hite.XCicsAPI named “cics”, which is a member of AbstractProgram. The methods of XCicsAPI are described in XCICS Java APIs XCicsException exceptions All services accessed by means of object “cics”, throw exceptions extending com.hite.xcics.XCicsException. ProgramTerminated exception The com.hite.xcics.ProgramTerminated exception must never be caught. Accessing the EIB The EIB may be accessed by means of the com.hite.xcics.Dfheiblk class. The current instance of this class is retrieved using the getDfheiblk() method in XCicsAPI. Host Data Mapping package The com.hite.hdm package contains a set of classes useful to access mainframe-style data types such as packed, comp or fixed length character areas (PIC X). Very often it is used to pass data to XCICS services, and it may also be use to handle mainframe-like user fields. An example program import com.hite.xcics.*;
|