Jolt 1.2 Developer's Guide

Note
This is NOT the recommended method for enabling unsolicited notification--if you want unsolicited notification, the
application should explicitly do so (as described in the JoltUserEvent class). The reason for this is explained in the following
unsubscribe section.
Unsubscribing from Notifications
To stop subscribing to event notifications and/or unsolicited messages, you need to use the JoltUserEvent unsubscribe method. In Jolt, disabling
unsolicited notifications with an unsubscribe method does not turn off all subscription notifications. This differs from NonStop
TM
TUXEDO. In
NonStop
TM
TUXEDO the use of tpsetunsol() with a NULL handler turns off all subscription notifications.
When unsubscribing, the following considerations apply:
If a client is subscribed to only a single event, unsubscribing disables both the event notification and unsolicited messages.
If a client has multiple subscriptions, then unsubscribing from any single subscription disables just that single subscription. Unsolicited
notifications continue. Only the last subscription to be unsubscribed causes unsolicited notification to stop.
If a client subscribes to both an unsolicited and an event notifications, then unsubscribing to just the unsolicited notification will not stop
either type of notifications from continuing. In addition, this unsubscribe does not throw an Exception. However, the Jolt API will remember
that an unsubscribe has taken place and a subsequent unsubscribe to the remaining event will disable both event notification and unsolicited
messages.
If you want to stop unsolicited messages in your client application, you need to make sure that you have unsubscribed to all events.
Note
Jolt does not support the wildcard unsubscribe semantics of tpunsubscribe(-1,..). Jolt clients wishing to unsubscribe to all
subscriptions will do so by invoking the unsubscribe() method in each event subscription object.
Using the Jolt API to Receive NonStop
TM
TUXEDO Notifications
Example 6-11 shows how to use the Jolt Class Library for receiving notifications and includes the use of the JoltSession, JoltReply, JoltMessage and
JoltUserEvent classes.
Example 6-11. Asynchronous Notification