Joining an Application Joining and Leaving Applications

2 Developing Oracle WebLogic Tuxedo Connector Client EJBs 2-1 2 Developing Oracle WebLogic Tuxedo Connector Client EJBs The following sections describe how to create client EJBs that take user input and send service requests to a server process or outbound object that offers a requested service. ■ Section 2.1, Joining and Leaving Applications ■ Section 2.2, Basic Client Operation ■ Section 2.3, Example Client EJB Oracle WebLogic Tuxedo Connector JATMI client classes are used to create clients that access services found in Oracle Tuxedo.

2.1 Joining and Leaving Applications

Oracle Tuxedo and Oracle WebLogic Tuxedo Connector have different approaches to connect to services.

2.1.1 Joining an Application

The following section compares how Oracle Tuxedo and Oracle WebLogic Tuxedo Connector join an application: ■ Oracle Tuxedo uses tpinit to join an application. ■ Oracle WebLogic Tuxedo Connector uses a WTCServer MBean to provide information required to create a path to the Oracle Tuxedo service. Security and client authentication is provided by configuring the Remote TDM and Imported Services MBean components of a WTCServer MBean. This pathway is created when the Oracle WebLogic Server is started and a WTCServer MBean is present in the config.xml file and assigned targeted to a server. ■ Oracle WebLogic Tuxedo Connector uses TuxedoConnectionFactory to get a TuxedoConnection object and then uses getTuxedoConnection to make a connection to the Oracle Tuxedo object. The following example shows how a Oracle WebLogic Server application joins an Oracle Tuxedo application using Oracle WebLogic Tuxedo Connector. Note: For more information on the Oracle WebLogic Tuxedo Connector JATMI, view the Javadocs for WebLogic Classes. The Oracle WebLogic Tuxedo Connector classes are located in the weblogic.wtc.jatmi and weblogic.wtc.gwt packages. 2-2 Oracle Fusion Middleware WebLogic Tuxedo Connector Programmers Guide for Oracle WebLogic Server Example 2–1 Example Client Code to Join an Oracle Tuxedo Application . . . try { ctx = new InitialContext; tcf = TuxedoConnectionFactory ctx.lookuptuxedo.services.TuxedoConnection; } catch NamingException ne { Could not get the tuxedo object, throw TPENOENT throw new TPExceptionTPException.TPENOENT, Could not get TuxedoConnectionFactory : + ne; } myTux = tcf.getTuxedoConnection; . . .

2.1.2 Leaving an Application