| Package | potomac.bundle |
| Class | public class BundleService |
| Inheritance | BundleService flash.events.EventDispatcher |
| Implements | IBundleService |
| Property | Defined By | ||
|---|---|---|---|
| airBundlesURL : String
The remote URL where the bundles will be downloaded when running inside AIR. | BundleService | ||
| airDisableCaching : Boolean = true
If true, bundle caching in the local storage when running in AIR will be disabled. | BundleService | ||
| bundleDescriptors : Array [read-only]
Returns an array of BundleDescriptors for all installed bundles. | BundleService | ||
| enablesForFlags : Array
An array of Strings determine which extensions are enabled or disabled based on the
'enablesFor' attribute in each extension. | BundleService | ||
| Method | Defined By | ||
|---|---|---|---|
Callers should not construct instances of BundleService. | BundleService | ||
getBundleDescriptor(bundleID:String):BundleDescriptor
Returns the BundleDescriptor of the installed bundle with the given id. | BundleService | ||
getExtension(id:String, point:String):Extension
Returns a single Extension with the given id for the given extension point. | BundleService | ||
getExtensionPoint(pointID:String):ExtensionPoint
Returns the extension point with the given point id. | BundleService | ||
getExtensionPoints():Array
Returns an array of ExtensionPoint objects including
each extension point in all installed bundles. | BundleService | ||
getExtensions(extensionPointID:String, className:String = null, superClasses:Boolean = false):Array
Returns an array of Extensions of the specified extension point. | BundleService | ||
install(installables:Array):void
Triggers the installation of one or more bundles. | BundleService | ||
isBundleLoaded(bundleID:String):Boolean
Returns true if the given bundle is loaded. | BundleService | ||
loadBundle(id:String):void
Triggers the retrieval and load of the given bundle. | BundleService | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when an error is encountered during bundle installation or loading. | BundleService | |||
| Dispatched when a bundle starts loading. | BundleService | |||
| Dispatched when a bundle file (either the assets.swf or the bundle.swf) is being downloaded. | BundleService | |||
| Dispatched when a bundle is loaded. | BundleService | |||
| Dispatched when a set of bundles is installed. | BundleService | |||
| Dispatched when a bundle installation is initiated. | BundleService | |||
| Dispatched when bundle preloading is initiated. | BundleService | |||
| Dispatched when one or more extensions are added or removed from the extension registry. | BundleService | |||
| airBundlesURL | property |
airBundlesURL:StringThe remote URL where the bundles will be downloaded when running inside AIR.
public function get airBundlesURL():String public function set airBundlesURL(value:String):void| airDisableCaching | property |
public var airDisableCaching:Boolean = trueIf true, bundle caching in the local storage when running in AIR will be disabled.
| bundleDescriptors | property |
bundleDescriptors:Array [read-only] Returns an array of BundleDescriptors for all installed bundles.
This method should not be called while bundles are currently installing.
public function get bundleDescriptors():Array| enablesForFlags | property |
enablesForFlags:ArrayAn array of Strings determine which extensions are enabled or disabled based on the 'enablesFor' attribute in each extension.
public function get enablesForFlags():Array public function set enablesForFlags(value:Array):void| BundleService | () | Constructor |
public function BundleService()
Callers should not construct instances of BundleService. It is available for
injection through IBundleService.
| getBundleDescriptor | () | method |
public function getBundleDescriptor(bundleID:String):BundleDescriptorReturns the BundleDescriptor of the installed bundle with the given id.
This method should not be called while bundles are currently installing.
Parameters
bundleID:String — Bundle ID of the bundle whose descriptor is requested.
|
BundleDescriptor — BundleDescriptor or null of no bundle is found with the given id.
|
| getExtension | () | method |
public function getExtension(id:String, point:String):Extension
Returns a single Extension with the given id for the given extension point.
Parameters
id:String — extension id.
| |
point:String — extension point id.
|
Extension — the first matching Extension or null if none exists.
|
| getExtensionPoint | () | method |
public function getExtensionPoint(pointID:String):ExtensionPointReturns the extension point with the given point id.
Parameters
pointID:String — id/tag name of the extension point.
|
ExtensionPoint — the ExtensionPoint
|
| getExtensionPoints | () | method |
public function getExtensionPoints():ArrayReturns an array of ExtensionPoint objects including each extension point in all installed bundles.
ReturnsArray — array of ExtensionPoints
|
| getExtensions | () | method |
public function getExtensions(extensionPointID:String, className:String = null, superClasses:Boolean = false):Array
Returns an array of Extensions of the specified extension point. If the
className parameter is passed, it will return only those extensions declared within that
class.
By default, when the className parameter is specified, only extensions declared directly within
the specific class are returned. Extensions declared in the base class or super classes of the
specified class are not returned. When true is passed for the superClass argument,
all extensions declared in the entire class hierarchy are returned. Importantly, for Potomac to
be able to inspect the class hierarchy, the class specified must be available in the Flash
ApplicationDomain. In other words, the class's bundle must be loaded.
Parameters
extensionPointID:String — extension point id of the extensions to return.
| |
className:String (default = null) — name of the class in which the extensions are declared.
| |
superClasses:Boolean (default = false) — if true, will return extensions declared in super classes.
|
Array — an array of Extensions.
|
| install | () | method |
public function install(installables:Array):void
Triggers the installation of one or more bundles. This method is asynchronous. When the
installation is complete a bundlesInstalled event will be dispatched.
This method accepts an array that may contain Strings that contain just the simple
bundle ID or BundleInstallDescriptors if you need to provide more options.
Parameters
installables:Array — An array of bundle IDs as Strings or
descriptors (BundleInstallDescriptors).
|
| isBundleLoaded | () | method |
public function isBundleLoaded(bundleID:String):BooleanReturns true if the given bundle is loaded.
Parameters
bundleID:String — bundle id to check if loaded.
|
Boolean — true if the bundle is loaded, otherwise false.
|
| loadBundle | () | method |
public function loadBundle(id:String):void
Triggers the retrieval and load of the given bundle. This method is asynchronous. A
bundleReady event will be dispatched when the bundle is loaded.
Parameters
id:String — id of bundle to load.
|
| bundleError | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLE_ERRORDispatched when an error is encountered during bundle installation or loading.
The BundleEvent.BUNDLE_ERROR constant defines the value of thetype property of the event object
for a bundleError event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | The id of the bundle this error event is associated with. |
isRepeat | false |
url | null |
bytesLoaded | 0 |
bytesTotal | 0 |
message | The error message. |
| bundleLoading | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLE_LOADINGDispatched when a bundle starts loading.
The BundleEvent.BUNDLE_LOADING constant defines the value of thetype property of the event object
for a bundleLoading event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | The id of the bundle that is now loading. |
isRepeat | false |
url | URL of the bundle SWF. |
bytesLoaded | 0 |
bytesTotal | 0 |
message | null |
| bundleProgress | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLE_PROGRESSDispatched when a bundle file (either the assets.swf or the bundle.swf) is being downloaded.
The BundleEvent.BUNDLE_PROGRESS constant defines the value of thetype property of the event object
for a bundleProgress event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | The id of the bundle this progress event is associated with. |
isRepeat | false |
url | URL of the asset or SWF being downloaded. |
bytesLoaded | The current bytes loaded. |
bytesTotal | Total bytes of downloading asset or SWF. |
message | null |
| bundleReady | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLE_READY
Dispatched when a bundle is loaded.
If the isRepeat property is true,
this event is repeated bundle ready event and can be ignored.
type property of the event object
for a bundleReady event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | The id of the loaded bundle. |
isRepeat | True if this is a repeated ready event. |
url | null |
bytesLoaded | 0 |
bytesTotal | 0 |
message | null |
| bundlesInstalled | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLES_INSTALLEDDispatched when a set of bundles is installed.
The BundleEvent.BUNDLES_INSTALLED constant defines the value of thetype property of the event object
for a bundlesInstalled event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | null |
isRepeat | false |
url | null |
bytesLoaded | 0 |
bytesTotal | 0 |
message | null |
| bundlesInstalling | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLES_INSTALLINGDispatched when a bundle installation is initiated.
The BundleEvent.BUNDLES_INSTALLING constant defines the value of thetype property of the event object
for a bundlesInstalling event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | null |
isRepeat | false |
url | null |
bytesLoaded | 0 |
bytesTotal | 0 |
message | null |
| bundlesPreloading | Event |
potomac.bundle.BundleEventpotomac.bundle.BundleEvent.BUNDLES_PRELOADINGDispatched when bundle preloading is initiated.
The BundleEvent.BUNDLES_PRELOADING constant defines the value of thetype property of the event object
for a bundlesPreloading event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
bundleID | null |
isRepeat | false |
url | null |
bytesLoaded | 0 |
bytesTotal | 0 |
message | null |
| extensionsUpdated | Event |
potomac.bundle.ExtensionEventpotomac.bundle.ExtensionEvent.EXTENSIONS_UPDATEDDispatched when one or more extensions are added or removed from the extension registry.
The ExtensionEvent.EXTENSIONS_UPDATED constant defines the value of thetype property of the event object
for a extensionsUpdated event.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
extensionsAdded | Array of Extensions added to the registry. |
extensionsRemoved | Array of Extensions removed from the registry. |