Package | org.spicefactory.parsley.core.context.provider |
Class | public class Provider |
Inheritance | Provider Object |
Method | Defined 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 |
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
|
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
|
ObjectProvider — a new ObjectProvider wrapping the specified instance
|