Using the JCA local ECI resource adapter with channels and containers

To use channels and containers with the JCA local ECI resource adapter, the input and output records must be instances of ECIChannelRecord.

When the ECIChannelRecord is passed to the execute() method of ECIInteraction, the method uses the ECIChannelRecord itself to create a channel and converts the entries inside the ECIChannelRecord into containers before passing them to CICS®.

This example shows how to build an input and output record for use by the JCA local resource adapter using the put() and get() methods on the ECI ChannelRecord.
ECIChannelRecord in = new
					ECIChannelRecord("CHANNELNAME");
					byte[] bitData = "Container with BIT data".getBytes();
					String charData = "Container with CHAR data";
					in.put("BITCONTAINER", bitData);
					in.put("CHARCONTAINER", charData);
					ECIChannelRecord out = new ECIChannelRecord("CHANNELNAME");

					interaction.execute(is, in, out);

					bitData = (byte[]) out.get("BITCONTAINER");
					charData = (String) out.get("CHARCONTAINER");
BIT and CHAR containers are created depending on the type of the entry:
  • A BIT container is created when the entry data is of type byte[] or an object that implements the Streamable interface. No code page conversion takes place.
  • A CHAR container is created when the entry data is of type String. String data is encoded by Unicode and is converted to the encoding of the container. Data read from this container by EXEC CICS GET CONTAINER will be converted according to Using containers for code page conversion.

When creating the ECIChannelRecord, the name must be a valid CICS channel name. Once created the getRecordName() method obtains the name of the channel. When adding containers to the ECIChannelRecord, the container names must be valid CICS container names. Once created the KeySet() method retrieves the names of all the containers.