•
• Teller (remote interface documentation and source)
• TellerHome (home interface documentation and source)
• TellerResult (application-specific utility documentation and source)
• ProcessingErrorException (application-specific exception documentation and source)
• TransactionErrorException (application-specific exception documentation and source)
• TellerBean (EJBean documentation and source)This example demonstrates an Enterprise JavaBean (EJBean), and provides an example of a simple interface for accessing the Tuxedo Server. You can find the source code for this example in the /samples/jolt/wls/ejb/bankapp directory included in the Oracle Tuxedo distribution.Running this example before attempting to create your own EJBeans will show you the different steps involved. The example is a stateful session EJBean called TellerBean that contacts a Tuxedo Server using Jolt for WebLogic, and conducts transactions as follows:
3.
Note: In Transaction 1, a single call is made, and is automatically committed. In Transaction 2, a begin() and commit() bracket two separate requests (a deposit and a withdrawal).To get the most out of this example, first read through the source code files to see what is happening. Start with DeploymentDescriptor.txt to find the general structure of the EJBean and which classes are used for the different objects and interfaces, and then look at Client.java to see how the application works.You need to add a Jolt connection pool that connects to the public Tuxedo Server at Oracle, as described in “Step 3. Configure the Servlet in WebLogic Server,” in Appendix B, Simple Servlet Example. When you’re finished, the config.xml configuration file will contain the following sections:<StartupClass
ClassName="bea.jolt.pool.servlet.weblogic.PoolManagerStartUp"
FailureIsFatal="false"
Name="MyStartup Class"
Targets="myserver"
/>
<JoltConnectionPool
ApplicationPassword="tuxedo"
MaximumPoolSize="5"
MinimumPoolSize="3"
Name="MyJolt Connection Pool"
PrimaryAddresses="//TUXSERVER:6309"
RecvTimeout="300"
SecurityContextEnabled="true"
Targets="myserver"
UserName="joltuser"
UserPassword="jolttest"
UserRole="clt"
/>|
<ShutdownClass
ClassName=”bea.jolt.pool.servlet.weblogic.PoolManager
ShutDown.”
/>
• Windows 2003: %TUXDIR%\samples\jolt\wls\ejb\ bankapp\build.cmd
• UNIX: $TUXDIR/samples/jolt/wls/ejb/bankapp/build.sh
• Client files in: d:\bea\wlserver6.1\config\examples
• EJBean in: d:\bea\wlserver6.1\config\mydomain\applicationsWhen WebLogic Server is started in the default \config\mydomain directory, the EJBean example is automatically deployed in the \applications directory.
1. Start the WebLogic Server in the \config\mydomain directory. You can check that the EJBean has been deployed correctly either by checking the server command-line window, or by opening the Console and examining EJB under Deployments. You should see ejb.jolt.bankapp deployed and should be able to monitor its activity.$ java examples.jolt.ejb.bankapp.Client "t3://WebLogicURL:Port"
• Port—the port listening for connections (weblogic.system.ListenPort)
• url—unique resource location of Server, such as t3://localhost:7001
3. If you are running the Client example, you should get output that is similar to the following from the client application:
Note: Note how the final balance shows that Transaction 2 was rolled back to the balance at the end of Transaction 1.You can read more about EJBs in the Programming WebLogic Enterprise JavaBeans guide. To learn more about using Oracle Jolt, refer to the Using Oracle Jolt guide.