Packageorg.spicefactory.parsley.lifecycle.observer
Classpublic class DefaultLifecycleObserver
InheritanceDefaultLifecycleObserver Inheritance Object
Implements LifecycleObserver

Default implementation of the LifecycleObserver interface.



Public Properties
 PropertyDefined By
  objectId : String
[read-only] The optional id of the object as registered in the Context.
DefaultLifecycleObserver
  observedType : Class
[read-only] The type of the objects the observer is interested in.
DefaultLifecycleObserver
  phase : Phase
[read-only] The phase of the object lifecycle that should trigger the observer.
DefaultLifecycleObserver
Public Methods
 MethodDefined By
  
DefaultLifecycleObserver(provider:ObjectProvider, method:String, phase:Phase = null, objectId:String = null, explicitType:ClassInfo = null)
Creates a new instance.
DefaultLifecycleObserver
  
observe(observed:Object):void
Invoked when any matching object reaches the specified phase in its lifecycle.
DefaultLifecycleObserver
Property Detail
objectIdproperty
objectId:String  [read-only]

The optional id of the object as registered in the Context. If omitted all matching types will be observed.


Implementation
    public function get objectId():String
observedTypeproperty 
observedType:Class  [read-only]

The type of the objects the observer is interested in.


Implementation
    public function get observedType():Class
phaseproperty 
phase:Phase  [read-only]

The phase of the object lifecycle that should trigger the observer.


Implementation
    public function get phase():Phase
Constructor Detail
DefaultLifecycleObserver()Constructor
public function DefaultLifecycleObserver(provider:ObjectProvider, method:String, phase:Phase = null, objectId:String = null, explicitType:ClassInfo = null)

Creates a new instance. The target method must have a single parameter that matches the observed type.

Parameters
provider:ObjectProvider — the provider for the actual instance that contains the observer method
 
method:String — the name of the observer method
 
phase:Phase (default = null) — the phase of the object lifecycle that should trigger the observer
 
objectId:String (default = null) — the optional id of the object as registered in the Context
 
explicitType:ClassInfo (default = null) — the type of object to observe
Method Detail
observe()method
public function observe(observed:Object):void

Invoked when any matching object reaches the specified phase in its lifecycle.

Parameters

observed:Object — the observerd instance