Packageorg.spicefactory.parsley.core.scope
Interfacepublic interface ScopeExtensionRegistry
Implementors DefaultScopeExtensionRegistry

A registry for scope-wide extensions. Usually used for registering manager-type objects that may be used by custom configuration tags.



Public Methods
 MethodDefined By
  
forType(type:Class):Service
Returns the service registration for the specified type.
ScopeExtensionRegistry
  
getAll(status:LookupStatus = null):Dictionary
Returns all service registrations that were created in this registry.
ScopeExtensionRegistry
Method Detail
forType()method
public function forType(type:Class):Service

Returns the service registration for the specified type. If no such service has been registered yet, a new registration will be created. The returned registration can be used to specify the implementation class or just decorators for existing registrations. The type passed to this method is usually the service interface of the scope extension, so that alternative implementations can be registered. But this is not a requirement, the specified type may be the same as the implementation.

In a standard use case this method will get used like this:

BootstrapDefaults.config.scopeExtensions.forType(MyService).setImplementation(MyServiceImpl);

The above would mean that the service would be registered globally. Alternatively the BootstrapInfo for a particular Context may be used to register an extension just for one Context (and its children, if any).

Parameters

type:Class — the type of service, usually the service interface

Returns
Service — the service configuration which can be modified
getAll()method 
public function getAll(status:LookupStatus = null):Dictionary

Returns all service registrations that were created in this registry. The Dictionary will map the type (usually the service interface) to Service instances holding the full configuration for the service.

Parameters

status:LookupStatus (default = null) — optional paramater to avoid duplicate lookups, for internal use only

Returns
Dictionary — all service registrations that were created in this registry