ECI resource adapter CICS-specific records using the streamable interface

For input and output, the ECI resource adapter supports only records that implement the javax.resource.cci.Streamable interface.

MappedRecords that are used to make up channels and containers also conform to the javax.resource.cci.Streamable interface. This interface allows the ECI resource adapter to read streams of bytes that make up the CICS® COMMAREAs or channels and containers directly from, and write them to, the Record objects supplied to the execute() method of ECIInteraction.

The following example shows how to build a record for use as input by the ECI resource adapter, using the method supplied in the javax.resource.cci.Streamable interface.

Byte commarea[] = new byte[10];
ByteArrayInputStream stream = new ByteArrayInputStream(commarea);
Record in = new RecordImpl();
in.read(stream);
int.execute(..., in, ...);

To retrieve a byte array from the output record, use output records write() method using a ByteArrayOutputStream object as the parameter to reverse the process shown in the above example. The streams toByteArray() method then provides the CICS COMMAREA or channel and container output in the form of a byte array. In the above example a class called RecordImpl is used as the concrete implementation class of the javax.resource.cci.Record interface. To provide more function for your specific JEE components, you can write implementations of the Record interface that allow you to set the contents of the record using the constructor. In this way, you avoid the use of the ByteArrayInputStream used in the above example. A managed environment might provide tools that allow you to build implementations of the Record interface that are customized for your JEE components needs without writing any code.


Information Information

Feedback


Timestamp icon Last updated: Wednesday, 27 August 2014


https://ut-ilnx-r4.hursley.ibm.com/tgzos_latest/help/topic/com.ibm.cics.tg.zos.doc//progguide/topics/ccla239.html