Packagesekati.core
Classpublic class Bootstrap
InheritanceBootstrap Inheritance flash.events.EventDispatcher

Bootstrap provides a common bootstrapping command & load sequencer used to initialize API based applications.

Bootstrap is one of the three core components comprising the base API; along side sekati.display.Document (which instatiates Bootstrap) and sekati.core.App (which stores the data that Bootstrap loads).

By default Bootstrap loads a core configuration XML file, a data XML file, a CSS stylesheet & a Crossdomain Policy File; storing configuration settings and data in sekati.core.App. for later storage & retrieval. The XML data, CSS stylesheet & crossdomain policy locations, as well as other API settings, are defined in the core configuration XML file.

Each step in the Bootstrap sequence fires a "staging" BootstrapEvent to notify the application of its "boot phase". If any boot phase in the sequenceChain fails its execution it will be retried until the RETRY_MAX limit has been exceeded at which point a the BootstrapEvent.APP_FAIL event will be dispatched to notify the application of boot failure.

Customizations may be made by extending and overriding the Bootstrap methods and sequenceChain.

See also

sekati.core.App
sekati.display.Document
sekati.events.BootstrapEvent


Protected Properties
 PropertyDefined by
  RETRY_ATTEMPT : uint = 0
[static] The RETRY_ATTEMPT tracks bootstrap rety attempts.
Bootstrap
  RETRY_MAX : uint
[static] RETRY_MAX maximum retries before Bootstrap errors out.
Bootstrap
  sequenceChain : Array
[static] The sequenceChain defines a set of method references which are executed in sequence to prepare the API framework core.
Bootstrap
  sequenceCount : uint = 0
[static] The sequenceCount bootstrap stage counter.
Bootstrap
Public Methods
 MethodDefined by
  
Bootstrap(maxRetryAttempts:uint = 5)
Bootstrap Constructor
Bootstrap
Protected Methods
 MethodDefined by
  
loadConfig():void
Loads & parse config.xml to App.config & dispatch BootstrapEvent.APP_CONFIG.
Bootstrap
  
loadData():void
Loads & parse data from App.DATA_URI provided in config.xml.
Bootstrap
  
loadStyle():void
Loads & parse the stylesheet from App.CSS_URI provided in config.xml.
Bootstrap
  
retry():void
A method in the sequence chain failed - make retry attempts at each phase or dispatch the BootstrapEvent.APP_FAILURE event.
Bootstrap
  
run():void
Iterate through the sequenceChain method & fire the BootstrapEvent.APP_INIT event on completion.
Bootstrap
Property detail
RETRY_ATTEMPTproperty
protected static var RETRY_ATTEMPT:uint = 0

The RETRY_ATTEMPT tracks bootstrap rety attempts.

RETRY_MAXproperty 
protected static var RETRY_MAX:uint

RETRY_MAX maximum retries before Bootstrap errors out.

sequenceChainproperty 
protected static var sequenceChain:Array

The sequenceChain defines a set of method references which are executed in sequence to prepare the API framework core.

sequenceCountproperty 
protected static var sequenceCount:uint = 0

The sequenceCount bootstrap stage counter.

Constructor detail
Bootstrap()constructor
public function Bootstrap(maxRetryAttempts:uint = 5)

Bootstrap Constructor

Parameters
maxRetryAttempts:uint (default = 5) — Number of times to retry each method in bootstrap before fatal error.
Method detail
loadConfig()method
protected function loadConfig():void

Loads & parse config.xml to App.config & dispatch BootstrapEvent.APP_CONFIG.

loadData()method 
protected function loadData():void

Loads & parse data from App.DATA_URI provided in config.xml. Store it in App.db.data & dispatch BootstrapEvent.APP_DATA.

loadStyle()method 
protected function loadStyle():void

Loads & parse the stylesheet from App.CSS_URI provided in config.xml. Store it in App.css & dispatch BootstrapEvent.APP_STYLE.


Example
   tf.styleSheet = App.css;
   tf.htmlText = "Hello World";
   

retry()method 
protected function retry():void

A method in the sequence chain failed - make retry attempts at each phase or dispatch the BootstrapEvent.APP_FAILURE event.


Throws
— if RETRY_MAX is reached.
run()method 
protected function run():void

Iterate through the sequenceChain method & fire the BootstrapEvent.APP_INIT event on completion.

See also