|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dse.base.EventManager
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 boolean |
isCSNotificationListener
|
protected static Hashtable |
mirrorNotifiers
|
protected static Vector |
notifierList
|
protected static Operation |
operation
|
protected Hashtable |
remoteHandlersList
|
protected static EventManager |
uniqueInstance
|
protected static Hashtable |
workstationList
|
Constructor Summary | |
---|---|
EventManager()
|
Method Summary | |
---|---|
static void |
addHandler(Handler 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(Handler 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 |
addHandler(java.lang.String anEventName,
java.lang.String aNotifierName,
java.lang.String aSessionId)
Registers the client to the Notifier aNotifierName as interested in the specified event for the duration of the session. |
static void |
addHandlerForException(Handler aHandler)
Registers the specified Handler for exceptions. |
static void |
addHandlerForException(Handler aHandler,
java.lang.String aServerTID)
Registers the specified Handler for exceptions originating from the server identified by aServerTID. |
protected static void |
addHandlerForException(java.lang.String aSessionId)
Registers a Handler for exceptions originating from a server. |
static void |
addNotifier(Notifier aNotifier)
Adds a Notifier to the list of Notifiers. |
static void |
addNotifier(Notifier aNotifier,
java.lang.String aTID)
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. |
static void |
deregisterInterestInRemoteEvent(java.lang.String anEventName,
java.lang.String aNotifierName)
Deregisters the client as no longer interested in the event anEventName originating from the specified Notifier. |
static void |
deregisterInterestInRemoteEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
CSClientService aCSClient)
Deregisters the specified client as no longer interested in an event "anEventName" originating from the specified Notifier. |
static void |
deregisterInterestInRemoteEvent(Vector aList)
Deregisters the client as no longer interested in certain events. |
static void |
deregisterInterestInRemoteEvent(Vector aList,
CSClientService aCSClient)
Deregisters the specified client as no longer interested in certain events. |
static void |
deregisterInterestInRemoteException()
Deregisters the client as no longer interested in server-side exceptions. |
static void |
deregisterInterestInRemoteException(CSClientService aCSClient)
Deregisters the specified client as no longer interested in server-side exceptions. |
static void |
deregisterServerInterestInEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
Context aContext,
CSClientService aCSClient)
Deregisters the server as no longer interested in an event originating from the specified client. |
protected static MirrorNotifier |
getMirrorNotifier(java.lang.String aNotifierName)
Returns the MirrorNotifier named aNotifierName. |
protected static Hashtable |
getMirrorNotifiers()
Returns the mirrorNotifiers attribute value. |
protected static Notifier |
getNotifier(java.lang.String aNotifierName)
Returns the Notifier named aNotifierName. |
protected static Vector |
getNotifierList()
Returns the notifierList attribute value. |
protected static Operation |
getOperation()
Returns the operation attribute value. |
protected static EventManager |
getUniqueInstance()
Returns the unique instance of EventManager running on the application environment. |
protected static Hashtable |
getWorkstationList()
Returns the workstationList attribute value. |
void |
handleCSNotificationEvent(CSNotificationEvent event)
Calls the dispatch methods of the registered Handlers based on the information included in the event CSNotificationEvent. |
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 |
registerInterestInRemoteEvent(java.lang.String anEventName,
java.lang.String aNotifierName)
Registers the client as interested in the event anEventName originating from the specified Notifier. |
static void |
registerInterestInRemoteEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
CSClientService aCSClient)
Registers the specified client as interested in the event anEventName originating from the specified Notifier. |
static void |
registerInterestInRemoteEvent(Vector aList)
Registers the client as interested in certain events. |
static void |
registerInterestInRemoteEvent(Vector aList,
CSClientService aCSClient)
Registers the specified client as interested in certain events. |
static void |
registerInterestInRemoteException()
Registers the client as interested in server-side exceptions. |
static void |
registerInterestInRemoteException(CSClientService aCSClient)
Registers the specified client as interested in server-side exceptions. |
static void |
registerServerInterestInEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
Context aContext,
CSClientService aCSClient)
Registers the server as interested in an event originating from the specified client. |
static void |
removeHandler(Handler 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(Handler 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 |
removeHandler(java.lang.String anEventName,
java.lang.String aNotifierName,
java.lang.String aSessionId)
Deregisters the client to the Notifier "aNotifierName" as interested in the specified event for the duration of the session. |
static void |
removeHandlerForException(Handler aHandler)
Deregisters the specified Handler for exceptions. |
protected static void |
removeHandlerForException(java.lang.String aSessionId)
Deregisters the specified Handler for exceptions originating from the server. |
static void |
removesHandlerForException(Handler aHandler,
java.lang.String aServerTID)
Deregisters the specified Handler for exceptions originating from the server identified by aServerTID. |
protected static void |
removeWorkstation(java.lang.String anEventName,
java.lang.String aNotifierName,
java.lang.String aClientWorkstation)
Removes the specifed workstation from the workstationList. |
static void |
reset()
Initializes this class. |
static void |
sendException(DSEException anException)
Sends an exception. |
protected static void |
setOperation(Operation anOperation)
Sets the value of operation. |
protected static void |
setUniqueInstance(EventManager 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 |
public static final java.lang.String COMPID
protected Hashtable handlersList
protected Hashtable remoteHandlersList
protected Vector exceptionHandlerList
protected static Vector notifierList
protected static Operation operation
protected static EventManager uniqueInstance
protected static Hashtable workstationList
protected static Hashtable mirrorNotifiers
protected static boolean isCSNotificationListener
Constructor Detail |
public EventManager()
Method Detail |
public static void addHandler(Handler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext) throws DSEInvalidArgumentException
aHandler
- com.ibm.dse.base.Handler - The Handler that wants to register for an eventanEventName
- java.lang.String - The name of the event the Handler is interested inaNotifierName
- java.lang.String - The name of the Notifier that will signal the event identified as anEventNameaContext
- com.ibm.dse.base.Context - The context where the EventManager will look for the notifier aNotifierName
DSEInvalidArgumentException
public static void addHandler(Handler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aServerTID) throws DSEInvalidArgumentException
aHandler
- com.ibm.dse.base.Handler - The Handler that wants to register for an eventanEventName
- java.lang.String - The name of the event the Handler is interested inaNotifierName
- java.lang.String - The name of the Notifier that will signal the event identified as anEventNameaContext
- com.ibm.dse.base.ContextaServerTID
- java.lang.String - The TID of the server where the event will be produced
DSEInvalidArgumentException
public static void addHandler(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aSessionId) throws DSEInvalidArgumentException, DSEInvalidRequestException, DSEObjectNotFoundException, DSEHandlerNotFoundException, DSEException
anEventName
- java.lang.String - The name of the event the client will be interested inaNotifierName
- java.lang.String - The name of the Notifier that will produce the event anEventNameaSessionId
- java.lang.String - The identification of the session between client and server
DSEInvalidArgumentException
DSEInvalidRequestException
DSEObjectNotFoundException
DSEHandlerNotFoundException
DSEException
public static void addHandlerForException(Handler aHandler) throws DSEInvalidArgumentException
aHandler
- com.ibm.dse.base.Handler
DSEInvalidArgumentException
public static void addHandlerForException(Handler aHandler, java.lang.String aServerTID) throws DSEInvalidArgumentException
aHandler
- com.ibm.dse.base.HandleraServerTID
- java.lang.String - The TID of the server where the exception will be originated
DSEInvalidArgumentException
protected static void addHandlerForException(java.lang.String aSessionId) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSessionId
- java.lang.String - The identification of the session between the client that has the Handler and server
DSEInvalidRequestException
DSEObjectNotFoundException
public static void addNotifier(Notifier aNotifier) throws DSEInvalidArgumentException
aNotifier
- com.ibm.dse.base.Notifier
DSEInvalidArgumentException
public static void addNotifier(Notifier aNotifier, java.lang.String aTID) throws DSEInvalidArgumentException
aNotifier
- com.ibm.dse.base.NotifieraTID
- java.lang.String - The TID of the client, where there may be a Handler interested in an event produced by the notifier "aNotifier."
DSEInvalidArgumentException
protected static void addWorkstation(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aWorkstationTID)
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaWorkstationTID
- java.lang.Stringpublic static void deregisterInterestInRemoteEvent(Vector aList) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
aList
- com.ibm.dse.base.Vector
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void deregisterInterestInRemoteEvent(Vector aList, CSClientService aCSClient) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
aList
- com.ibm.dse.base.VectoraCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session with a specific server machine
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void deregisterInterestInRemoteEvent(java.lang.String anEventName, java.lang.String aNotifierName) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
anEventName
- java.lang.StringaNotifierName
- java.lang.String
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void deregisterInterestInRemoteEvent(java.lang.String anEventName, java.lang.String aNotifierName, CSClientService aCSClient) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService which keeps the session with a specific server machine
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void deregisterInterestInRemoteException() throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void deregisterInterestInRemoteException(CSClientService aCSClient) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
aCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session with a specific server machine
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void deregisterServerInterestInEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, CSClientService aCSClient) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaContext
- com.ibm.dse.base.ContextaCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session between client and server
DSEInvalidArgumentException
DSEHandlerNotFoundException
protected static MirrorNotifier getMirrorNotifier(java.lang.String aNotifierName)
aNotifierName
- java.lang.String
protected static Hashtable getMirrorNotifiers()
protected static Notifier getNotifier(java.lang.String aNotifierName)
aNotifierName
- java.lang.String
protected static Vector getNotifierList()
protected static Operation getOperation()
protected static EventManager getUniqueInstance()
protected static Hashtable getWorkstationList()
public void handleCSNotificationEvent(CSNotificationEvent event)
handleCSNotificationEvent
in interface CSNotificationListener
event
- com.ibm.dse.clientserver.CSNotificationEventprotected static boolean hasHandlersInterestedIn(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aTID)
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaTID
- java.lang.String
public static void registerInterestInRemoteEvent(Vector aList) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
aList
- com.ibm.dse.base.Vector
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void registerInterestInRemoteEvent(Vector aList, CSClientService aCSClient) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
aList
- com.ibm.dse.base.VectoraCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session between client and server
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void registerInterestInRemoteEvent(java.lang.String anEventName, java.lang.String aNotifierName) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
anEventName
- java.lang.StringaNotifierName
- java.lang.String
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void registerInterestInRemoteEvent(java.lang.String anEventName, java.lang.String aNotifierName, CSClientService aCSClient) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session between client and server
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void registerInterestInRemoteException() throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void registerInterestInRemoteException(CSClientService aCSClient) throws DSEInvalidRequestException, java.io.IOException, DSECSInvalidRequestException, DSECSRemoteOperationException, DSECSTimeoutException, DSEObjectNotFoundException
aCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session between client and server
DSEInvalidRequestException
java.io.IOException
DSECSInvalidRequestException
DSECSRemoteOperationException
DSECSTimeoutException
DSEObjectNotFoundException
public static void registerServerInterestInEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, CSClientService aCSClient) throws DSEInvalidArgumentException
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaContext
- com.ibm.dse.base.Context - The context where the EventManager will look for the notifier "aNotifierName"aCSClient
- com.ibm.dse.clientserver.CSClientService - The CSClientService instance which keeps the session between client and server
DSEInvalidArgumentException
public static void removeHandler(Handler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
aHandler
- com.ibm.dse.base.Handler - The Handler that wants to deregister for an eventanEventName
- java.lang.String - The name of the event the Handler is no longer interested inaNotifierName
- java.lang.String - The name of the Notifier that will signal the event identified as "anEventName"aContext
- com.ibm.dse.base.Context - The context where the EventManager will look for the notifier "aNotifierName"
DSEInvalidArgumentException
DSEHandlerNotFoundException
public static void removeHandler(Handler aHandler, java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID) throws DSEHandlerNotFoundException, DSEInvalidArgumentException
aHandler
- com.ibm.dse.base.Handler - The Handler that wants to deregister for an eventanEventName
- java.lang.String - The name of the event the Handler is no more interested inaNotifierName
- java.lang.String - The name of the Notifier that will signal the event identified as anEventNameaContext
- com.ibm.dse.base.ContextaTID
- java.lang.String - The TID of the server
DSEHandlerNotFoundException
DSEInvalidArgumentException
public static void removeHandler(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aSessionId) throws DSEHandlerNotFoundException, DSEInvalidArgumentException, DSEInvalidRequestException, DSEObjectNotFoundException
anEventName
- java.lang.String - The name of the event the client is no longer interested inaNotifierName
- java.lang.String - The name of the Notifier that will produce the event "anEventName"aSessionId
- java.lang.String - The identification of the session between client and server
DSEHandlerNotFoundException
DSEInvalidArgumentException
DSEInvalidRequestException
DSEObjectNotFoundException
public static void removeHandlerForException(Handler aHandler) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
aHandler
- com.ibm.dse.base.Handler
DSEInvalidArgumentException
DSEHandlerNotFoundException
protected static void removeHandlerForException(java.lang.String aSessionId) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSessionId
- java.lang.String - The identification of the session between the client that has the Handler and server
DSEInvalidRequestException
DSEObjectNotFoundException
public static void removesHandlerForException(Handler aHandler, java.lang.String aServerTID) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
aHandler
- com.ibm.dse.base.HandleraServerTID
- java.lang.String - The TID of the server where the exception will be originated
DSEInvalidArgumentException
DSEHandlerNotFoundException
protected static void removeWorkstation(java.lang.String anEventName, java.lang.String aNotifierName, java.lang.String aClientWorkstation)
anEventName
- java.lang.StringaNotifierName
- java.lang.StringaClientWorkstation
- java.lang.Stringpublic static void reset()
public static void sendException(DSEException anException)
anException
- com.ibm.dse.base.DSEExceptionprotected static void setOperation(Operation anOperation)
anOperation
- com.ibm.dse.base.Operationprotected static void setUniqueInstance(EventManager anEventManager)
anEventManager
- com.ibm.dse.base.EventManager
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |