Packageorg.springextensions.actionscript.ioc.factory
Interfacepublic interface IInstanceCache extends flash.events.IEventDispatcher
Implementors DefaultInstanceCache

Describes an object that acts as a cache for object instances.



Public Methods
 MethodDefined By
  
clearCache():void
Removes all the instances from the cache.
IInstanceCache
  
getCachedNames():Vector.<String>
Returns a Vector.<String> of all the names of the cached objects in the current IInstanceCache.
IInstanceCache
  
getInstance(name:String):*
Returns the instance that was associated with the specified name.
IInstanceCache
  
getPreparedInstance(name:String):*
Returns the prepared instance that was associated with the specified name.
IInstanceCache
  
hasInstance(name:String):Boolean
Returns true if an instance has been associated with the specified name
IInstanceCache
  
isPrepared(name:String):Boolean
IInstanceCache
  
Returns the number of instances that have been added to the cache.
IInstanceCache
  
prepareInstance(name:String, instance:*):void
IInstanceCache
  
putInstance(name:String, instance:*):void
Adds the specified instance using the specified name.
IInstanceCache
  
removeInstance(name:String):*
Removes the instance that was associated with the specified name.
IInstanceCache
Method Detail
clearCache()method
public function clearCache():void

Removes all the instances from the cache.

getCachedNames()method 
public function getCachedNames():Vector.<String>

Returns a Vector.<String> of all the names of the cached objects in the current IInstanceCache.

Returns
Vector.<String>
getInstance()method 
public function getInstance(name:String):*

Returns the instance that was associated with the specified name.

Parameters

name:String — The specified name

Returns
* — The instance associated with the specified name

Throws
ObjectDefinitionNotFoundError — Thrown when an object with the specified name does not exist
getPreparedInstance()method 
public function getPreparedInstance(name:String):*

Returns the prepared instance that was associated with the specified name.

Parameters

name:String — The specified name

Returns
* — The prepared instance associated with the specified name

Throws
ObjectDefinitionNotFoundError — Thrown when a prepared object with the specified name does not exist
hasInstance()method 
public function hasInstance(name:String):Boolean

Returns true if an instance has been associated with the specified name

Parameters

name:String — The specified name

Returns
Booleantrue if an instance has been associated with the specified name
isPrepared()method 
public function isPrepared(name:String):Boolean

Parameters

name:String

Returns
Boolean
numInstances()method 
public function numInstances():uint

Returns the number of instances that have been added to the cache.

Returns
uint — The number of instances that have been added to the cache.
prepareInstance()method 
public function prepareInstance(name:String, instance:*):void

Parameters

name:String
 
instance:*

putInstance()method 
public function putInstance(name:String, instance:*):void

Adds the specified instance using the specified name.

Parameters

name:String — The specified name
 
instance:* — The specified instance

See also

removeInstance()method 
public function removeInstance(name:String):*

Removes the instance that was associated with the specified name.

Parameters

name:String — The specified name

Returns
*