The FML application program interface (API) is documented in the weblogic.wtc.jatmi package included in the Javadocs for "WebLogic Server Classes".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: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.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 Programming a Tuxedo ATMI Application Using C.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.
•
• 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).
• 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.
•
•
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.
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.
5. If necessary, compile the VIEW description file for your Oracle Tuxedo application and include the output in your C source file as described in "Using a VIEW Typed Buffer" in Programming a Tuxedo ATMI Application Using C.
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)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.The following code listing is an example FML Description (MyFieldTable) related to the example in Listing 5‑2.Listing 5‑3 Example FML Description