Adding a basic terminal

There are two ways to construct a basic terminal: using the default constructor and using the basic terminal constructor.

Default terminal constructor

To create a terminal using the default constructor, first instantiate a terminal, and then use the appropriate setter methods to set the required properties. Use only the setters that apply to a basic terminal. These methods are:

  • setGateway
  • setServerName
  • setDeviceType
  • setNetName
  • setSession

All the set methods, with the exception of setGateway, are optional and have a default setting of null. After you have defined your terminal, install it on the CICS® server using the connect() method. Use only this version of the connect() method. The connect(installTimeout) and connect(Session, InstallTimeout) methods are allowed only for extended terminals. See Installing a terminal on CICS and Synchronization and sessions for further information.

try {
    EPIGateway eGate = new EPIGateway("tcp://MyGateway",2006);
    Terminal term = new Terminal();
    term.setGateway(eGate);
    term.setServerName("CICS1");
    term.connect();
}
catch (IOException ioEx) {
    ioEx.printStackTrace();
}
catch (EPIException epiEx) {
    epiEx.printStackTrace();
}
Basic terminal constructor

The second way is to use the basic terminal constructor. This sets all the required properties and automatically connects you to the CICS Server.

try {
    EPIGateway eGate = new EPIGateway("tcp://MyGateway",2006);
    Terminal term = new Terminal(eGate, "CICS1", null, null);
}
catch (IOException ioEx) {
    ioEx.printStackTrace();
}
catch (EPIException epiEx) {
    epiEx.printStackTrace();
}
Exceptions: As the examples show, you must catch exceptions, irrespective of which method you use to construct a basic terminal.

Information Information

Feedback


Timestamp icon Last updated: Tuesday, 19 November 2013


https://ut-ilnx-r4.hursley.ibm.com/tg_latest/help/topic/com.ibm.cics.tg.doc//progde/cclaojep.html