IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class ProcessorEventManager

java.lang.Object
  extended by com.ibm.btt.base.ProcessorEventManager

public class ProcessorEventManager
extends java.lang.Object

This class manages the flow of events between the notifiers (producers of the events) and the handlers (consumers of the events), both when the event is produced locally or remotelly in a server machine. To make this possible, the server and the client should have only one instance of the EventManager existing at any given moment. To make the EventManager more easily addressable, most of its interface is based on static methods.


Field Summary
static java.lang.String COMPID
          Keeps the component identification that will be used by the traces tool.
protected  Vector exceptionHandlerList
           
protected  Hashtable handlersList
           
protected static Vector notifierList
           
protected static ProcessorEventManager uniqueInstance
           
protected static Hashtable workstationList
           
 
Constructor Summary
ProcessorEventManager()
           
 
Method Summary
static void addHandler(ProcessorHandler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          Registers the event Handler to the Notifier, whether the notifier exists on this machine or not.
static void addHandler(ProcessorHandler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aServerTID)
          Registers the event Handler to the Notifier if the notifier exists on the specified server.
static void addHandlerForException(ProcessorHandler aHandler)
          Registers the specified Handler for exceptions.
static void addHandlerForException(ProcessorHandler aHandler, java.lang.String aServerTID)
          Registers the specified Handler for exceptions originating from the server identified by aServerTID.
static void addNotifier(ProcessorNotifier aNotifier)
          Adds a Notifier to the list of Notifiers.
protected static void addWorkstation(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aWorkstationTID)
          Adds the specified workstation to the workstationList.
protected static ProcessorNotifier getNotifier(java.lang.String aNotifierName)
          Returns the Notifier named aNotifierName.
protected static Vector getNotifierList()
          Returns the notifierList attribute value.
protected static ProcessorEventManager getUniqueInstance()
          Returns the unique instance of EventManager running on the application environment.
protected static Hashtable getWorkstationList()
          Returns the workstationList attribute value.
protected static boolean hasHandlersInterestedIn(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aTID)
          Returns true if the EventManager has a Handler registered for the specified remote event.
static void removeHandler(ProcessorHandler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext)
          Deregisters the event Handler from the notifier, whether the Notifier exists on this machine or not.
static void removeHandler(ProcessorHandler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID)
          Deregisters the event Handler from the notifier if the Notifier exists on the specified server.
static void removeHandlerForException(ProcessorHandler aHandler)
          Deregisters the specified Handler for exceptions.
static void removesHandlerForException(ProcessorHandler aHandler, java.lang.String aServerTID)
          Deregisters the specified Handler for exceptions originating from the server identified by aServerTID.
static void reset()
          Initializes this class.
protected static void setUniqueInstance(ProcessorEventManager anEventManager)
          Sets the uniqueInstance attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPID

public static final java.lang.String COMPID
Keeps the component identification that will be used by the traces tool.

See Also:
Constant Field Values

handlersList

protected Hashtable handlersList

exceptionHandlerList

protected Vector exceptionHandlerList

notifierList

protected static Vector notifierList

uniqueInstance

protected static ProcessorEventManager uniqueInstance

workstationList

protected static Hashtable workstationList
Constructor Detail

ProcessorEventManager

public ProcessorEventManager()
Method Detail

addHandler

public static void addHandler(ProcessorHandler aHandler,
                              java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext)
                       throws DSEInvalidArgumentException
Registers the event Handler to the Notifier, whether the notifier exists on this machine or not.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler - The Handler that wants to register for an event
anEventName - java.lang.String - The name of the event the Handler is interested in
aNotifierName - java.lang.String - The name of the Notifier that will signal the event identified as anEventName
aContext - com.ibm.btt.base.Context - The context where the EventManager will look for the notifier aNotifierName
Throws:
DSEInvalidArgumentException

addHandler

public static void addHandler(ProcessorHandler aHandler,
                              java.lang.String anEventName,
                              java.lang.String aNotifierName,
                              Context aContext,
                              java.lang.String aServerTID)
                       throws DSEInvalidArgumentException
Registers the event Handler to the Notifier if the notifier exists on the specified server.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler - The Handler that wants to register for an event
anEventName - java.lang.String - The name of the event the Handler is interested in
aNotifierName - java.lang.String - The name of the Notifier that will signal the event identified as anEventName
aContext - com.ibm.btt.base.Context
aServerTID - java.lang.String - The TID of the server where the event will be produced
Throws:
DSEInvalidArgumentException

addHandlerForException

public static void addHandlerForException(ProcessorHandler aHandler)
                                   throws DSEInvalidArgumentException
Registers the specified Handler for exceptions.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler
Throws:
DSEInvalidArgumentException

addHandlerForException

public static void addHandlerForException(ProcessorHandler aHandler,
                                          java.lang.String aServerTID)
                                   throws DSEInvalidArgumentException
Registers the specified Handler for exceptions originating from the server identified by aServerTID.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler
aServerTID - java.lang.String - The TID of the server where the exception will be originated
Throws:
DSEInvalidArgumentException

addNotifier

public static void addNotifier(ProcessorNotifier aNotifier)
                        throws DSEInvalidArgumentException
Adds a Notifier to the list of Notifiers. Checks if there are handlers already interested in events from this notifier. Each Notifier should run this method in its constructor DSENotifier(String aName).

Parameters:
aNotifier - com.ibm.btt.base.ProcessorNotifier
Throws:
DSEInvalidArgumentException

addWorkstation

protected static void addWorkstation(java.lang.String anEventName,
                                     java.lang.String aNotifierName,
                                     java.lang.String aWorkstationTID)
Adds the specified workstation to the workstationList.

Parameters:
anEventName - java.lang.String
aNotifierName - java.lang.String
aWorkstationTID - java.lang.String

getNotifier

protected static ProcessorNotifier getNotifier(java.lang.String aNotifierName)
Returns the Notifier named aNotifierName.

Parameters:
aNotifierName - java.lang.String
Returns:
com.ibm.btt.base.ProcessorNotifier

getNotifierList

protected static Vector getNotifierList()
Returns the notifierList attribute value.

Returns:
com.ibm.btt.base.Vector

getUniqueInstance

protected static ProcessorEventManager getUniqueInstance()
Returns the unique instance of EventManager running on the application environment.

Returns:
com.ibm.btt.base.ProcessorEventManager

getWorkstationList

protected static Hashtable getWorkstationList()
Returns the workstationList attribute value.

Returns:
com.ibm.btt.base.Hashtable

hasHandlersInterestedIn

protected static boolean hasHandlersInterestedIn(java.lang.String anEventName,
                                                 java.lang.String aNotifierName,
                                                 java.lang.String aTID)
Returns true if the EventManager has a Handler registered for the specified remote event.

Parameters:
anEventName - java.lang.String
aNotifierName - java.lang.String
aTID - java.lang.String
Returns:
boolean

removeHandler

public static void removeHandler(ProcessorHandler aHandler,
                                 java.lang.String anEventName,
                                 java.lang.String aNotifierName,
                                 Context aContext)
                          throws DSEInvalidArgumentException,
                                 BTTProcessorHandlerNotFoundException
Deregisters the event Handler from the notifier, whether the Notifier exists on this machine or not.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler - The Handler that wants to deregister for an event
anEventName - java.lang.String - The name of the event the Handler is no longer interested in
aNotifierName - java.lang.String - The name of the Notifier that will signal the event identified as "anEventName"
aContext - com.ibm.btt.base.Context - The context where the EventManager will look for the notifier "aNotifierName"
Throws:
DSEInvalidArgumentException
BTTProcessorHandlerNotFoundException

removeHandler

public static void removeHandler(ProcessorHandler aHandler,
                                 java.lang.String anEventName,
                                 java.lang.String aNotifierName,
                                 Context aContext,
                                 java.lang.String aTID)
                          throws BTTProcessorHandlerNotFoundException,
                                 DSEInvalidArgumentException
Deregisters the event Handler from the notifier if the Notifier exists on the specified server.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler - The Handler that wants to deregister for an event
anEventName - java.lang.String - The name of the event the Handler is no more interested in
aNotifierName - java.lang.String - The name of the Notifier that will signal the event identified as anEventName
aContext - com.ibm.btt.base.Context
aTID - java.lang.String - The TID of the server
Throws:
BTTProcessorHandlerNotFoundException
DSEInvalidArgumentException

removeHandlerForException

public static void removeHandlerForException(ProcessorHandler aHandler)
                                      throws DSEInvalidArgumentException,
                                             BTTProcessorHandlerNotFoundException
Deregisters the specified Handler for exceptions.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler
Throws:
DSEInvalidArgumentException
BTTProcessorHandlerNotFoundException

removesHandlerForException

public static void removesHandlerForException(ProcessorHandler aHandler,
                                              java.lang.String aServerTID)
                                       throws DSEInvalidArgumentException,
                                              BTTProcessorHandlerNotFoundException
Deregisters the specified Handler for exceptions originating from the server identified by aServerTID.

Parameters:
aHandler - com.ibm.btt.base.ProcessorHandler
aServerTID - java.lang.String - The TID of the server where the exception will be originated
Throws:
DSEInvalidArgumentException
BTTProcessorHandlerNotFoundException

reset

public static void reset()
Initializes this class.


setUniqueInstance

protected static void setUniqueInstance(ProcessorEventManager anEventManager)
Sets the uniqueInstance attribute value. This should be the only instance of EventManager in the application environment (either in a client or in a server).

Parameters:
anEventManager - com.ibm.btt.base.ProcessorEventManager

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009