Jolt 1.2 Developer's Guide

System.out.println(din.readShort());
}
}
}
Using the FML Buffer Type
Field Manipulation Language (FML) is a flexible data structure that can be used as a typed buffer. The FML data structure stores tagged values that
are typed, variable in length, and may have multiple occurrences. The typed buffer is treated as an abstract data type in FML.
FML lets you access and update data values without having to know how the data is structured and stored. In your application program, you simply
access or update a field in the fielded buffer by referencing its identifier. To perform the operation, the FML runtime determines the field location
and data type.
FML is especially suited for use with Jolt clients as the client and server code may be in two languages (for example, Java and C), the client/server
platforms may have different data type specifications, or the interface between the client and the server changes frequently.
The following tryOnFml examples illustrate the use of the FML typed buffer. The examples show a Jolt client using FML buffers to pass data to a
server. The server takes the buffer, creates a new FML buffer to store the data, and passes that buffer back to the Jolt client. The examples consist of
the following components:
Example 6-4, tryOnFml.java Source Code is the Jolt client that contains a PASSFML service.
Example 6-5, tryOnFml.f16 Field Definitions is the NonStop
TM
TUXEDO FML field definitions table used by the PASSFML service.
Example 6-6, tryOnFml.c Source Code is the server code fragment that contains the server side C code for handling the data sent by the Jolt
client.
tryOnFml.java Client Code
The tryOnFml.java Java code fragment in Example 6-4 illustrates how Jolt works with a service whose buffer type is FML. The following example
assumes that a session object was already instantiated.
Example 6-4. tryOnFml.java Source Code