Base Application¶
-
class
dxlbootstrap.app.
Application
(config_dir, app_config_file_name)¶ Base class used for DXL applications.
Constructs the application
Parameters: - config_dir -- The directory containing the application configuration files
- app_config_file_name -- The name of the application-specific configuration file
-
add_event_callback
(topic, callback, separate_thread)¶ Adds a DXL event message callback to the application.
Parameters: - topic -- The topic to associate with the callback
- callback -- The event callback
- separate_thread -- Whether to invoke the callback on a thread other than the incoming message thread (this is necessary if synchronous requests are made via DXL in this callback).
-
add_request_callback
(service, topic, callback, separate_thread)¶ Adds a DXL request message callback to the application.
Parameters: - service -- The service to associate the request callback with
- topic -- The topic to associate with the callback
- callback -- The request callback
- separate_thread -- Whether to invoke the callback on a thread other than the incoming message thread (this is necessary if synchronous requests are made via DXL in this callback).
-
destroy
()¶ Destroys the application (disconnects from fabric, frees resources, etc.)
-
on_dxl_connect
()¶ Invoked after the client associated with the application has connected to the DXL fabric.
-
on_load_configuration
(config)¶ Invoked after the application-specific configuration has been loaded
Parameters: config -- The application-specific configuration
-
on_register_event_handlers
()¶ Invoked when event handlers should be registered with the application
-
on_register_services
()¶ Invoked when services should be registered with the application
-
on_run
()¶ Invoked when the application has started running.
-
register_service
(service)¶ Registers the specified service with the fabric
Parameters: service -- The service to register with the fabric
-
run
()¶ Runs the application