beautypg.com

Joltbeans, For more information, Figure 3-16 – HP NonStop G-Series User Manual

Page 202

background image

data which is input for the TUXEDO service represented by the JoltServiceBean.

In Example 3, the GUI element implements the required methods (addJoltInputListener and removeJoltInputListener) to act as an event
source for JoltInputEvents. The JoltServiceBean acts as an event listener for these events. The control sends a JoltInputEvent once its own
state changes to keep the JoltServiceBean updated with the input information.

Refer to

Figure 3-16

for a graphical representation of using the GUI elements with the JoltServiceBean.

Figure 3-16. Example of Using Custom GUI Elements with the JoltServiceBean

Using TUXEDO Event Subscription and Notification with JoltBeans

TUXEDO supports brokered and unsolicited event notification. Jolt provides a mechanism for Jolt clients to receive TUXEDO events.
JoltBeans also include this capability.

Note

TUXEDO event subscription and notification is different than JavaBeans events.

The following example shows how the TUXEDO asynchronous notification mechanism is used in JoltBeans applications.

Use the setEventName() and setFilter() methods of the JoltUserEventBean to specify the TUXEDO event to which you want to
subscribe.

1.

The component that wants to receive the event notifications registers itself as a JoltOutputListener to the JoltSessionBean.

2.

subscribe() is called on JoltUserEventBean.

3.

When the actual TUXEDO event notification arrives, JoltSessionBean sends a JoltOutputEvent to its listeners by calling
serviceReturned() on them. The JoltOutputEvent object contains the data of the TUXEDO event.

4.

When the client is not interested any more in the event it calls unsubscribe() on the JoltUserEventBean.

Note

If the client wants to only subscribe to unsolicited events, use setEventName
("\\.UNSOLMSG") that can be set using the property sheet. EventName and Filter are
properties of the JoltUserEventBean.)