Class JavaScriptBridge
Object
|
+--JavaScriptBridge
- class
JavaScriptBridge
ActionScript bridge class that communicates with the corresponding
JavaScript side within the hosting page. Used to bind the HTML object
containing the Flash movie to the LightstreamerClient instance defined in the page in order to dispatch updates to
Flash-side subscribed Tables.
Defined in lsjavascriptbridge.as
Constructor Summary |
JavaScriptBridge
(<String> objName)
Bridge object used to enable communication with a page running Lightstreamer Web
Client Library.
|
Method Summary |
void
|
addTable(<FlashTable> table,<String> tableSubId)
Operation method that adds a data table to the "running" tables set, by bringing it to the "running"
state and associating it to a unique identifier (Note that the identifier is unique related to the
underlying LightstreamerClient instance, not to the Flash movie).
|
void
|
bind()
Initialization method that binds a JavaScriptBridge instance with the Flash movie.
|
void
|
onReady()
Event handler that is called when the binding between this JavaScriptBridge
instance and the related "FlashBridge" instance on the hosting page is completed.
|
void
|
onStatusChange(<String> newStatus)
Event handler that receives a notification each time the status of the underlying LightstreamerClient has changed.
|
void
|
removeTable(<String> tableSubId)
Operation method that removes a data table that is currently in the
"running" tables set and is associated with a supplied identifier,
if any, by bringing it back to the "inactive" state.
|
JavaScriptBridge
JavaScriptBridge(<String> objName)
Bridge object used to enable communication with a page running Lightstreamer Web
Client Library. This object enables the Flash movie to receive data through a
LightstreamerClient instance defined in the page.
Parameters:
objName
- A string equals to the id attribute of the object tag, containing the movie, and equals to the name attribute of the embed tag of the same movie. This name must be passed to a "FlashBridge" object constructor on the JavaScript Library side.
addTable
void addTable(<FlashTable> table,<String> tableSubId)
Operation method that adds a data table to the "running" tables set, by bringing it to the "running"
state and associating it to a unique identifier (Note that the identifier is unique related to the
underlying LightstreamerClient instance, not to the Flash movie). The data table cannot already be in the "running" state.
If a different data table is currently in the "running" set with the same identifier, it is removed first;
so, the method can also be used to substitute a "running" data table with a new one.
By bringing a table to the "running" state, the subscription to all its items is requested to Lightstreamer
Server through the underlying LightstreamerClient instance.
Lifecycle: Data tables can be added to the JavaScriptBridge at any time. However tables will be passed
to the underlying LightstreamerClient instance only after the onReady() event has been fired.
Once added, a Table instance cannot be added again to the JavaScriptBridge. However, after being removed
through removeTable(), the instance can be added again.
Parameters:
table
- A FlashTable object, carrying the data table description and all the information needed to process its pushed values.
tableSubId
- An identifier to associate to the "running" table.
bind
void bind()
Initialization method that binds a JavaScriptBridge instance with the Flash movie.
It should be called after all initialization settings on the Flash movie have been performed,
in order to enable the movie to notify itself to the JavaScript Library in the hosting page.
onReady
void onReady()
Event handler that is called when the binding between this JavaScriptBridge
instance and the related "FlashBridge" instance on the hosting page is completed.
Default implementation: do nothing.
onStatusChange
void onStatusChange(<String> newStatus)
Event handler that receives a notification each time the status of the underlying LightstreamerClient has changed.
By setting a custom handler it is possible to perform actions related to connection and disconnection
occurrences.
Default implementation: do nothing.
Parameters:
newStatus
- The new status. See the corresponding "onStatusChange" callback for the "ClientListener" class of the JavaScript Client Library for details on the possible outcomes.
removeTable
void removeTable(<String> tableSubId)
Operation method that removes a data table that is currently in the
"running" tables set and is associated with a supplied identifier,
if any, by bringing it back to the "inactive" state.
By bringing back a table to the "inactive" state, the unsubscription
from all its items is requested to Lightstreamer Server through the underlying LightstreamerClient instance.
Moreover, all the received contents of the data table are discarded.
Lifecycle: Data tables, once added, can be removed from
the JavaScriptBridge at any time.
Parameters:
tableSubId
- The identifier previously associated through addTable() to the FlashTable instance to be removed.
Lightstreamer Flash Client
Documentation generated by
JSDoc on Wed Dec 6 11:31:34 2017