• An Oracle Tuxedo service can be developed using pure Java language. The service implemented with Java language functions the same as other Tuxedo services. You can call the services advertised by the Tuxedo Java server (TMJAVASVR) using ATMI interfaces from client/ Tuxedo server, and similarly, you can call the services advertised by the Tuxedo server using TJATMI interfaces from the java-implemented service.
• Java server class, which implements Java services, should inherit the TuxedoJavaServer class; Java server class also should have a default constructor.
• In Java server class, Java method, which will be advertised as Java service, should take the TPSVCINFO interface as the only input argument and should be declared to public.
• Java server class should implement tpsvrinit() method, which will be called when Tuxedo Java server starts up.
• Java server class should implement tpsvrdone() method, which will be called when Tuxedo Java server shuts down.
•
• Java service could return result to client by using tpreturn and exit by throwing exception.Users need to implement the tpsvrinit() method. Given that tpsvrinit() will be called when server starts up, it's recommended to put the class scope initialization in this method. If one class' tpsvrinit() fails, a warning message will be reported in user log and the Java server will continue its execution.Users need to implement the tpsvrdone() method. Given that tpsvrdone() will be called when the server shuts down, it's recommended to put the class scope cleanup actions in this method.The tpreturn() in Java service does not immediately disrupt the Java service method's execution but provide the return result to Tuxedo Java server.How does tpreturn() behave in Java service is different from how does tpreturn() behave in the existing Tuxedo system.
• When a tpreturn() is called in the existing Tuxedo system, the flow control is transferred to Tuxedo automatically.
• When a tpreturn() is called in Java service, statements after tpreturn() will still be executed. Users must make sure tpreturn() is the last execution statement in Java service - if not, we suggest to use a following Java return invocation after tpreturn(); otherwise, tpreturn() will not transfer the flow control to the Tuxedo system automatically.
Note: The use of a Java return statement in Java service without a previous tpreturn() statement is not suggested - such use will make the Java server return TPFAIL with rcode setting 0 to the corresponding client.
• Java service can throw any exception during execution and exit the Java service. In this case the Java server will return TPFAIL with rcode setting to 0 for this service to its client.
• All the exception information is recorded into the $APPDIR/stderr file.