• FML is a set of java language functions for defining and manipulating storage structures called fielded buffers. Each fielded buffer contains attribute-value pairs in fields. For each field:
• The FML application program interface (API) is documented in thepackage included in the Javadocs for "WebLogic Server Classes".Field tables are generated in a manner similar to Oracle Tuxedo field tables. The field tables are text files that provide the field name definitions, field types, and identification numbers that are common between the two systems. To interoperate with an Oracle Tuxedo system using FML, the following steps are required:For example: Your Oracle Tuxedo distribution contains a bank application example called bankapp. It contains a file called bankflds that has the following structure:
2. Converted the field table definition into Java source files. Use the mkfldclass/mkfldclass32 utility supplied in the weblogic.wtc.jatmi package. This class is a utility function that reads a FML/FML32 Field Table and produces a Java file which implements the FldTbl interface. There are two instances of this utility:Use the correct instance of the command to convert the bankflds field table into FML32 java source. The following example uses mkfldclass.The resulting file is called bankflds.java and has the following structure:The result is a bankflds.class file. When loaded, the Oracle Tuxedo Java server uses the class file to add, retrieve and delete field entries from an FML field.
3. Compile the userTable file using the following command:
4. Once you have created the userTable.class file, you can modify the FML table and deploy the changes without having to manually create an updated userTable.class. When the Java server is started, Java server will load the updated FML table.If the Path_to_Your_FML_Table attribute changes, you will need to use the preceding procedure to update your userTable.java and userTable.class files.Two new constructors for TypedFML32 are available to improve performance. The following topic provides explanation as to when to use these constructors.To gain TypedFML32 performance improvements, you can choose to give size hints to TypedFML32 constructors. There are two parameters that are available to those constructor:For instance, a field table used by the buffer contains 20 field IDs, and each field can occur 20 times. In this case, the first parameter should be 400 for the maximum number of fields. The second parameter should be 20 for the total number of field IDs.
Note: If you have an extremely small buffer, use those constructor without hints. An example of an extremely small buffer is a buffer with less than 16 total occurrences. If the buffer is extremely large, for example contains more than 250000 total field occurrences, then the application should consider splitting it into several buffers smaller than 250000 total field occurrences.Oracle Tuxedo Java server allows you to use a Java VIEW buffer type analogous to an Oracle Tuxedo VIEW buffer type derived from an independent C structure. This allows Oracle Tuxedo Java server classes and Oracle Tuxedo applications to pass information using a common structure.For more information on Oracle Tuxedo VIEW buffers, see "Using a VIEW Typed Buffer" in .Your Oracle Tuxedo Java server class and your Oracle Tuxedo application must share the same information structure as defined by the VIEW description. The following format is used for each structure in the VIEW description file:
• The file name is the same as the VIEW name.
• You can have only one VIEW description per file.
• The VIEW description file is the same file used for both the viewj compiler and the Oracle Tuxedo viewc compiler.
• You can include a comment line by prefixing it with the # or $ character.
• The following table describes the fields that must be specified in the VIEW description file for each structure.
Table 5‑2 VIEW Description File Fields Data type of the field. Can be set to short, long, float, double, char, string, carray, or dec_t (packed decimal).
• L-hold number of bytes transferred for STRING and CARRAY For STRING and CARRAY buffer types, specifies the maximum length of the value. This field is ignored for all other buffer types. User-specified NULL value, or minus sign (-) to indicate the default value for a field. NULL values are used in VIEW typed buffers to indicate empty C structure members.The default NULL value for all numeric types is 0 (0.0 for dec_t). For character types, the default NULL value is '\0'. For STRING and CARRAY types, the default NULL value is " ".Constants used, by convention, as escape characters can also be used to specify a NULL value. The VIEW compiler recognizes the following escape constants: \ddd (where d is an octal digit), \0, \n, \t, \v, \r, \f, \\, \', and \".You may enclose STRING, CARRAY, and char NULL values in double or single quotes. The VIEW compiler does not accept unescaped quotes within a user-specified NULL value.You can also specify the keyword NONE in the NULL field of a VIEW member description, which means that there is no NULL value for the member. The maximum size of default values for string and character array members is 2660 characters.The following provides an example VIEW description which uses VIEW buffers to send information to and receive information from an Oracle Tuxedo application. The file name for this VIEW is infoenc.Listing 5‑1 Example VIEW Description
Note: fbname and null fields are not relevant for independent Java and C structures and are ignored by the Java and C VIEW compiler. You must include a value (for example, a dash) How to Use the viewj CompilerHow to Use the viewj Compileras a placeholder in these fields.To compile a VIEW typed buffer, run the viewj command, specifying the package name and the name of the VIEW description file as arguments. The output file is written to the current directory.To use the viewj compiler, enter the following command:To use the viewj32 compiler, enter the following command:
Table 5‑3 Arguments for the Commands for viewj Compiler Use to set AssociatedFieldHandling to true. This allows set and get accessor methods to use the values of the associated length and count fields if they are specified in the VIEW description file. If not specified, the default value for AssociatedFieldHandling is false.
• Use to create set and get accessor names that follow JavaBeans naming conventions. The first character of the field name is changed to upper case before the set or get prefix is added. The signature of indexed set accessors for array fields changes from the default signature of void setAfield (T value, int index) to void setAfield (int index, T value).Use to create set and get accessor names that are formed by taking the field name from the VIEW description file and adding a set or get prefix. Provides compatibility with releases prior to WebLogic Server 8.1 SP2. Default value is -compat_names if -bean_names or -compat_names is not specified.Use to generate different Java code for encoding strings sent to Oracle Tuxedo and decoding strings received from Oracle Tuxedo. Encoding code adds a null character to the end of each string. Decoding code truncates each string at the first null character received.
• Use to generate output class as extending TypedXCommon instead of TypedView.
• Use to generate output class as extending TypedXCType instead of TypedView.
Note: -compat_names and -bean_names are mutually exclusive options. Example: examples.wtc.atmi.simpview Example: Infoenc
• A VIEW buffer is compiled as follows:
• A VIEW32 buffer is compiled as follows:The output of the viewj and viewj32 command is a .java source file that contains set and get accessor methods for each field in the VIEW description file. Use these set and get accessor methods in your Java applications to pass information to and from a VIEW buffer.The AssociatedFieldHandling flag is used to specify if the set and get methods use the values of the associated length and count fields if they are specified in the VIEW description file.set methods set the count for an array field and set the length for a string or carray field.
• Use one of the following to set or get the state of the AssociatedFieldHandling flag:
• Use the -associated_fields option for the viewj and viewj32 compiler to set the AssociatedFieldHandling flag to true.
• Invoke the void setAssociatedFieldHandling (boolean state) method in your Java application to set the state of the AssociatedFieldHandling flag.
• The default state is false.
• Invoke the boolean getAssociatedFieldHandling() method in your Java application to return the current state of AssociatedFieldHandling.Use the following steps when incorporating VIEW buffers in your JATMI applications:
1. Create a VIEW description file for your application as described above.
2. Compile the VIEW description file as described above.
3. Use the set and get accessor methods to pass information to and receive information from a VIEW buffer as described above.
4. Import the output class of the VIEW compiler into your source code.
6. Configure the fully qualified class name of the compiled Java VIEW description file in <Resources> section in Tuxedo Java server configuration. The class of the compiled Java VIEW description file should also be included in <ClassPath> of your configuration file.For example: (for VIEW32)<ViewFile32Classes> examples.javaserver.atmi.simpview</ViewFile32Classes>A helper class is available to add and get VIEW32 data in and out of an FML32 buffer. The class name is wtc.jatmi.FViewFld. This class assists programmers in developing JATMI-based applications that use VIEW32 field type for FML32 buffers.No change to configuration is required. You still configure the VIEW32 class using the ViewFile32Classes attribute in the <Resources> section of the Tuxedo Java server configuration file.Listing 5‑3 Example FML Description