package { public class Manager { /** * var to be used by the singleton pattern to return the instance of the class. */ private static var manager : Manager; /** * Internal constructor. Should not be called from outside this class. * * @param enforcer Enforce the creation of one class only. * */ public function Manager(enforcer:AccessRestriction) { // TODO: throw exception if ( enforcer == null ) { throw new Error("Manager error enforcer input param is undefined" ); } } /** * Method function to retrieve instance of the class * * @return The same instance of the class * */ public static function getInstance() : Manager { if( manager == null ) manager = new Manager(new AccessRestriction()); return manager } } } class AccessRestriction {}