ApplicationServiceContextdepends on the environment that SanteDB is running within, they can be:
IConfigurationProviderservice instance and instructs it to load its configuration files. It also loads the dependency injection manager and any configured plugins in the configuration file (including validation of the services listed in the
IDaemonServiceimplementations and calls the
Start()method on those services. The daemon services are started in the order they appear in the configuration file.
ApplicationServiceContextwill fire the
Startedevent. Many plugins use this event to perform any last-minute binding or startup procedures. This is done because, by stage 3, the application host context has initialized its plugins and is, for all intents and purposes, running.
IDaemonServicesof its shutdown using the
Stop()method on the daemon. The daemons should perform any shutdown/stop procedures to remove themselves from the application domain context.
IDisposablewill have their
Dispose()method called. This allows any passie services to clean up unmanaged handles, and perform disposal of ports/bindings/etc.