IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base
Class DSEHandler

java.lang.Object
  extended bycom.ibm.dse.base.DSEHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
DSEState, MirrorHandler, ProcessorManager

public class DSEHandler
extends java.lang.Object
implements Handler

The DSEHandler class instances process the events generated by Notifier instances. Handlers are organized by the EventsManager, or a specific Notifier in a chain structure. The handlers store information about the event they are interested in and the component that fires the event. The handler, when it receives control to dispatch the event, can decide whether to process it or ignore it and, after that, pass the event to the following handler in the chain or stop the event propagation.


Constructor Summary
DSEHandler()
           
 
Method Summary
 Handler dispatchEvent(DSEEventObject anEvent)
          Generates the event anEvent.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          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.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, 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.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          Allows the Handler to stop receiving a specific event for which it was registered previously.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, 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
 

Constructor Detail

DSEHandler

public DSEHandler()
Method Detail

dispatchEvent

public Handler dispatchEvent(DSEEventObject anEvent)
Generates the event anEvent. anEvent contains relevant data to be used by the event handler held in a Hashtable, the source of the event and the event name. Any handler is responsible for implementing this method, to check if it is interested in the event and/or pass it to the next interested handler in the chain that is waiting for it. If the method returns this, the notifier passes the event to the following handler in the chain waiting for it. If the method returns null, the event is not propagated. The default event processing is to pass the event to the following handler.

Specified by:
dispatchEvent in interface Handler

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        Context aContext)
                 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. This method throws a DSEInvalidArgumentException, which is generated by the EventManager addHandler method.

Specified by:
handleEvent in interface Handler
Throws:
DSEInvalidArgumentException

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName,
                        Context aContext,
                        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.

Specified by:
handleEvent in interface Handler
Throws:
DSEInvalidArgumentException

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext)
                       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 checks 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, and, in the second case, the EventManager itself removes the handler from its list of handlers. This method throws a DSEInvalidArgumentException and a DSEHandlerNotFoundException generated by the EventManager removeHandler method.

Specified by:
stopHandlingEvent in interface Handler
Throws:
DSEInvalidArgumentException
DSEHandlerNotFoundException

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext,
                              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.

Specified by:
stopHandlingEvent in interface Handler
Throws:
DSEInvalidArgumentException
DSEHandlerNotFoundException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005