Package | sekati.core |
Class | public class Bootstrap |
Inheritance | Bootstrap flash.events.EventDispatcher |
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
Property | Defined 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 |
Method | Defined by | ||
---|---|---|---|
Bootstrap(maxRetryAttempts:uint = 5)
Bootstrap Constructor
| Bootstrap |
Method | Defined 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 |
RETRY_ATTEMPT | property |
protected static var RETRY_ATTEMPT:uint = 0
The RETRY_ATTEMPT
tracks bootstrap rety attempts.
RETRY_MAX | property |
protected static var RETRY_MAX:uint
RETRY_MAX
maximum retries before Bootstrap errors out.
sequenceChain | property |
protected static var sequenceChain:Array
The sequenceChain
defines a set of method references which are executed in sequence to prepare the API framework core.
sequenceCount | property |
protected static var sequenceCount:uint = 0
The sequenceCount
bootstrap stage counter.
Bootstrap | () | constructor |
public function Bootstrap(maxRetryAttempts:uint = 5)
Bootstrap Constructor
ParametersmaxRetryAttempts:uint (default = 5 ) — Number of times to retry each method in bootstrap before fatal error.
|
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
.
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.
— 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