IProxy Proxy |
InitMonitorProxy |
com.afw.puremvc.InitMonitor.model
InitMonitorProxy: Sequentially processes a list of Proxies (proxies that implement IInitProxy Interface) This monitor invokes each proxy by calling load() directly. The Monitor detects via notification when each proxy has completed its processing.
NOTE: (optional) completeNotification should be set before calling start(). This notification is sent when all items have been processed.
TO USE: (using a gallery app as an example...)
var monitor:InitMonitorProxy = (facade.retrieveProxy( InitMonitorProxy.NAME ) as InitMonitorProxy);
monitor.completeNotification = new Notification(ApplicationFacade.GALLERY_INIT_COMPLETE);
monitor.addResources( [ GalleryInitOneProxy.NAME, GalleryInitTwoProxy.NAME ] );
monitor.start();
NOTE: Proxies that extend BulkAssetsProxy should ussually send a _LOADED notification. Note that for a proxy that never reloads its content when called again, the _LOADED notification is only sent 1X, while the completeNotificationName notification is sent every time.
| InitMonitorProxy | com.afw.puremvc.InitMonitor.model |
| Constants | |
| NAME | |
| Variables | |
| _busy | |
| resources | |
| currIndex | |
| alreadyCompletePNames | |
| noteTOpnameMap | |
| toCompleteCount | |
| completedCount | |
| currCompletedCount | |
| _completeNotification | |
| _progressNotificationName | |
| _startNotificationName | |
| _completeNotificationName | |
| Functions | |
| InitMonitorProxy | |
| stop | Always call stop() before start() to cancel the previous operation and reset the queue |
| addResources | Call this function at least 1X before calling start() |
| start | Call this to start the process, !!!remember to call stop() first if this is a new section!!! |
| startCurrGroup | |
| resourceComplete | Gets called by InitResourceCompleteCommand every time a proxy completes Don’t call this function directly |
| Properties | |
| completeNotification | The Notification that is sent when all proxies are processed |
| completeNotification | This notification is sent after all proxies have issued COMPLETE commands (optional) |
| progressNotificationName | |
| progressNotificationName | Sent each time a proxy is complete |
| completeNotificationName | |
| completeNotificationName | |
| startNotificationName | |
| startNotificationName |
public static const NAME: String
private var _busy: Boolean
private var resources: Array
private var currIndex: int
private var alreadyCompletePNames: Object
private var noteTOpnameMap: Object
private var toCompleteCount: int
private var completedCount: int
private var currCompletedCount: int
private var _completeNotification: Notification
private var _progressNotificationName: String
private var _startNotificationName: String
private var _completeNotificationName: String
public function InitMonitorProxy()
Always call stop() before start() to cancel the previous operation and reset the queue
public function stop():void
Call this function at least 1X before calling start()
public function addResources( resources: Array ):void
Call this to start the process, !!!remember to call stop() first if this is a new section!!!
public function start():void
private function startCurrGroup():void
Gets called by InitResourceCompleteCommand every time a proxy completes Don’t call this function directly
public function resourceComplete( noteName: String ):void
The Notification that is sent when all proxies are processed
public function get completeNotification():Notification
public function get progressNotificationName():String
public function get completeNotificationName():String
public function get startNotificationName():String