Protocol objects regulate the flow of data from the communication object to the message frame objects. It is the main container object for other message interaction objects, except data objects, in a message AIM. All data sent to a message AIM by the communication object enters the protocol object, which then controls the passage of data to the message frame objects.
The protocol object identifies the communications object, available message frame objects, control flow objects to run after the communication object is open and after it closes down, and the control flow object to run when the protocol object receives data from the communication object.
The protocol object executes the open control flow object after the communication object connects to the port, executing the close control flow object if the communication object loses the port connection, accepting data from the communication object, executing the preview control flow object after receiving data from the communication object, offering the data to the message frame objects for bidding, and submitting the data to the proper message frame object.
Defining a protocol object
Select Protocol from the list of objects in the main MSG-IDE window and click Add. The Protocol Definition window appears.
Click in the Name field and type a protocol object name; for example, proto1.
In the Communications section, select the communications object used by the protocol object. To build a new communications object, click the ellipsis button. The Communications dialog box appears.
Complete these options:
Open: Select an existing control flow object from the list or click Detail to open the Control Flow dialog box and build a new control flow object. This is the control flow object run by the protocol object after Communication shows that it is up
After you build the control flow object, the name of its associated function appears next to the Run label.
Close: Select from the drop-down list or click Detail to open the control flow dialog box and build a new control flow object. This is the control flow object run by the protocol object when the communication object loses the connection or closes down before the application tells it to.
After you build the control flow object, the name of its associated function appears next to the Run label. If you want the communication object to re-establish the connection to the endpoint application, use restart() within the close control flow.
Preview Data: Select an existing control flow object from the list or click Detail to open the Control Flow dialog box and build a new Control Flow object. This is the control flow object run by the protocol object each time it receives data from the communication object and before it submits that data packet to the message frame objects for bidding. Use this control flow object to view or modify the data packet.
After you build the control flow object, the name of its associated function appears next to the Run label.
Choose one of the following:
To view or modify all data that the protocol object has accumulated to send to the message frame objects for bidding, check the Accumulate Data check box.
To view or modify the data packet that the protocol object just received from the communication object, deselect the Accumulate Data check box.
Choose one of the following:
The AIM Type identifies how the protocol object should handle incoming data. These options do not indicate the data format, only the way the protocol object handles the data.
To accumulate the data received from the communication object, click Stream.
If a message frame object does not make a successful bid on the data, the protocol object leaves the data in the blob, appends the next piece of data from the communication object onto the blob, and submits the accumulated data to the message frame objects. The protocol object does not clear its blob until a message frame object makes a successful bid on some part of the accumulated data.
To have the protocol object not accumulate data, click Block.
If a message frame object does not make a successful bid on the data, the protocol object clears its blob, places the next piece of data from the communication object into its blob, and submits the newly received data to the message frame objects.
At the bottom of the Frames pane, click Include to add an existing message frame object to the protocol object.
The Frames pane displays all message frame objects available to the protocol object. The protocol object submits the data for bidding to the message frame objects based upon their order in the list.
The Include Frame dialog box appears.
Select the message frame object to include from the drop-down list and click OK to return to the Protocol Definition window.
To add to protocol object to the project, click OK.
If you are editing an existing protocol object, click OK to update the object.
Use the start() method to add logic
to the clinit() function to start the Protocol
object (use start() method...
).
For more information, see the e-Biz Impact ODL Guide.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |