Packageorg.flexunit.runner.notification.async
Classpublic class AsyncListenerWatcher
InheritanceAsyncListenerWatcher Inheritance Object

The AsyncListenerWatcher is responsible for determing whether all IAsyncStartupRunListeners that it is watching are ready. This is used in order to make sure that all potential IAsyncStartupRunListeners that are used in a test run are ready before the test run begins. In order to track a IAsyncStartupRunListener, the listener must be watched by calling the #watchListener() method. Once a listener is being watched, it will be counted as a pending listener. Once the lister reports that it is ready or it has failed, it will be removed as a pending listener. Once all listeners are no longer pending, the test run can begin. In order to unwatch a listener, the #unwatchListener() method needs to be called, providing the method with the IAsyncStartupRunListener to stop watching.



Public Properties
 PropertyDefined By
  allListenersComplete : Boolean
[read-only] Returns a Boolean value indicating whether all are complete
AsyncListenerWatcher
  allListenersReady : Boolean
[read-only] Returns a Boolean value indicating whether all listeners are ready
AsyncListenerWatcher
  completeToken : AsyncCoreStartupToken
[read-only] Returns the complete AsyncCoreStartupToken
AsyncListenerWatcher
  pendingCount : int
[read-only] Returns the number of pending start ups
AsyncListenerWatcher
  startUpToken : AsyncCoreStartupToken
[read-only] Returns the start up AsyncCoreStartupToken
AsyncListenerWatcher
  totalCount : int
[read-only] Returns the number of total start ups
AsyncListenerWatcher
Public Methods
 MethodDefined By
  
Constructor.
AsyncListenerWatcher
  
Makes the AsyncListenerWatcher stop watching the provided IAsyncStartupRunListener
AsyncListenerWatcher
  
Makes the AsyncListenerWatcher start watching the provided IAsyncStartupRunListener
AsyncListenerWatcher
Protected Methods
 MethodDefined By
  
Stop monitoring the IAsyncStartupRunListener
AsyncListenerWatcher
  
handleListenerFailed(event:Event):void
Stops listening when the listener will be ready, removes the listener from the IRunNotifier.
AsyncListenerWatcher
  
handleListenerReady(event:Event):void
Stops listening when the listener will be ready and determines if all other listeners are ready
AsyncListenerWatcher
  
Monitors the IAsyncStartupRunListener to determine if the listener is ready or if the listener has failed
AsyncListenerWatcher
  
Instruct the start up token that all listeners are now ready
AsyncListenerWatcher
Public Constants
 ConstantDefined By
  LISTENER_COMPLETE : String = listenerComplete
[static]
AsyncListenerWatcher
  LISTENER_FAILED : String = listenerFailed
[static]
AsyncListenerWatcher
  LISTENER_READY : String = listenerReady
[static]
AsyncListenerWatcher
Property Detail
allListenersCompleteproperty
allListenersComplete:Boolean  [read-only]

Returns a Boolean value indicating whether all are complete


Implementation
    public function get allListenersComplete():Boolean
allListenersReadyproperty 
allListenersReady:Boolean  [read-only]

Returns a Boolean value indicating whether all listeners are ready


Implementation
    public function get allListenersReady():Boolean
completeTokenproperty 
completeToken:AsyncCoreStartupToken  [read-only]

Returns the complete AsyncCoreStartupToken


Implementation
    public function get completeToken():AsyncCoreStartupToken
pendingCountproperty 
pendingCount:int  [read-only]

Returns the number of pending start ups


Implementation
    public function get pendingCount():int
startUpTokenproperty 
startUpToken:AsyncCoreStartupToken  [read-only]

Returns the start up AsyncCoreStartupToken


Implementation
    public function get startUpToken():AsyncCoreStartupToken
totalCountproperty 
totalCount:int  [read-only]

Returns the number of total start ups


Implementation
    public function get totalCount():int
Constructor Detail
AsyncListenerWatcher()Constructor
public function AsyncListenerWatcher(notifier:IRunNotifier, logger:*)

Constructor.

Parameters
notifier:IRunNotifier
 
logger:*
Method Detail
cleanupStartupListeners()method
protected function cleanupStartupListeners(listener:IAsyncStartupRunListener):void

Stop monitoring the IAsyncStartupRunListener

Parameters

listener:IAsyncStartupRunListener — The IAsyncStartupRunListener to stop listening to

handleListenerFailed()method 
protected function handleListenerFailed(event:Event):void

Stops listening when the listener will be ready, removes the listener from the IRunNotifier. and determines if all other listeners are ready

Parameters

event:Event

handleListenerReady()method 
protected function handleListenerReady(event:Event):void

Stops listening when the listener will be ready and determines if all other listeners are ready

Parameters

event:Event

monitorForAsyncStartup()method 
protected function monitorForAsyncStartup(listener:IAsyncStartupRunListener):void

Monitors the IAsyncStartupRunListener to determine if the listener is ready or if the listener has failed

Parameters

listener:IAsyncStartupRunListener — The IAsyncStartupRunListener to listen to

sendReadyNotification()method 
protected function sendReadyNotification():void

Instruct the start up token that all listeners are now ready

unwatchListener()method 
public function unwatchListener(listener:IAsyncStartupRunListener):void

Makes the AsyncListenerWatcher stop watching the provided IAsyncStartupRunListener

Parameters

listener:IAsyncStartupRunListener — The IAsyncStartupRunListener to stop watching

watchListener()method 
public function watchListener(listener:IAsyncStartupRunListener):void

Makes the AsyncListenerWatcher start watching the provided IAsyncStartupRunListener

Parameters

listener:IAsyncStartupRunListener — The IAsyncStartupRunListener to watch

Constant Detail
LISTENER_COMPLETEConstant
public static const LISTENER_COMPLETE:String = listenerComplete

LISTENER_FAILEDConstant 
public static const LISTENER_FAILED:String = listenerFailed

LISTENER_READYConstant 
public static const LISTENER_READY:String = listenerReady