1 Star 0 Fork 5.4K

ohos / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
multi-hap-principles.md 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
ester.zhou 提交于 2023-01-10 17:56 . Add docs (12811)

Multi-HAP Operation Mechanism and Data Communication Modes

The multi-HAP mechanism is used to facilitate modular management for developers. There is no one-to-one mapping between the HAP and the running process of the application. The detailed running mechanism is as follows:

  • By default, all UIAbility, ServiceExtensionAbility, and DataShareExtensionAbility components of an application (with the same bundle name) run in the same independent process, and other ExtensionAbility components of the same type run in separate processes.

  • The HAP file supports the process configuration through the process tag in the module.json5 (stage model) or config.json (FA model) file. This feature is supported only by system applications. If process is configured for an HAP file, all components of the HAP file run in an independent process. Multiple HAP files can be configured with the same process, in which case the HAP files run in the same process. For details about the process configuration, see module.json5 Configuration File.

  • When an application is running, the resources and code of the corresponding HAP file are loaded only when the UIAbility component in the same process is started.

Based on the preceding mechanism, the multi-HAP data communication modes are as follows:

  • For details about data communication in the same process, see Thread Model (Stage Model).

  • For details about cross-process data communication, see Process Model (Stage Model).

  • If multiple HAPs run in the same process, the communication mode between the components of multiple HAP files is the same as that between the components of the same HAP file.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yeyinglong/docs.git
git@gitee.com:yeyinglong/docs.git
yeyinglong
docs
docs
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891