Packageorg.spicefactory.parsley.core.state.manager
Interfacepublic interface GlobalDomainManager
Implementors DefaultGlobalDomainManager

Manages the ApplicationDomain instances associated with all currently active Context instances. If an ApplicationDomain is no longer in use after the last Context associated with it gets destroyed, the reflection cache for that domain can be purged.

This manager is usually only exposed to the IOC kernel services and can be accessed through a BootstrapInfo instance.



Public Methods
 MethodDefined By
  
addPurgeHandler(domain:ApplicationDomain, handler:Function, ... params):void
Adds a handler to be invoked when an ApplicationDomain is no longer used by any Context.
GlobalDomainManager
  
putIfAbsent(key:Object, domain:ApplicationDomain):ApplicationDomain
Adds the specified domain if there is no existing domain instance for the same key.
GlobalDomainManager
Method Detail
addPurgeHandler()method
public function addPurgeHandler(domain:ApplicationDomain, handler:Function, ... params):void

Adds a handler to be invoked when an ApplicationDomain is no longer used by any Context.

Parameters

domain:ApplicationDomain — the domain to watch
 
handler:Function — the function to invoke in case the domain is no longer in use
 
... params — any parameters that should be passed to the handler in addition to the domain itself

putIfAbsent()method 
public function putIfAbsent(key:Object, domain:ApplicationDomain):ApplicationDomain

Adds the specified domain if there is no existing domain instance for the same key. The returned domain will either be the one from an existing mapping or the one passed to this method if no mapping existed yet. This helps optimizing domain usage in the framework. If multiple Contexts get created in the same ApplicationDomain it helps keep the reflection cache small if the same ApplicationDomain instance is used then. This is not easy to accomplish as all Flex SDK methods like ApplicationDomain.currentDomain always return a new instance even if it points to the same domain.

This method is primarily intended to be used by ApplicationDomainProvider implementations.

Parameters

key:Object — the key to register the ApplicationDomain with
 
domain:ApplicationDomain — the domain to add

Returns
ApplicationDomain — either the ApplicationDomain from an existing mapping or the one passed to this method if no mapping existed yet