8 Star 0 Fork 44

OpenHarmony/bundlemanager_distributed_bundle_framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README_zh.md 3.17 KB
一键复制 编辑 原始数据 按行查看 历史

分布式包管理服务(DBMS)

简介

分布式包管理服务负责管理跨设备的组件调度和任务管理,实现跨设备RPC的能力,可以按需获取跨设备指定语言的资源。

目录

foundation/bundlemanager/distributed_bundle_framework
├── interfaces
│   ├── inner_api                 # 内部接口存放目录
│   └── kits/js                   # JS应用接口
│       ├── distributebundlemgr        
│       └── distributedBundle          
├── services/dbms                 # dbms服务框架代码
└── services/dbms/test	          # 测试目录

说明

获取远程设备AbilityInfo信息

getRemoteAbilityInfo获取由elementName指定的远程设备上的应用的AbilityInfo信息(callback形式)

  • 参数:

    参数名 类型 必填 说明
    elementName ElementName ElementName信息。
    callback AsyncCallback<RemoteAbilityInfo> 回调函数,调用成功返回err为null,data为RemoteAbilityInfo对象;调用失败err为错误对象, data为undefined。
  • 错误码:

    以下错误码的详细介绍请参见ohos.bundle错误码

    错误码ID 错误信息
    17700001 The specified bundle name is not found.
    17700003 The specified ability name is not found.
    17700007 The specified device ID is not found.
    17700027 The distributed service is not running.
  • 示例:

  try {
      distributedBundle.getRemoteAbilityInfo(
          {
              deviceId: '1',
              bundleName: 'com.example.application',
              abilityName: 'EntryAbility'
          }, (err, data) => {
            if (err) {
              console.log(`Operation failed: error code is ${err.code}  and error message is ${err.message}`);
            } else {
              console.info('Operation succeed:' + JSON.stringify(data));
            }
          });
  } catch (err) {
      console.log(`Operation failed: error code is ${err.code}  and error message is ${err.message}`);
  }

相关仓

bundlemanager_bundle_framework

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

搜索帮助