| Package | com.developmentarc.framework.utils |
| Class | public class SingletonFactory |
| Inheritance | SingletonFactory InstanceFactory |
This class acts as a Singlton facade to the InstanceFactory Class.
| Property | Defined by | ||
|---|---|---|---|
| instance : SingletonFactory
[static][read-only]
Returns the current instance of the SingletonFactory.
| SingletonFactory | ||
![]() | instanceTable : HashTable
Stores the local instances for the factory.
| InstanceFactory | |
| lock : Class [static][read-only]
Enables extended Classes to access the lock.
| SingletonFactory | ||
| Method | Defined by | ||
|---|---|---|---|
![]() |
clearAllInstances():void
Used to remove all current instances from the Factory.
| InstanceFactory | |
|
clearAllSingletonInstances():void
[static]
Used to remove all current instances from the Factory.
| SingletonFactory | ||
![]() |
clearInstance(type:Class):void
Used to remove a specific instance type from the factory.
| InstanceFactory | |
|
clearSingletonInstance(type:Class):void
[static]
Used to remove a specific instance type from the factory.
| SingletonFactory | ||
![]() |
getInstance(type:Class):*
Used to get access to an instance of the Class type
requested.
| InstanceFactory | |
|
getSingletonInstance(type:Class):*
[static]
Used to get access to an instance of the Class type
requested.
| SingletonFactory | ||
| instance | property |
instance:SingletonFactory [read-only]Returns the current instance of the SingletonFactory.
Implementation protected static function get instance():SingletonFactory
| lock | property |
lock:Class [read-only]Enables extended Classes to access the lock.
Implementation protected static function get lock():Class
| clearAllSingletonInstances | () | method |
public static function clearAllSingletonInstances():voidUsed to remove all current instances from the Factory.
| clearSingletonInstance | () | method |
public static function clearSingletonInstance(type:Class):voidUsed to remove a specific instance type from the factory. This method checks to see if the requeted type has an intance in the table, and if so the instance is removed. This enables getInstance() to create a new instance the next time the method is called. If the instance type does not exist, nothing occurs.
Parameterstype:Class — The type of instance to look for and remove.
|
| getSingletonInstance | () | method |
public static function getSingletonInstance(type:Class):*Used to get access to an instance of the Class type requested. This method first determines if the Class type has been requested before. If the Class has never been requested, the method creates a new instance of the Class, stores it in a table and then returns a reference to the Class.
If the Class type has been requested previously, the method returns the previously generated instance.
Parameterstype:Class — The Class of the instance to return.
|
* — The generated instance of the Class.
|