Input/output classes

Using the framework classes gives a generic way of accessing an EIS by means of a J2EE resource adapter. However, because every EIS has different input and output needs, the CCI interfaces provide a way for J2EE components to pass EIS-specific information to a J2EE resource adapter. The following types of object are used for this purpose by a J2EE component:
ConnectionSpec
A ConnectionSpec object can be used to specify security attributes (such as userid and password) used in an interaction with a server.
Note: CICS ignores any security settings specified in a ConnectionSpec object, because it has already established a suitable security context for the connector.

The CCI Connector for CICS® TS's ConnectionSpec class is called ECIConnectionSpec.

InteractionSpec
An InteractionSpec object holds essential attributes necessary for an interaction with a server—for example, the name of the target program. It is passed as a required argument on an Interaction.execute() method call when a particular interaction is to be carried out.

The CCI Connector for CICS TS's InteractionSpec class is called ECIInteractionSpec.

Record
Record objects are beans that hold the data exchanged with the target program—you can think of them as the equivalent of CICS communication areas (COMMAREAs). The data is accessible through Record-defined interfaces.
Figure 1 shows the CCI framework classes and input/output classes being used together to connect to an EIS, pass EIS-specific input/output parameters, and execute a command.
Figure 1. Complete CCI interaction with an EIS
ConnectionFactory cf = <Lookup from JNDI namespace>
ECIConnectionSpec cs = new ECIConnectionSpec();
cs.setXXX();     //Set any connection specific properties

Connection conn = cf.getConnection(cs);
Interaction int = conn.createInteraction();
ECIInteractionSpec is = new ECIInteractionSpec();
is.setXXX();    //Set any interaction specific properties

RecordImpl in = new RecordImpl();
RecordImpl out = new RecordImpl();
int.execute(is,in,out);
int.close();
conn.close();