Packageorg.spicefactory.parsley.core.lifecycle
Interfacepublic interface ManagedObject

Represents a single managed object, the actual instance alongside with its definition and associated Context.



Public Properties
 PropertyDefined By
  context : Context
[read-only] The Context that managed this object.
ManagedObject
  definition : ObjectDefinition
[read-only] The definition the object was created from or the definition that was applied to an existing instance.
ManagedObject
  instance : Object
[read-only] The actual managed instance.
ManagedObject
Public Methods
 MethodDefined By
  
Resolves the reference to the object with the specified definition, potentially synchronizing its lifecycle to the lifecycle of this managed object in case the definition is a DynamicObjectDefinition.
ManagedObject
  
resolveValue(value:*):*
Resolves the specified value from the perspective of this managed object.
ManagedObject
Property Detail
contextproperty
context:Context  [read-only]

The Context that managed this object.


Implementation
    public function get context():Context
definitionproperty 
definition:ObjectDefinition  [read-only]

The definition the object was created from or the definition that was applied to an existing instance.


Implementation
    public function get definition():ObjectDefinition
instanceproperty 
instance:Object  [read-only]

The actual managed instance.


Implementation
    public function get instance():Object
Method Detail
resolveObjectReference()method
public function resolveObjectReference(definition:ObjectDefinition):Object

Resolves the reference to the object with the specified definition, potentially synchronizing its lifecycle to the lifecycle of this managed object in case the definition is a DynamicObjectDefinition.

Parameters

definition:ObjectDefinition — the definition to resolve

Returns
Object — the resolved object
resolveValue()method 
public function resolveValue(value:*):*

Resolves the specified value from the perspective of this managed object. This means that object references are fetched from the context this object belongs to and also that any reference that points to a dynamic object definition will automatically get its lifecycle synchronized with this object. The result is that the reference will be removed from the Context as soon as the object represented by this ManagedObject instance will be removed. If the reference points to a singleton object definition then the object is managed by the Context until the Context gets destroyed.

This method is primarily used for values to be injected into this object.

Parameters

value:* — the value to resolve

Returns
* — the resolved value