Namespace: RouterTransport

Router Transport

Service-Level Module. Manages and contains the point-to-point transports (i.e. Layer 2) supported by Finsemble. Each transport communicates betweew a Finsemble services or component (on one end) and the Finsemble router (on the other end).

The OpenFinBus transport is used for cross-domain components (where SharedWorker fails).

Requirements for adding a new transport: 1) create new transport object with same interface provided by SharedWorkerTransport and OpenFinTransport in this file. 2) call RouterTransport.addTransport() to make the transport available (see the bottom of this file)

Integration into routerService.js is automatic.

Methods

staticRouterTransport.addTransport
(transportName, transportConstructor)

common/routerTransport.js, line 41

Adds a new type of router transport to pass message between RouterClient and RouterService.

Name Type Description
transportName string

identifies the new transport

transportConstructor object

returns an instance of the new transport

staticRouterTransport.getActiveTransports
()

common/routerTransport.js, line 51

Gets array of active transports

Returns:
array transport names/identifier

staticRouterTransport.getDefaultTransport
(params, incomingMessageHandler, source, destination)

common/routerTransport.js, line 68

Get default transport for event router -- this is the most reliable transport across all contexts

Name Type Description
params object

parameters for transport

incomingMessageHandler any
source any
destination any
Returns:
the transport object

staticRouterTransport.getRecommendedTransport
(params, incomingMessageHandler, source, destination)

common/routerTransport.js, line 81

Get best client transport based on the run-time context. Will only return cross-domain transport if current context is inter-domain.

Name Type Description
params object

parameters for transport

incomingMessageHandler any
source any
destination any
Returns:
the transport object

staticRouterTransport.getTransport
(params, transportName, incomingMessageHandler, source, destination)

common/routerTransport.js, line 134

Get a specific transport by name. The transport must be in list of the active transports (i.e. previously added).

Name Type Description
params object

parameters for transport

transportName any
incomingMessageHandler any
source any
destination any
Returns:
the transport object