Package wt.events

Class StandardKeyedEventDispatcher

java.lang.Object
wt.events.StandardKeyedEventDispatcher
All Implemented Interfaces:
KeyedEventDispatcher

public class StandardKeyedEventDispatcher extends Object implements KeyedEventDispatcher
Reference implementation of a KeyedEventDispatcher. This class implements a synchronous "in thread/transaction" dispatch of event notifications. There are two forms of dispatch, vetoable and non-vetoable. Vetoable event dispatches provide the ability for listeners to object to the consequence of an event by throwing an exception of a type prescribed by the event generator.

Events are dispatched synchronously in the thread of the event generator. Consequently, listeners are expected to respond to the event quickly. All side effects of the listeners actions will be in the same thread and transaction of the event generator and so the listener must be desiged to "play nice".

Veto listeners are notified of vetoable events when their notifyVetoableEvent method is invoked. Veto listeners may object to the event by throwing an exception of a type prescribed by the event generator. Note that since the events package is a general purpose package it cannot enforce type safe exceptions. It is up to the developer to make sure that an exception of the correct type is thrown.



Supported API: true

Extendable: false

See Also: