Packageorg.springextensions.actionscript.ioc.factory.config
SVN browsingRouteEventsMetaDataPostProcessor.as
FisheyeRouteEventsMetaDataPostProcessor.as
Classpublic class RouteEventsMetaDataPostProcessor
InheritanceRouteEventsMetaDataPostProcessor Inheritance AbstractMetadataProcessor
ImplementsIDisposable

IMetadataProcessor implementation that can re-route events from arbitrary objects through the EventBus.dispatchEvent() method.

To re-route all events that are dispatched by an object add this metadata to a class:

  [RouteEvents]
  [Event(name="eventName1",type="...")]
  [Event(name="eventName2",type="...")]
  [Event(name="eventName3",type="...")]
  public class MyClass {
  //implementation omitted...
  }
  
If only certain events need to be re-routed, then add them to the events argument of the [RouteEvents] key:
  [RouteEvents(events="eventName1,eventName2")]
  [Event(name="eventName1",type="...")]
  [Event(name="eventName2",type="...")]
  [Event(name="eventName3",type="...")]
  public class MyClass {
//implementation omitted... }

Finally, to use the RouteEventsMetaDataPostProcessor in an application, add an object definition to the XML configuration like this:

  <object id="routeEventsProcessor" class="org.springextensions.actionscript.ioc.factory.config.RouteEventsMetaDataPostProcessor"/>
  

This way the processor will be automatically registered with the application context.

See also

EventBus


Documentation reference: routing other events through the eventbus


Public Properties
 PropertyDefined by
  isDisposed : Boolean
[read-only]
RouteEventsMetaDataPostProcessor
 InheritedmetadataNames : Array
The names of the metadata annotations that the current IMetadataProcessor processes.
AbstractMetadataProcessor
 InheritedprocessBeforeInitialization : Boolean
If true the IMetadataProcessor instance will be able to process the annotated instance before it has been initialized by the container.
AbstractMetadataProcessor
Public Methods
 MethodDefined by
  
Creates a new RouteEventsMetaDataPostProcessor instance.
RouteEventsMetaDataPostProcessor
  
dispose():void
Loops through the internal cache of eventDispatchers, removes all added eventlisteners, clears the cache and nulls it.
RouteEventsMetaDataPostProcessor
  
extractEventTypeNamesFromMetaDataArgument(metaDataArgument:MetaDataArgument):Array
RouteEventsMetaDataPostProcessor
  
process(instance:Object, container:IMetaDataContainer, name:String, objectName:String):void
RouteEventsMetaDataPostProcessor
  
removeListeners(eventDispatcher:IEventDispatcher):void
Removes all the event listeners that were added to the specified IEventDispatcher.
RouteEventsMetaDataPostProcessor
Protected Methods
 MethodDefined by
  
addEventListeners(eventDispatcher:IEventDispatcher, eventTypes:Array):void
RouteEventsMetaDataPostProcessor
 Inherited
init(processBefore:Boolean, metadataNames:Array):void
Initializes the current AbstractMetadataProcessor.
AbstractMetadataProcessor
  
rerouteToEventBus(event:Event):void
RouteEventsMetaDataPostProcessor
Protected Constants
 ConstantDefined by
  EVENT_METADATA : String = "Event"
[static] The Event metadata
RouteEventsMetaDataPostProcessor
  EVENTS_KEY : String = "events"
[static] The events metadata argument
RouteEventsMetaDataPostProcessor
  NAME_KEY : String = "name"
[static] The name metadata argument
RouteEventsMetaDataPostProcessor
Property detail
isDisposedproperty
isDisposed:Boolean  [read-only]Implementation
    public function get isDisposed():Boolean
Constructor detail
RouteEventsMetaDataPostProcessor()constructor
public function RouteEventsMetaDataPostProcessor()

Creates a new RouteEventsMetaDataPostProcessor instance.

Method detail
addEventListeners()method
protected function addEventListeners(eventDispatcher:IEventDispatcher, eventTypes:Array):voidParameters
eventDispatcher:IEventDispatcher
 
eventTypes:Array
dispose()method 
public function dispose():void

Loops through the internal cache of eventDispatchers, removes all added eventlisteners, clears the cache and nulls it.

extractEventTypeNamesFromMetaDataArgument()method 
public function extractEventTypeNamesFromMetaDataArgument(metaDataArgument:MetaDataArgument):ArrayParameters
metaDataArgument:MetaDataArgument

Returns
Array
process()method 
public override function process(instance:Object, container:IMetaDataContainer, name:String, objectName:String):voidParameters
instance:Object
 
container:IMetaDataContainer
 
name:String
 
objectName:String
removeListeners()method 
public function removeListeners(eventDispatcher:IEventDispatcher):void

Removes all the event listeners that were added to the specified IEventDispatcher.

Parameters
eventDispatcher:IEventDispatcher
rerouteToEventBus()method 
protected function rerouteToEventBus(event:Event):voidParameters
event:Event
Constant detail
EVENT_METADATAconstant
protected static const EVENT_METADATA:String = "Event"

The Event metadata

EVENTS_KEYconstant 
protected static const EVENTS_KEY:String = "events"

The events metadata argument

NAME_KEYconstant 
protected static const NAME_KEY:String = "name"

The name metadata argument