IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.event
Class MirrorHandler

java.lang.Object
  extended by com.ibm.btt.event.MirrorHandler
All Implemented Interfaces:
Handler

public class MirrorHandler
extends java.lang.Object
implements Handler

The instance of MirrorHandler is a handler that is interested for an event that will be signaled by a BTT Notifier and represents a handler in a external server interested in a remote event.


Field Summary
static java.lang.String COPYRIGHT
           
(package private)  java.util.Hashtable eventList
           
 boolean fromClient
          A boolean flag to indicate whehter the handler which mirror handler represents is from client.
(package private)  java.lang.String sessionId
           
(package private)  java.lang.String tid
           
 
Constructor Summary
MirrorHandler(java.lang.String aSessionId, java.lang.String anEventName)
          This constructor creates a MirrorHandler with its session id and interested event name.
MirrorHandler(java.lang.String aSessionId, java.lang.String anEventName, boolean fromClient)
          This constructor creates a MirrorHandler with its session id, interested event name , and a boolean flag to indicate whehter the handler is from client.
 
Method Summary
 void addEvent(java.lang.String anEventName)
          Adds an event to the event list.
 Handler dispatchEvent(DSEEventObject anEvent)
          Dispatchs the event anEvent.
protected  java.util.Hashtable getEventList()
          Returns the eventList attribute value.
 java.lang.String getHandlerGlobalID()
          Returns Handler global ID.
 java.lang.String getSessionId()
          Returns the sessionId attribute value.
 java.lang.String getTID()
          Returns the tid attribute value.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName)
          Indicates that the Handler is interested in the event anEventName.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aTID)
          Calls the EventManager class that registers the handler to the local notifier, if it is defined, or adds it to its own list of handlers if the notifier is remote.
 boolean hasEvents()
          Returns true if there is any event in the events list.
 void removeEvent(java.lang.String anEventName)
          Removes an event from the events list.
 void setHandlerGlobalID(java.lang.String string)
          Sets Handler global ID.
 void setSessionId(java.lang.String aSessionId)
          Sets the sessionId attribute to aSessionId.
 void setTID(java.lang.String aTID)
          Sets the tid attribute to aTID.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName)
          Removes the Mirror Handler from the list of Handlers for the specific event.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aTID)
          Allows the Handler to stop receiving a specific event for which it was registered previously.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

tid

java.lang.String tid

sessionId

java.lang.String sessionId

eventList

java.util.Hashtable eventList

fromClient

public boolean fromClient
A boolean flag to indicate whehter the handler which mirror handler represents is from client.

Constructor Detail

MirrorHandler

public MirrorHandler(java.lang.String aSessionId,
                     java.lang.String anEventName)
              throws DSEInvalidRequestException,
                     DSEObjectNotFoundException
This constructor creates a MirrorHandler with its session id and interested event name.

Parameters:
aSessionId - java.lang.String
anEventName - java.lang.String
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

MirrorHandler

public MirrorHandler(java.lang.String aSessionId,
                     java.lang.String anEventName,
                     boolean fromClient)
              throws DSEInvalidRequestException,
                     DSEObjectNotFoundException
This constructor creates a MirrorHandler with its session id, interested event name , and a boolean flag to indicate whehter the handler is from client.

Parameters:
aSessionId - java.lang.String
anEventName - java.lang.String
fromClient - boolean
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException
Method Detail

addEvent

public void addEvent(java.lang.String anEventName)
Adds an event to the event list.

Parameters:
anEventName - java.lang.String

dispatchEvent

public Handler dispatchEvent(DSEEventObject anEvent)
Dispatchs the event anEvent. If the event is going to client, then calls the client/server mechanism sendEvent() method to send the event to a remote workstation. If the event is going to server or external server, then send to message queue.

Specified by:
dispatchEvent in interface Handler
Parameters:
anEvent - com.ibm.btt.event.DSEEventObject
Returns:
com.ibm.btt.event.Handler

getEventList

protected java.util.Hashtable getEventList()
Returns the eventList attribute value.

Returns:
java.util.Hashtable

getSessionId

public java.lang.String getSessionId()
Returns the sessionId attribute value.

Returns:
java.lang.String

getTID

public java.lang.String getTID()
Returns the tid attribute value.

Returns:
java.lang.String

hasEvents

public boolean hasEvents()
Returns true if there is any event in the events list.

Returns:
boolean

removeEvent

public void removeEvent(java.lang.String anEventName)
Removes an event from the events list.

Parameters:
anEventName - java.lang.String

setSessionId

public void setSessionId(java.lang.String aSessionId)
Sets the sessionId attribute to aSessionId.

Parameters:
aSessionId - java.lang.String

setTID

public void setTID(java.lang.String aTID)
Sets the tid attribute to aTID.

Parameters:
aTID - java.lang.String

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName)
                 throws DSEInvalidArgumentException
Indicates that the Handler is interested in the event anEventName. This method should call the EventManager class to register the Handler as interested in the event anEventName from the Notifier aNotifierName.

This method throws a DSEInvalidArgumentException.

Specified by:
handleEvent in interface Handler
Parameters:
anEventName - java.lang.String
aNotifierName - java.lang.String
Throws:
DSEInvalidArgumentException

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        java.lang.String aTID)
                 throws DSEInvalidArgumentException
Calls the EventManager class that registers the handler to the local notifier, if it is defined, or adds it to its own list of handlers if the notifier is remote.

aServerName is used when the application has a session with different remote workstations. It can be a TID.

This method throws a DSEInvalidArgumentException, which is generated by the EventManager addHandler method.

Throws:
DSEInvalidArgumentException

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName)
                       throws DSEInvalidArgumentException,
                              DSEHandlerNotFoundException
Removes the Mirror Handler from the list of Handlers for the specific event.

This method throws a DSEInvalidArgumentException and a DSEHandlerNotFoundException generated by the EventManager removeHandler method.

Specified by:
stopHandlingEvent in interface Handler
Parameters:
anEventName - java.lang.String
aNotifierName - java.lang.String
Throws:
DSEInvalidArgumentException
DSEHandlerNotFoundException

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              java.lang.String aTID)
                       throws DSEInvalidArgumentException,
                              DSEHandlerNotFoundException
Allows the Handler to stop receiving a specific event for which it was registered previously.

The notifier removes the handler from its handlers list for that specific event. If the event name is allEvents, any reference to the handler in the list of handlers for that notifier is deleted.

The method invokes an EventManager method that will check whether the notifier is local or remote. In the first case, it calls the notifier to remove the handler from its list of handlers for that specific event. In the second case, the EventManager itself removes the handler from its list of handlers and calls the remote EventManager to de-register interest in a remote event if no more handlers in that workstation are waiting for the event. From aContext and aTID, the EventManager knows the C/S mechanism instance to use to communicate with the server workstation.

This method throws a DSEInvalidArgumentException and a DSEHandlerNotFoundException generated by the EventManager removeHandler method.

Throws:
DSEInvalidArgumentException
DSEHandlerNotFoundException

getHandlerGlobalID

public java.lang.String getHandlerGlobalID()
Returns Handler global ID.

Returns:
java.lang.String

setHandlerGlobalID

public void setHandlerGlobalID(java.lang.String string)
Sets Handler global ID.

Parameters:
string - java.lang.String

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009