Constructor
new Application(configDir, appConfigFileName)
Parameters:
Name | Type | Description |
---|---|---|
configDir |
String | The directory containing the application configuration files. |
appConfigFileName |
String | The name of the application-specific configuration file. |
- Source:
Methods
destroy(callbackopt)
Destroys the application (disconnects from fabric, frees resources, etc.)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callback |
function |
<optional> |
null | An optional callback that will be invoked after the application has been destroyed. |
- Source:
onDxlConnect()
Invoked after the client associated with the application has connected to the DXL fabric.
- Source:
onLoadConfiguration(config)
Invoked after the application-specific configuration has been loaded
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | The application-specific configuration, as an object parsed from the application-configuration file. For example, the configuration file could have the following content on disk:
The application could then reference the
|
- Source:
onRegisterEventHandlers()
Invoked when event handlers should be registered with the application.
- Source:
onRegisterServices()
Invoked when services should be registered with the application.
- Source:
onRun()
Invoked when the application has started running.
- Source:
registerServiceAsync(service, callbackopt)
Registers the specified service with the fabric.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
service |
external:ServiceRegistrationInfo | The service to register with the fabric |
||
callback |
function |
<optional> |
null | An optional callback that will be invoked when the registration attempt is complete. If an error occurs during the registration attempt, the first parameter supplied to the callback contains an Error with failure details. |
- Source:
run(callbackopt)
Runs the application.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callback |
function |
<optional> |
null | An optional callback that will be invoked after the application has started running. The callback would be invoked after the DXL client has been connected to the fabric and calls to register services have been made. |
- Source: