A fundamental part of Mate is the EventMap tag. It allows you define mappings for the events that your application creates. It is basically a collection of EventHandlers blocks, where each block matches an event type.

   ...event handler lists here...

The EventMap also serves as the mapping for Injectors.

The EventMap tag doesn't have any attribute, but its importance lies in the tags in can contain.

Inner tags


The event map contains an EventHandlers block for every event that you want to listen to. Each block is executed every time an event of the type specified is dispatched. Blocks are defined by using the EventHandlers tag.

<EventMap xmlns="http://mate.asfusion.com/">

   <EventHandlers type="myEventType">
      ... here what you want to happen when this event is dispatched...
   <EventHandlers type="myOtherEventType">
      ... here what you want to happen when this other event is dispatched...

See EventHandlers for more information.


In addition to EventHandlers blocks, an event map can also contain MessageHandlers blocks. A block of MessageHandlers will be executed when a given Flex Messaging Service message is received. For the sequence to run, you must specify the same attributes you would in an <mx:Consumer> tag, so that when a message is received by the application, it is routed to the correct MessageHandler.

See MessageHandlers for more information.

An event map may contain any combination of EventHandlers and MessageHandlers tags:

<EventMap xmlns="http://mate.asfusion.com/">

   <MessageHandlers destination="ColdFusionGateway">
      ... here what you want to happen when this message is received ...



Actions listed inside an Injectors block will be executed when an object of the class defined in the target attribute is created.

<EventMap xmlns="http://mate.asfusion.com/">

   <Injectors target="{MyTargetClass}">
      ... here what you want to happen when an instance of MyTargetClass is created ...