Packageorg.spicefactory.parsley.core.scope.impl
Classpublic class DefaultScopeManager
InheritanceDefaultScopeManager Inheritance Object
Implements ScopeManager, InitializingService

Default implementation of the ScopeManager interface.



Public Methods
 MethodDefined By
  
dispatchMessage(message:Object, selector:*):void
Dispatches a message through all scopes managed by this instance.
DefaultScopeManager
  
getAllScopes():Array
Returns all scope instances managed by this instance.
DefaultScopeManager
  
getScope(name:String = null):Scope
Returns the scope instance for the specified scope name.
DefaultScopeManager
  
hasScope(name:String):Boolean
Indicates whether this manager contains a scope with the specified name.
DefaultScopeManager
  
init(info:BootstrapInfo):void
Invoked once after the service has been instantiated.
DefaultScopeManager
  
Observes the specified command and dispatches messages to registered observers of all scopes managed by this instance when the state of the command changes.
DefaultScopeManager
Protected Methods
 MethodDefined By
  
addScope(scopeInfo:ScopeInfo, info:BootstrapInfo):void
Adds the specified scope to the active scopes of this manager.
DefaultScopeManager
  
Creates all scopes managed by this instance.
DefaultScopeManager
Method Detail
addScope()method
protected function addScope(scopeInfo:ScopeInfo, info:BootstrapInfo):void

Adds the specified scope to the active scopes of this manager.

Parameters

scopeInfo:ScopeInfo — the scope to add to this manager
 
info:BootstrapInfo — the environment of the Context building process

dispatchMessage()method 
public function dispatchMessage(message:Object, selector:*):void

Dispatches a message through all scopes managed by this instance. In many cases you'll want to dispatch application messages through all scopes so that the receiving side can decide which scope it wants to listen for.

Parameters

message:Object — the message to dispatch
 
selector:* (default = NaN) — the selector to use if it cannot be determined from the message instance itself

getAllScopes()method 
public function getAllScopes():Array

Returns all scope instances managed by this instance.

Returns
Array — all scope instances managed by this instance
getScope()method 
public function getScope(name:String = null):Scope

Returns the scope instance for the specified scope name. If the scope name is omitted, the default receiver scope is returned.

Parameters

name:String (default = null) — the name of the scope to look for

Returns
Scope — the Scope instance for the specified name
hasScope()method 
public function hasScope(name:String):Boolean

Indicates whether this manager contains a scope with the specified name.

Parameters

name:String — the name of the scope to look for

Returns
Boolean — true if this manager contains a scope with the specified name
init()method 
public function init(info:BootstrapInfo):void

Invoked once after the service has been instantiated. The BootstrapInfo instance passed to this method gives access to the settings and collaborating services.

Parameters

info:BootstrapInfo — the environment of the Context building process

initScopes()method 
protected function initScopes(info:BootstrapInfo):void

Creates all scopes managed by this instance. The given BootstrapInfo instance provides information about all scopes inherited by parent Contexts and all new scope definitions added for this Context. The default implementation manages all these scopes and throws an error in case of finding more than one scope with the same name. This method can be overridden by custom ScopeManagers to allow fine-grained control which scopes should be inherited and/or created.

Parameters

info:BootstrapInfo — a BootstrapInfo instance providing information about all scopes inherited by parent Contexts and all new scope definitions added for this Context

observeCommand()method 
public function observeCommand(command:ObservableCommand):void

Observes the specified command and dispatches messages to registered observers of all scopes managed by this instance when the state of the command changes.

Parameters

command:ObservableCommand — the command to observe