Event mechanism

BTT Web2.0 On-Demand Workplace implements communication between components through the event mechanism. The event mechanism consists of two main modules, event manager and event. As an asynchronous communication approach, event mechanism makes the transfer of message between different modules convenient and effective.

The following picture shows the structure of BTT Web2.0 On-Demand Workplace event:

the structure of BTT Web2.0 On-Demand Workplace event

Event manger

An event manager acts as the event controller between notifiers and handlers to manage communication between components. It is named as BTTEventMng in BTT Web2.0 On-Demand Workplace. When we need to publish an event, subscribe an event, or fire an event, we just call the corresponding methods of event manager. The manager is the core of BTT event mechanism.

Event is an inner data structure representing an event identified by a string (event name). In BTT Web2.0 On-Demand Workplace, event module is named for BTTEvent which represents an event instance. When you publish or register an event by addEvents(eventName), one BTTEvent instance is created. You can add listeners in the BTTEvent instance and fire it in BTTEventMng.