beautypg.com

Joltbeans programming tasks, Using transactions with joltbeans – HP NonStop G-Series User Manual

Page 201

background image

Figure 3-15. Property Editor with Selected Service

Select the appropriate service name in the list box shown in

Figure 3-15

. Enter the property value (service or field name) directly. A

text box is provided. Select OK on the property editor dialog in

Figure 3-15

. The bean property gets set with the contents of the

textbox.

1.

Select OK on the Custom Property Editor dialog shown in

Figure 3-15

.

2.

JoltBeans Programming Tasks

The additional procedures include:

Using Transactions with JoltBeans

Using Custom GUI Elements with the JoltService Bean

Using TUXEDO Event Subscription and Notification with JoltBeans

Using Transactions with JoltBeans

Your TUXEDO application services may have functionality that will update your database. If so, you can use transactions with JoltBeans
(e.g., in BANKAPP, the services TRANSFER and WITHDRAWAL update the database of BANKAPP). If your application service is
read-only (e.g., INQUIRY), you do not need to use transactions.

The following example shows how to use transactions with JoltBeans.

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

1.

beginTransaction() is called on the JoltSessionBean.

2.

callService() is called on the JoltServiceBean.

3.

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

4.

Using Custom GUI Elements with the JoltService Bean

The JoltBeans product provide a limited set of GUI components that are Jolt enabled. It is also possible to use controls that are not Jolt
enabled together with the JoltServiceBean.

Figure 3-16

outlines the different ways to link controls that are not Jolt enabled with the

JoltServiceBean. Three examples are presented. In Example 1, the GUI element displays output information of the service represented by
the JoltServiceBean, in the Examples 2 and 3, the control contains input information.

In Example 1, the GUI element uses an adapter class that implements the JoltOutputListener interface to 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.

In Example 2, the GUI element calls the setInputTextValue() method on the JoltServiceBean. In this example, the GUI element contains