Packageorg.spicefactory.parsley.lifecycle
Classpublic class Observe
InheritanceObserve Inheritance Object

API for defining methods that observe the lifecycle of a particular type of managed object.



Public Methods
 MethodDefined By
  
Applies this configuration to the specified definition builder.
Observe
  
forMethod(method:String):Observe
[static] Creates a new builder for an observer method.
Observe
  
objectId(id:String):Observe
Sets the (optional) id of the object the observer is interested in.
Observe
  
Sets the lifecycle phase this observer is interested in.
Observe
  
scope(name:String):Observe
Sets the name of the scope to observe.
Observe
Method Detail
apply()method
public function apply(builder:ObjectDefinitionBuilder):void

Applies this configuration to the specified definition builder.

Parameters

builder:ObjectDefinitionBuilder — the builder to apply this configuration to

forMethod()method 
public static function forMethod(method:String):Observe

Creates a new builder for an observer method.

Parameters

method:String — the method that receives the observed instance(s)

Returns
Observe — a new builder for an observer method
objectId()method 
public function objectId(id:String):Observe

Sets the (optional) id of the object the observer is interested in. When omitted all objects with a matching type deduced from the method parameter will be observed.

Parameters

id:String — the id of the object the observer is interested in

Returns
Observe — this builder for method chaining
phase()method 
public function phase(value:Phase):Observe

Sets the lifecycle phase this observer is interested in. The default is ObjectLifecycle.POST_INIT.

Parameters

value:Phase — the lifecycle phase this observer is interested in

Returns
Observe — this builder for method chaining
scope()method 
public function scope(name:String):Observe

Sets the name of the scope to observe. The default is ScopeName.GLOBAL. Only matching objects created in the target scope will be considered for invocation of the observer method.

Parameters

name:String — the name of the scope to observe

Returns
Observe — this builder for method chaining