raccoon.tibco.tibrv.endpoint
Class TibrvCallback

java.lang.Object
  extended by raccoon.tibco.tibrv.endpoint.TibrvCallback
All Implemented Interfaces:
com.tibco.tibrv.TibrvMsgCallback

public class TibrvCallback
extends java.lang.Object
implements com.tibco.tibrv.TibrvMsgCallback

Implementation class invoked each time an event arrives on the bus.

Since:
Raccoon v0.7
Version:
$Id: TibrvCallback.java,v 1.3 2003/07/01 19:19:57 crouvrais Exp $
Author:
Cedric ROUVRAIS

Constructor Summary
TibrvCallback()
           
 
Method Summary
 void addEventHandler(IEventHandler pNewHandler)
          Adds a new event handler to this listener.
 long getNbMsgReceived()
          The number of messages received by this callback.
 void onMsg(com.tibco.tibrv.TibrvListener pRvListener, com.tibco.tibrv.TibrvMsg pRvMsg)
          The callback method to be implemented in order to receive messages from the TIB.
 IEventHandler removeEventHandler(java.lang.String pHandlerName)
          Removes a given event handler from the current session.
 void stop()
          Stops all event handlers and clears the list of event handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TibrvCallback

public TibrvCallback()
Method Detail

getNbMsgReceived

public long getNbMsgReceived()
The number of messages received by this callback.

Returns:
number of messages since startup.

onMsg

public void onMsg(com.tibco.tibrv.TibrvListener pRvListener,
                  com.tibco.tibrv.TibrvMsg pRvMsg)
The callback method to be implemented in order to receive messages from the TIB.

This method is invoked each time and inbound event arrives, regardless of the quality of service. If the QoS is certified messaging than further information regarding the sender can be retrieved using getSender, additional information regarding the sequence id can be obtained using getSequence.
If the sequence id is zero than it means that there is no certified delivery agreement between the sender and the receiver. This occurs when the QoS isn't RvCM or RvCMQ or this subscribing hasn't been registered at the sender level.

Refer to TibrvCmListener in order to understand how to create a Certified receiver.

Specified by:
onMsg in interface com.tibco.tibrv.TibrvMsgCallback
Parameters:
pRvListener - the rv listener instance that is subscribed to the received rv msg
pRvMsg - the rv msg received by the TIB that is to be handled.

addEventHandler

public void addEventHandler(IEventHandler pNewHandler)
                     throws java.lang.IllegalArgumentException
Adds a new event handler to this listener.

Parameters:
pNewHandler - the handler that is supposed to receive a message each time.
Throws:
java.lang.IllegalArgumentException - if the handler is null.
java.lang.IllegalArgumentException - if the handler name is null.
java.lang.IllegalArgumentException - if the handler has already been added to this callback.

removeEventHandler

public IEventHandler removeEventHandler(java.lang.String pHandlerName)
Removes a given event handler from the current session.

Parameters:
pHandlerName - the name of the handler to remove.
Returns:
the removed handler, null if not found.

stop

public void stop()
          throws RaccoonException
Stops all event handlers and clears the list of event handlers.

Throws:
RaccoonException - if the one or more handlers failed to halt.


Copyright null null. All Rights Reserved.