Packageorg.spicefactory.parsley.core.context.provider
Classpublic class Provider
InheritanceProvider Inheritance Object

Static utility method to create an ObjectProvider for an existing instance.



Public Methods
 MethodDefined By
  
[static] Creates an ObjectProvider for a singleton definition.
Provider
  
forInstance(instance:Object, domain:ApplicationDomain = null):ObjectProvider
[static] Creates an ObjectProvider for an existing instance, simply wrapping it.
Provider
Method Detail
forDefinition()method
public static function forDefinition(definition:SingletonObjectDefinition):ObjectProvider

Creates an ObjectProvider for a singleton definition.

Parameters

definition:SingletonObjectDefinition — the definition for the object to create a provider for

Returns
ObjectProvider — a new ObjectProvider for the specified singleton definition
forInstance()method 
public static function forInstance(instance:Object, domain:ApplicationDomain = null):ObjectProvider

Creates an ObjectProvider for an existing instance, simply wrapping it. Useful if existing instances must be passed to a method that expects an ObjectProvider instance as a parameter, like most of the methods for registering message receivers for example.

This utility method should only be used in cases where ObjectDefinition.objectLifecycle.synchronizeProvider cannot be used, since it does not take care of any synchronization issues for singletons that get created upon container initialization.

Parameters

instance:Object — the instance to wrap
 
domain:ApplicationDomain (default = null) — the ApplicationDomain to use for reflecting on the instance

Returns
ObjectProvider — a new ObjectProvider wrapping the specified instance