BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Jolt   |   Topic List   |   Previous   |   Next   |   Contents   |   Index

   Using BEA Jolt

JoltBeans Programming Tasks

Additional programming tasks include:

Using Transactions with JoltBeans

Your BEA Tuxedo application services may have functionality that updates your database. If so, you can use transactions with JoltBeans (for example, in the sample, BANKAPP, the services TRANSFER and WITHDRAWAL update the database of BANKAPP). If your application service is read-only (such as INQUIRY), you do not need to use transactions.

The following example shows how to use transactions with JoltBeans.

  1. The setTransactional (true) method is called on the JoltServiceBean. (isTransactional is a boolean property of the JoltServiceBean.)

  2. The beginTransaction() method is called on the JoltSessionBean.

  3. The callService() method is called on the JoltServiceBean.

  4. Depending on the outcome of the service call, the commitTransaction() or rollbackTransaction()method is called on the JoltSessionBean.

Using Custom GUI Elements with the JoltService Bean

JoltBeans provides a limited set of Jolt-enabled GUI components. You can also use controls that are not Jolt-enabled together with the JoltServiceBean. You can link controls to the JoltServiceBean that display output information of the service represented by the JoltServiceBean. You can also link controls that display input information.

For example, a GUI element that uses an adapter class to implement the JoltOutputListener interface can listen to JoltOutputEvents. The JoltServiceBean as the event source for JoltOutputEvents calls the serviceReturned() method of the adapter class when it sends a JoltOutputEvent. Inside serviceReturned(), the control's internal data is updated using information from the event object.

The development tool generates the adapter class when the JoltServiceBean and the GUI element are wired together.

As another example, a GUI element can call the setInputTextValue() method on the JoltServiceBean. The GUI element contains input data for the BEA Tuxedo service represented by the JoltServiceBean.

As a third example, a GUI element can implement the required methods (addJoltInputListener() and removeJoltInputListener()) to act as event sources for JoltInputEvents. The JoltServiceBean acts as an event listener for these events. The control sends a JoltInputEvent when its own state changes to keep the JoltServiceBean updated with the input information.