|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.base.DSENotifier
The DSENotifier class provides the capability to its objects to send and process event notifications.
If a class has to send event notifications, it can be defined as a subclass of Notifier or it can implement the Notifier interface. The Notifier constructor registers the new Notifier instance to the EventsManager so it can manage the handlers, which are registering for local or remote events, in a transparent way for the application.
Field Summary | |
protected Hashtable |
handlersList
|
protected java.lang.String |
name
|
Constructor Summary | |
DSENotifier()
This constructor creates a DSENotifier object. |
|
DSENotifier(boolean mustRegister)
This constructor creates a DSENotifier with mustRegister. |
|
DSENotifier(java.lang.String aName)
This constructor creates a DSENotifier with a name. |
|
DSENotifier(java.lang.String aName,
java.lang.String aTID)
This constructor creates a DSENotifier with a name. |
Method Summary | |
void |
addHandler(Handler aHandler,
java.lang.String anEventName)
Adds a aHandler to the chain of handlers for the specific instance of DSENotifier. |
Hashtable |
getHandlersList()
Gets the handlersList attribute value. |
java.lang.String |
getName()
Gets the name attribute value. |
void |
removeHandler(Handler aHandler,
java.lang.String anEventName)
Removes aHandler from the chain of handlers for that specific DSENotifier instance if the event it is interested in matches anEventName. |
void |
setName(java.lang.String aName)
Sets the notifier name to aName. |
void |
signalEvent(DSEEventObject anEvent)
The operation must call the dispatch method of the first handler registered for this event, proceed according to the defined event propagation criteria, and follow the chain of handlers. |
void |
signalEvent(java.lang.String anEventName)
Generates, by default, the event named anEventName as a specific event. |
void |
signalEvent(java.lang.String anEventName,
Hashtable params)
Generates, by default, the event namedanEventName as a specific event. |
void |
terminate()
Provides a housekeeping process for the notifier instance. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String name
protected Hashtable handlersList
Constructor Detail |
public DSENotifier()
The constructor registers the new DSENotifier with the EventManager so it can manage the handlers, which are registering for local or remote events, in a transparent way for the application.
public DSENotifier(java.lang.String aName)
This constructor creates a DSENotifier with name aName and register this new instance with the EventManager so it can manage the handlers, which are registering for local or remote events, in a transparent way for the application.
public DSENotifier(java.lang.String aName, java.lang.String aTID)
This constructor creates a DSENotifier with name aName for a specific operation started in a workstation, which is identified by aTID. It registers this new instance to the EventManager so it can manage the handlers, which are registering for local or remote events, in a transparent way for the application.
public DSENotifier(boolean mustRegister)
mustRegister
- booleanMethod Detail |
public void addHandler(Handler aHandler, java.lang.String anEventName) throws DSEInvalidArgumentException
The handler is located in the first position of the chain so it is the first handler to receive the event when signaled.
The handler, which is added to the chain of handlers using this operation, is registered for the event anEventName to be signaled by the DSENotifier. If it is interested in any event signaled by this notifier, then the event name must be set to allEvents. This method generates a DSEInvalidArgumentException when aHandler or anEventName are null.
public Hashtable getHandlersList()
public java.lang.String getName()
public void removeHandler(Handler aHandler, java.lang.String anEventName) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
If anEventName is allEvents all entries in the list for that specific handler are removed. This method can generate a:
public void setName(java.lang.String aName)
public void signalEvent(DSEEventObject anEvent)
anEvent
- DSEEventObjectpublic void signalEvent(java.lang.String anEventName) throws DSEInvalidArgumentException
This means that the operation must call the dispatch method of the first handler registered for this event, proceed according to the defined event propagation criteria, and follow the chain of handlers.anEvent contains, as attributes, the name and the source of this event. Required notifier interface implementors must define themselves as a source of a standard Java event (that awakes all the listeners waiting for it). The signalEvent method can then be overwritten to add the statement that fires the event in the standard Java way. Additional methods to add and remove listeners must be implemented as defined in the Java development guide.
This method throws a DSEInvalidArgumentException generated by the DSEEventObject constructor.
anEventName
- java.lang.Stringpublic void signalEvent(java.lang.String anEventName, Hashtable params) throws DSEInvalidArgumentException
The operation must call the dispatch method of the first handler registered for this event, proceed according to the defined event propagation criteria, and follow the chain of handlers. anEventName event contains, as attributes, as much information as is required to process it. The information is held in the params hashtable. Required notifier interface implementors must define themselves as a source of a standard Java event (that awakes all the listeners waiting for it). The signalEvent method can then be overwritten to add the statement that fires the event in the standard Java way. Additional methods to add and remove listeners must be implemented as defined in the Java development guide. This method throws a DSEInvalidArgumentException generated by the DSEEventObject constructor.
public void terminate() throws DSEException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |