bea.jolt
Class JoltUserEvent

java.lang.Object
  bea.jolt.JoltEvent
      bea.jolt.JoltUserEvent

public class JoltUserEvent
extends bea.jolt.JoltEvent

The JoltUserEvent class implements a subscription to an asynchronous notification event. An asynchronous notification is either an unsolicited event notification or an event notification from the Tuxedo Event Broker. Unsolicited notifications are produced in response to a Tuxedo tpnotify() call or a Tuxedo tpbroadcast() call. Event notifications are produced as a result of a Tuxedo tppost() call. Handling of unsolicited notification and event notification is done in the Session object. This class uses a thread to monitor any messages.

See Also:
JoltSession, JoltMessage, JoltReply

Field Summary
static java.lang.String UNSOLMSG
          The regular expression constant to request unsolicited messages.
 
Constructor Summary
JoltUserEvent(java.lang.String expr, java.lang.String filter, Session session)
          This constructor subscribes the specific asynchronous notification.
 
Method Summary
 int unsubscribe()
          This method unsubscribes this event.
static int unsubscribeAll(Session session)
          Unsubscribe all event subscriptions in the specified session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNSOLMSG

public static final java.lang.String UNSOLMSG
The regular expression constant to request unsolicited messages.

See Also:
Constant Field Values
Constructor Detail

JoltUserEvent

public JoltUserEvent(java.lang.String expr,
                     java.lang.String filter,
                     Session session)
              throws EventException,
                     SessionException
This constructor subscribes the specific asynchronous notification. An asynchronous notification can be an unsolicited notification or an event notification. If expr is JoltUserEvent.UNSOLMSG, the filter must be null. Otherwise, the filter can be either null or it can be a a boolean expression (see Fboolco(3) in the Tuxedo Reference Manual).

Parameters:
expr - A string containing a regular expression in the same format as the event expression used in tpsubscribe(). The maximum length of this parameter is 255 characters. Setting this parameter to the constant JoltUserEvent.UNSOLMSG allows the client to receive unsolicited messages (generated as a result of tpnotify() or tpbroadcast()).
filter - Null or Boolean expression. This parameter is a string in the same format as the filter parameter passed to tpsubscribe(). The maximum length of this parameter is 255 characters. Filter rules are specific to the buffers to which they are applied. Refer to Tuxedo documentation for a complete explanation of the filtering function. Filtering is done on the Tuxedo server, not the Jolt client.
session - A JoltSession object, the Jolt session to which the subscription is bound. An event is bound to a a single session.
Throws:
SessionException - Invalid session or a session error.
EventException - Indicates that the filter for unsolicited subscription is not null, or event subscription failed.
Method Detail

unsubscribe

public int unsubscribe()
                throws EventException,
                       SessionException
This method unsubscribes this event. Once it is unsubscribed, this object becomes obsolete.

Returns:
Number of subscriptions deleted.
Throws:
EventException - No such event or invalid event.
SessionException - An error occurs in this session.

unsubscribeAll

public static int unsubscribeAll(Session session)
                          throws EventException,
                                 SessionException
Unsubscribe all event subscriptions in the specified session.

Parameters:
session - a Jolt session object.
Returns:
Number of subscriptions deleted.
Throws:
SessionException - Invalid session or a session error.
EventException - Unsubscription error from Tuxedo.