![]() |
![]() |
![]() |
![]() |
![]() |
• The ATMI Java server TMJAVASVR, is a new Oracle Tuxedo system server acting as a bridge between the Tuxedo system and Java-implemented services. Tuxedo Java server mainly performs the following tasks:Before running TMJAVASVR, you must make sure the libjvm.so (Unix) or jvm.dll (Windows) is located in the library loading path of your platform.
• On Oracle Enterprise Linux (64 bit) and Java SE, make sure $JRE_HOME/lib/amd64/server is included in $LD_LIBRARY_PATH.
• On Oracle Enterprise Linux (64 bit) and Oracle JRockit JVM, make sure $JRE_HOME/lib/amd64/jrockit and $JRE_HOME/lib/amd64 are included in $LD_LIBRARY_PATH.
• On AIX PPC64, we suggest that you include both $JRE_HOME/lib/ppc64/classic and $JRE_HOME/lib/ppc64 in $LIBPATH.
•
•
•
Note: The $JRE_HOME points to the JRE home directory. You can also refer to $TUXDIR/tux.env for the setting.
• Configure the path where the Tuxedo Java server finds the configuration file for the Java-implemented services in TMJAVASVR CLOPT. For more information see, TMJAVASVR(5)
• Specify MINDISPATCHTHREADS and MAXDISPATCHTHREADS for Java server to decide its running mode: the multi-thread mode or the single-thread mode.If neither MINDISPATCHTHREADS nor MAXDISPATCHTHREADS is specified or if MAXDISPATCHTHREADS is specified to 1, Java server runs in the single-thread mode; other than that, Java server runs in multi-thread mode.Listing 1‑1 shows an example.Listing 1‑1 TMJAVASVR Configurations in UBBCONFIG ExampleThere are three Oracle Tuxedo Java server configuration file versions: 2.1, 2.0, and 1.0. (the corresponding schema files are: TJSconfig_2.1.xsd, TJSconfig_2.0.xsd, and TJSconfig_1.0.xsd). All are installed in the $TUXDIR/udataobj/tuxj (Unix), or %TUXDIR%\udataobj\tuxj (Windows) directory.Version 2.1 introduces an element with the tag identifier "server-module" (similar to the previous tux-server-config element). A server-module element can own multiple classpaths and server-class child elements.These child elements are bundled in a separate server module that is easier to manage. Also, some new attributes are added in version 2.1 configuration file.If the version attribute is specified, Java server searches the current built-in version table to validate if the version value is supported by Java server or not. If validation fails, Java server stops initializing, and exits. If the version is valid , then Java server loads the corresponding schema file for further configuration file validation.
Note: Though all versions are supported, it is strongly suggested to use version 2.1 (specify version attribute in TJSconfig to 2.1). If version attribute is not set, Java server treats the configuration file as version 1.0 by default.It is the root element of Tuxedo Java server configuration file. Java server firstly does a pre-fetching operation to verify whether TJSconfig exists in the current configuration file. If TJSconfig is not found, Java server logs an error and exits. Table 1‑1 lists the complete set of TJSconfig attribute.
Table 1‑1 TJSconfig Attribute java-config specifies JVM options that are read by Java server and passed to JVM when Java server creates JVM. These options are used to tune JVM or pass extra properties to JVM. With this element, users can control JVM behaviors in terms of GC policy, stack size, heap size, and so on. Table 1‑2lists the complete set of java-config nested elements.
Table 1‑2 java-config Nested Elements It is allowable to specify multiple JVM options in one jvm-options; these options should be separated by spaces.
Note: Java server doesn’t validate any specified JVM options but only construct the standard JNI JVM initialization data structure with these options and pass them into JVM to handle; however, for -Xms and -Xmx, if users do not specify these two options, Oracle Tuxedo Java server replaces their built-in values with 256m and 256m, respectively, on IBM AIX 6.1 (32-bit) on IBM PowerPC, or with 256m and 512m, respectively, on Oracle Linux 5.6 (64-bit) on Exalogic 2.0.tux-config specifies attributes related to Tuxedo applications. Table 1‑3 lists the complete set of tux-config nested elements.
Table 1‑3 tux-config Nested Elements Specifies some startup options for the implemented methods, tpsvrinit(String []) and tpsvrthrinit(String[]), in Java server classes. More specifically, if users' Java server classes implement at least one of these two methods, Java server reads these options, constructs a string array, and passes the string array to the implemented method(s). Specifies the KV pairs. Application can obtain the pairs by using the getTuxConfigProperty(K) interface.It is allowable to specify multiple options in one server-clopt; these options should be separated by spaces.classpath-config specifies the packages used to look for user-defined classes. Differed from ClassPaths in version 1.0, classpath string in version 2.0 can be specified with a variable externally defined by an environment variable or a JVM option string specified in jvm-options with "-D" option. For example,When adding this class path, Java server firstly searches jvm-options list to find whether -DUSER_JAVA_LIB=… is already specified. If it is found, Java server replaces the USER_JAVA_LIB with the value specified in -DUSER_JAVA_LIB= and passes the result to the class path searching list; otherwise, Java server finds whether the environment variable USER_JAVA_LIB is specified and passes the result to the class path searching list. If neither -DUSER_JAVA_LIB=… nor the environment variable USER_JAVA_LIB is found, Java server skips the unspecified class paths and logs an error in ULOG.Table 1‑4 lists the complete set of classpath-config nested elements.
Table 1‑4 classpath-config Nested Elements It is allowable to specify multiple class paths in one classpath; these class paths should be separated by system path separators (";" in Windows platforms; ":" in Unix-like platforms).tux-resources specifies view/view32 and fml/fml32 typed buffer classes to instantiate buffer resource objects. Table 1‑5 lists the complete set of tux-resources nested elements.
Table 1‑5 tux-resources Nested Elements
Note: Users can also specify the class paths of Tuxedo typed buffer classes in classpath-config element. Users can specify multiple FML/FML32/VIEW/VIEW32 classes in one element; these classes should be separated by commas.Please refer to Developing Oracle WebLogic Tuxedo Connector Applications for Oracle WebLogic Server for more information about jatmi typed buffer.Users can directly use viewj/viewj32 compilers and mkfldclass/mkfldclass32 utilities to generate corresponding VIEW/VIEW32 classes and FML/FML32 classes. Before running these compilers or utilities, specify the class path, where $TUXDIR/udataobj/tuxj/com.bea.core.jatmi_12.2.2.0.jar is included.jdbc-resources specifies the JDBC compatible data source parameters. Table 1‑6 lists the complete set of jdbc-resources nested elements.
Table 1‑6 jdbc-resources Nested Elements
Table 1‑7 data-source Attributes
Table 1‑8 data-source Nested Elements Specifies the data source driver package path. Users can also specify the driver class path in classpath-config element. Table 1‑9 lists the complete set of driver-params nested elements.
Table 1‑9 driver-params Nested Elements Table 1‑10tux-server-config specifies Java server class attributes.
Table 1‑10 tux-server-config Attributes tux-server-config contains the nested element sever-module.Table 1‑11 list the complete set of tux-server-config/server-module attributes.
Table 1‑11 tux-server-config/server-module Attributes The server-module name must be unique within all server-module names in the <tux-server-config> element section and cannot contain an asterisk (*), comma (,), or colon (:). Table 1‑12 list the complete set of tux-server-config/server-module nested elements.
Optional. It specifies the class path for server classes. Users can also specify the class path in classpath-config section. Specifies the argument parameters and pass them to tpsvrinit(). Specifies the KV pairs. Application can obtain the pairs by using the getTuxConfigProperty(K) interface. Contains a nested element called services.tux-server-config/server-module/server-class attributes are listed in Table 1‑13
Optional. The default value is "yes" to keep compatible with previous releases.server-class also has a nested element called services. services has a nested element called service.Table 1‑14 list the complete set of tux-server-config/server-module/server-class/services/service attributes.
Table 1‑14 service Attributes Specifies the method implemented in server class. The method must be declared with TPSVCINFO parameter and with a void type of return value.Each Tuxedo Java server class that implements services must implement a set of methods, of which input argument parameter is the TPSVCINFO interface. The methods that are advertised as services must be the public method and have the return type set to void.Tuxedo Java server advertises all of public methods as services into bulletin board. If Services is specified in configuration file, Tuxedo Java server uses the value of name property as the service name, otherwise, the method name is used as the service name.
1. Advertise a Tuxedo service with the name specified in the configuration file <tux-server-config>/<server-module>/<server-class>/<services>/<service>:name and associate this Tuxedo service with the Java method specified in <tux-server-config>/<server-module>/<server-class>/<services>/<service>:target.In this sample, the Java method1 implemented in Java class MyTuxedoServerClass is associated with the Tuxedo service svc1. The exact service handling logic is implemented in MyTuxedoServerClass.method1 writen in Java language.
2. If a Java service method implemented in a Java server class specified in the configuration file is not referred, and the "autoadv" attribute of the Java server class is not set (default value is "yes" to keep compatible with previous releases) or explicitly set to "yes", then the service method is advertised to a Tuxedo service with the name same as the service method.
3. Invoking TuxAppContext.tpadvertise() to advertise a Tuxedo service. Using this method, the Java server application does not need to explicitly specify the Java server class in the configuration file, and the server class does not inherit from the abstract class com.oracle.tuxedo.tjatmi.TuxedoJavaServer.Listing 1‑3 Configuration File Version 2.1ExampleIt is the root element of Tuxedo Java server configuration file. Java server firstly does a pre-fetching operation to verify whether TJSconfig exists in the current configuration file. If TJSconfig is not found, Java server logs an error and exits. Table 1‑15 lists the complete set of TJSconfig attribute.
Table 1‑15 TJSconfig Attribute java-config specifies JVM options that are read by Java server and passed to JVM when Java server creates JVM. These options are used to tune JVM or pass extra properties to JVM. With this element, users can control JVM behaviors in terms of GC policy, stack size, heap size, and so on. Table 1‑16 lists the complete set of java-config nested elements.
Table 1‑16 java-config Nested Elements It is allowable to specify multiple JVM options in one jvm-options; these options should be separated by spaces.
Note: Java server does not validate any specified JVM options but only construct the standard JNI JVM initialization data structure with these options and pass them into JVM to handle; however, for -Xms and -Xmx, if users do not specify these two options, Oracle Tuxedo Java server replaces their built-in values with 256m and 256m, respectively, on IBM AIX 6.1 (32-bit) on IBM PowerPC, or with 256m and 512m, respectively, on Oracle Linux 5.6 (64-bit) on Exalogic 2.0.tux-config specifies attributes related to Tuxedo applications. Table 1‑17 lists the complete set of tux-config nested elements.
Table 1‑17 tux-config Nested Elements It specifies some startup options for the implemented methods, tpsvrinit(String []) and tpsvrthrinit(String[]), in Java server classes. More specifically, if users' Java server classes implement at least one of these two methods, Java server reads these options, constructs a string array, and passes the string array to the implemented method(s).It is allowable to specify multiple options in one server-clopt; these options should be separated by spaces.classpath-config specifies the packages used to look for user-defined classes. Differed from ClassPaths in version 1.0, classpath string in version 2.0 can be specified with a variable externally defined by an environment variable or a JVM option string specified in jvm-options with "-D" option. For example,When adding this class path, Java server firstly searches jvm-options list to find whether -DUSER_JAVA_LIB=… is already specified. If it is found, Java server replaces the USER_JAVA_LIB with the value specified in -DUSER_JAVA_LIB= and passes the result to the class path searching list; otherwise, Java server finds whether the environment variable USER_JAVA_LIB is specified and passes the result to the class path searching list. If neither -DUSER_JAVA_LIB=… nor the environment variable USER_JAVA_LIB is found, Java server skips the unspecified class paths and logs an error in ULOG.Table 1‑18 lists the complete set of classpath-config nested elements.
Table 1‑18 classpath-config Nested Elements It is allowable to specify multiple class paths in one classpath; these class paths should be separated by system path separators (";" in Windows platforms; ":" in Unix-like platforms).tux-resources specifies view/view32 and fml/fml32 typed buffer classes to instantiate buffer resource objects. Table 1‑19 lists the complete set of tux-resources nested elements.
Table 1‑19 tux-resources Nested Elements
Note: Users can also specify the class paths of Tuxedo typed buffer classes in classpath-config element. Users can specify multiple FML/FML32/VIEW/VIEW32 classes in one element; these classes should be separated by commas.Please refer to Developing Oracle WebLogic Tuxedo Connector Applications for Oracle WebLogic Server for more information about jatmi typed buffer.Users can directly use viewj/viewj32 compilers and mkfldclass/mkfldclass32 utilities to generate corresponding VIEW/VIEW32 classes and FML/FML32 classes. Before running these compilers or utilities, please specify the class path, where $TUXDIR/udataobj/tuxj/com.bea.core.jatmi_2.0.0.0.jar is included.jdbc-resources specifies the JDBC compatible data source parameters. Table 1‑20 lists the complete set of jdbc-resources nested elements.
Table 1‑20 jdbc-resources Nested Elements
Table 1‑21 data-source Attributes
Table 1‑22 data-source Nested Elements It specifies the data source driver package path. Users can also specify the driver class path in classpath-config element. Table 1‑23The following table lists the complete set of driver-params nested elements.
Table 1‑23 driver-params Nested Elements tux-server-config specifies Java server class parameters. Table 1‑24 lists the complete set of tux-server-config nested elements.
Table 1‑24 tux-server-config Nested Elements It is optional. It specifies the class path for server classes. Users can also specify the class path in classpath-config section. Table 1‑25he following table lists the complete set of server-class attributes.
Table 1‑25 server-class Attributes server-class also has a nested element called services. services has a nested element called service. Table 1‑26 list the complete set of service attributes.
Table 1‑26 service Attributes It specifies the method implemented in server class. The method must be declared with TPSVCINFO parameter and with a void type of return value.Listing 1‑4 lists an example to create Tuxedo Java server configuration file.<data-source vendor="Oracle" driver-type="thin" enabled="true">
<datasource-classname>oracle.jdbc.xa.client.OracleXADataSource</datasource-classname>Table 1‑27 lists available properties in a Java server configuration file. Please see the corresponding Java Server Configuration File Schema, which checks the validation of the configuration XML file for more precise information.
A comma-separated list of fully qualified FML classes. Any of FML16 field table classes should be defined here or else the Fldid()/ Fname() of the FML will not work. A comma-separated list of fully qualified FML classes. All the FML32 field table classes should be defined here or else the Fldid()/ Fname() of the FML32 will not work. Following <ClassPath> element settings are supported in Tuxedo Java configuration file:<ClassPath>customer_lib_path/*.jar</ClassPath> or <ClassPath>customer_lib_path/*.zip</ClassPath><ClassPath>customer_lib_path/lib1.jar</ClassPath> or <ClassPath>customer_lib_path/lib2.zip</ClassPath>
• All the file searches in customer_lib_path are non-recursive.
•
• The $APPDIR is added into classpath by default.To use the View/View32, you need to specify the View class in <Resources></Resources> element. To use the Fldid()/Fname() properly, you need to specify the FML/FML32 field table class in <Resources></Resources> element.
• Only <TuxedoServerClasses> is mandatory in Java server configuration file, and at least one TuxedoServerClass should be configured.
• Currently, only one <DataSource> element is allowed to be configured in <DataSources> in configuration file. The name property for <DataSource> does not take effect for the present.
• Only <ClassPath>, <fieldTable16Class>, <fieldTable32class>, <viewFile16Class>, <viewFile32Class>, and <Service> element can have multiple entities.
• In <Resources> section, you should configure <fieldTable16Class> first and then <fieldTable32class>, <viewFile16Class>, and <viewFile32Class> in sequence.
Note: The configuration file (e.g. TJSconfig.xml) will be checked against the Schema file TJSconfig.xsd which is located in $TUXDIR/udataobj/tuxj/TJSconfig.xsd (Unix) or $TUXDIR\udataobj\tuxj/TJSconfig.xsd (Windows). Oracle recommends you refer to TJSconfig.xsd for more information about configuration rules.Each Tuxedo Java server class that implements services must implement a set of methods, of which input argument parameter is the TPSVCINFO interface. The methods that are advertised as services must be the public method and have the return type set to void.Tuxedo Java server advertises all of public methods as services into bulletin board. If Services is specified in configuration file, Tuxedo Java server uses the value of name property as the service name, otherwise, the method name is used as the service name.Listing 1‑5 shows a Tuxedo Java server configuration file example.Suppose the MyTuxedoServerClass1 Java class defines JAVASTRINGSVC, JAVAFML32SVC, and svc3 methods, and the MyTuxedoServerClass2 Java class defines svc4 method, this example initiates the connection to Oracle database with JDBC connection and exports the services: svc1, svc2, svc3, and svc4.Note that the method name svc3 and svc4 are exported as the service name because there is no <Service> property specified for them in the configuration file.Listing 1‑5 Tuxedo Java Server Configuration ExampleJava server provides a getter method to create a new or acquire an existing JTA compliant transaction manager. Listing 1‑6 demonstrates how to configure a Tuxedo transaction manager in Spring application context configuration file.For more information about Spring application context configuration file, see Create Spring Application Context.The Spring Framework libraries and all dependent libraries need to be configured in the Java server configuration file. Listing 1‑7 demonstrates how to specify Spring Framework libraries in Java server configuration file.For more information about Java server configuration file, see Tuxedo Java Server Configuration File.Listing 1‑7 Sample of Specifying Spring Framework LibrariesThe Tuxedo Java-based transaction is implemented based on the existing Tuxedo transaction management framework. As before, the configuration you need to make in the UBB configuration file for transaction is, define the attributes of transaction manager servers (TMSs) and resource managers (RMs) for a particular group. The Tuxedo Java Server (TMJAVASVR) should belong to this group.Listing 1‑8 UBB Configurations for Java-Based TransactionFor more information, see Configuring Your ATMI Application to Use Transactions.In this release, the Java-implemented services can only connect the database with JDBC connection, so you need to specify JDBC parameters in Tuxedo Java server configuration file using ConnectionUrl property.Because the Java server retrieves user name and password from OPENINFO, you should provide the user name and password in OPENINFO in UBB configuration file. This way encrypts the password and ensures the high security.Listing 1‑9 is a configuration example of Oracle database.Listing 1‑9 Oracle Database Configuration ExampleThe AUTOTRAN can also be configured on the services advertised by Tuxedo Java server. When the Tuxedo Java server service is configured in *SERVICES section and its AUTOTRAN attribute is specified as Y, the service starts a transaction automatically.
Table 1‑28 Supported Transaction Propagation Modes Executes within a nested transaction if a current transaction exists, or behaves like PROPAGATION_REQUIRED.
Note: *In declarative transaction management mode, the PROPAGATION_NESTED propagation behavior is not support by Java server transaction manager.
• All Oracle Tuxedo resources specified in <TJSconifg>/<tux-resources> are managed and maintained by Java server itself; they should be accessible and visible to all server modules deployed in Java server. These of resource classes must be deployed as public.