To use channels and containers in the J2EE Connector Architecture
(JCA), use a MappedRecord structure (ECIChannelRecord) to hold your data. When the MappedRecord is passed to the execute() method
of ECIInteraction, the method uses the MappedRecord itself to create a channel
and converts the entries inside the MappedRecord into containers before passing
them to CICS®.
The MappedRecord allows multiple data records to pass over the same interface
to and from the
execute() method of ECIInteraction. A container
is created for each entry within the channel. There are two data types of
container and you can have a combination of container types in one channel.
The containers are the following types:
- A container with a data type of BIT. This type of container is created
when the entry is a byte[], or implements the javax.resource.cci.Streamable interface.
No code page conversion takes place.
- A container with a data type of CHAR. This type of container is created
when you use a String to create the entry.
You can create your own data records, which must conform to existing JCA
rules (they must implement the javax.resource.cci.Streamable and javax.resource.cci.Record interfaces).
Any data records you create are treated as containers with a data type of
BIT.
You can also use an existing Record type, for example, JavaStringRecord,
to create a container with a data type of BIT.
The MappedRecord.getRecordName method gets the name
of the channel. When creating your Record, you must make sure that the name
is not an empty string. The record.getRecordName method
retrieves the name of the containers.
The JCA resource adapter handles MappedRecords and Records differently,
when it receives the data in the
execute() method of ECIInteraction.
- When a MappedRecord is received, the resource adapter uses a channel to
send the data.
- When a Record (that is not a MappedRecord) is received, the resource adapter
uses a COMMAREA to send the data.
Figure 1. Data conversion
by the execute() method of ECIInteraction, depending on whether it receives
a Record or MappedRecord