| Package | org.springextensions.actionscript.ioc.factory.config |
| SVN browsing | RouteEventsMetaDataPostProcessor.as |
| Fisheye | RouteEventsMetaDataPostProcessor.as |
| Class | public class RouteEventsMetaDataPostProcessor |
| Inheritance | RouteEventsMetaDataPostProcessor AbstractMetadataProcessor |
| Implements | IDisposable |
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
Documentation reference: routing other events through the eventbus
| Property | Defined by | ||
|---|---|---|---|
| isDisposed : Boolean [read-only]
| RouteEventsMetaDataPostProcessor | ||
![]() | metadataNames : Array
The names of the metadata annotations that the current
IMetadataProcessor processes. | AbstractMetadataProcessor | |
![]() | processBeforeInitialization : Boolean
If
true the IMetadataProcessor instance will be able to process the annotated
instance before it has been initialized by the container. | AbstractMetadataProcessor | |
| Method | Defined 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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
addEventListeners(eventDispatcher:IEventDispatcher, eventTypes:Array):void
| RouteEventsMetaDataPostProcessor | ||
![]() |
init(processBefore:Boolean, metadataNames:Array):void
Initializes the current
AbstractMetadataProcessor. | AbstractMetadataProcessor | |
|
rerouteToEventBus(event:Event):void
| RouteEventsMetaDataPostProcessor | ||
| Constant | Defined 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 | ||
| isDisposed | property |
isDisposed:Boolean [read-only]Implementation
public function get isDisposed():Boolean
| RouteEventsMetaDataPostProcessor | () | constructor |
public function RouteEventsMetaDataPostProcessor()
Creates a new RouteEventsMetaDataPostProcessor instance.
| addEventListeners | () | method |
protected function addEventListeners(eventDispatcher:IEventDispatcher, eventTypes:Array):voidParameters
eventDispatcher:IEventDispatcher |
|
eventTypes:Array |
| dispose | () | method |
public function dispose():voidLoops 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 |
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.
eventDispatcher:IEventDispatcher |
| rerouteToEventBus | () | method |
protected function rerouteToEventBus(event:Event):voidParameters
event:Event |
| EVENT_METADATA | constant |
protected static const EVENT_METADATA:String = "Event"The Event metadata
| EVENTS_KEY | constant |
protected static const EVENTS_KEY:String = "events"The events metadata argument
| NAME_KEY | constant |
protected static const NAME_KEY:String = "name"The name metadata argument