Using the Sun TCP/IP JCA Adapter

Envelope Message Settings

This section lists and describes message envelope types and their structures, as well as associated parameters. For all envelope types except MarkedAndFixed, the data is the same as the payload.

EndMarked

Specifies the following two-block structure:

  1. a variable number of bytes of data payload, followed by

  2. a single-byte “store until” character

The “store until” character is not part of the payload; it signals that the data stream has ended.

BeginEndMarked

Specifies the following three-block structure:

  1. a single-byte “ignore until” character, followed by

  2. a variable number of bytes of data payload, followed by

  3. a single-byte “store until” character.

The “ignore until” and “store until” characters are not part of the payload; they signal that the data stream is about to begin and has ended.

FixedLength

Specifies the following one-block structure:

  1. a fixed number of bytes of data payload

The number of bytes of data in the block is specified by the setting of the “bytes to read” parameter.

LengthPrefixed

Specifies the following two-block structure:

  1. a two-part Length block consisting of a Numeric Representation part and a Width-of-Length part, followed by

  2. a fixed number of bytes of data payload

The number of bytes of data in the block is specified by the setting of the “bytes to read” parameter.

MarkedAndFixed

Specifies the following four-block structure:

  1. a single-byte “ignore until” character, followed by

  2. a variable number of bytes of data payload, followed by

  3. a single-byte “store until” character, followed by

  4. a fixed number of final bytes to read.

The “ignore until” and “store until” characters are not part of the payload; they signal that the variable-length data stream is about to begin and has ended. The number of bytes of data in the final block is specified by the setting of the “bytes to read” parameter.

PerActiveConnection

Specifies the following one-block structure:

  1. an expected or variable number of bytes of data payload

The connection is closed after the entire (unenveloped) message is sent. If the number of bytes has not been prearranged, then the receiver knows the entire message has been sent because the connection is closed.

Custom

Can specify any type of structure, depending on the “custom enveloped class name” and “customer defined property” parameters.

For optimum performance, use the method receiveEnvelopedMsg() with custom messages that are enveloped. This method uses the envelope as its ending condition, whereas other receiving methods — receiveBytes() and receiveString() — use a time-out as their ending condition.

The following parameters support the message structures listed above.

Custom Enveloped Class Name

Used only by the Custom message structure, which requires this parameter.

Specifies the Java class name to be used. Must be a fully qualified class name, such as “com.abc.MyClass”. The class must implement interfaces com.stc.connector.tcpip.ext.msg.EnvelopedMsgReceiver and com.stc.connector.tcpip.ext.msg.EnvelopedMsgSender.

Customer Defined Property

Used only by the Custom message structure.

Specifies a list of user-defined parameters. You can parse this information, such as delimiters, into your customized envelope message implementation.

Bytes to Read

Default: 1

Specifies the number of bytes of data in a FixedLength message or at the end of a MarkedAndFixed message.

Width Of Length

Default: 1

Used only by the LengthPrefixed message structure, which requires this parameter.

Specifies the number of “digits” to be used to represent the Length field. Values depend on the Numeric Representation parameter, as follows:

Decimal

Width can be set from 1 through 10.

Octal

Width can be set from 1 through 8.

Hexadecimal

Width can be set from 1 through 16.

Network Short

Width must be set to 2.

Network Long

Width must be set to 4.

Numeric Representation

Default: Decimal

Used only by the LengthPrefixed message structure, which requires this parameter.

Specifies whether the number is represented in decimal, octal, hexadecimal, network-short, or network-long.

“Ignore Until” Character Value

Default: 11 (in other words, ASCII character number hexadecimal 0B).

The “ignore until” character is not part of the data payload; it signals that the variable-length data stream is about to begin (in a BeginEndMarked or MarkedAndFixed message).

“Store Until” Character Value

Default: 65 (in other words, ASCII character number hexadecimal 41).

The “store until” character is not part of the data payload; it signals that the variable-length data stream has ended (in an EndMarked, BeginEndMarked, or MarkedAndFixed message).