当前位置: 首页 > news >正文

小语种网站建设越秀区手机版网站建设

小语种网站建设,越秀区手机版网站建设,现代农业园网站建设方案,wordpress处理大数据简介 samgr组件是OpenHarmony的核心组件#xff0c;提供OpenHarmony系统服务启动、注册、查询等功能。 系统架构 图 1 系统服务管理系统架构图 目录 /foundation/systemabilitymgr ├── samgr │ ├── bundle.json # 部件描述及编译文件 │ ├── frameworks …简介 samgr组件是OpenHarmony的核心组件提供OpenHarmony系统服务启动、注册、查询等功能。 系统架构 图 1 系统服务管理系统架构图 目录 /foundation/systemabilitymgr ├── samgr │ ├── bundle.json # 部件描述及编译文件 │ ├── frameworks # 框架实现存在目录 │ ├── interfaces # 接口目录 │ ├── services # 组件服务端目录 │ ├── test # 测试代码存放目录 │ ├── utils # 工具类目录说明 samgr服务接收到sa框架层发送的注册消息会在本地缓存中存入系统服务相关信息。 int32_t SystemAbilityManager::AddSystemAbility(int32_t systemAbilityId, const sptrIRemoteObject ability,const SAExtraProp extraProp) {if (!CheckInputSysAbilityId(systemAbilityId) || ability nullptr) {HILOGE(AddSystemAbilityExtra input params is invalid.);return ERR_INVALID_VALUE;}{unique_lockshared_mutex writeLock(abilityMapLock_);auto saSize abilityMap_.size();if (saSize MAX_SERVICES) {HILOGE(map size error, (Has been greater than %zu), saSize);return ERR_INVALID_VALUE;}SAInfo saInfo;saInfo.remoteObj ability;saInfo.isDistributed extraProp.isDistributed;saInfo.capability extraProp.capability;saInfo.permission Str16ToStr8(extraProp.permission);abilityMap_[systemAbilityId] std::move(saInfo);HILOGI(insert %{public}d. size : %{public}zu, systemAbilityId, abilityMap_.size());}RemoveCheckLoadedMsg(systemAbilityId);if (abilityDeath_ ! nullptr) {ability-AddDeathRecipient(abilityDeath_);}u16string strName Str8ToStr16(to_string(systemAbilityId));if (extraProp.isDistributed dBinderService_ ! nullptr) {dBinderService_-RegisterRemoteProxy(strName, systemAbilityId);HILOGD(AddSystemAbility RegisterRemoteProxy, serviceId is %{public}d, systemAbilityId);}if (systemAbilityId SOFTBUS_SERVER_SA_ID !isDbinderStart_) {if (dBinderService_ ! nullptr rpcCallbackImp_ ! nullptr) {bool ret dBinderService_-StartDBinderService(rpcCallbackImp_);HILOGI(start result is %{public}s, ret ? succeed : fail);isDbinderStart_ true;}}SendSystemAbilityAddedMsg(systemAbilityId, ability);return ERR_OK; }对于本地服务而言samgr服务接收到sa框架层发送的获取消息会通过服务id查找到对应服务的代理对象然后返回给sa框架。 sptrIRemoteObject SystemAbilityManager::CheckSystemAbility(int32_t systemAbilityId) {if (!CheckInputSysAbilityId(systemAbilityId)) {HILOGW(CheckSystemAbility CheckSystemAbility invalid!);return nullptr;}shared_lockshared_mutex readLock(abilityMapLock_);auto iter abilityMap_.find(systemAbilityId);if (iter ! abilityMap_.end()) {HILOGI(found service : %{public}d., systemAbilityId);return iter-second.remoteObj;}HILOGI(NOT found service : %{public}d, systemAbilityId);return nullptr; }动态加载系统服务进程及SystemAbility, 系统进程无需开机启动而是在SystemAbility被访问的时候按需拉起并加载指定SystemAbility。 3.1 继承SystemAbilityLoadCallbackStub类并覆写OnLoadSystemAbilitySuccess(int32_t systemAbilityId, const sptr remoteObject)、OnLoadSystemAbilityFail(int32_t systemAbilityId)方法。 class OnDemandLoadCallback : public SystemAbilityLoadCallbackStub { public:void OnLoadSystemAbilitySuccess(int32_t systemAbilityId, const sptrIRemoteObject remoteObject) override;void OnLoadSystemAbilityFail(int32_t systemAbilityId) override; };void OnDemandLoadCallback::OnLoadSystemAbilitySuccess(int32_t systemAbilityId,const sptrIRemoteObject remoteObject) // systemAbilityId为指定加载的SAIDremoteObject为指定systemAbility的代理对象 {cout OnLoadSystemAbilitySuccess systemAbilityId: systemAbilityId IRemoteObject result: ((remoteObject ! nullptr) ? succeed : failed) endl; }void OnDemandLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) // systemAbilityId为指定加载的SAID {cout OnLoadSystemAbilityFail systemAbilityId: systemAbilityId endl; }3.2 调用samgr提供的动态加载接口LoadSystemAbility(int32_t systemAbilityId, const sptr callback)。 // 构造步骤1的SystemAbilityLoadCallbackStub子类的实例 sptrOnDemandLoadCallback loadCallback_ new OnDemandLoadCallback(); // 调用LoadSystemAbility方法 sptrISystemAbilityManager sm SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (sm nullptr) {cout GetSystemAbilityManager samgr object null! endl;return; } int32_t result sm-LoadSystemAbility(systemAbilityId, loadCallback_); if (result ! ERR_OK) {cout systemAbilityId: systemAbilityId load failed, result code: result endl;return; }说明 1.LoadSystemAbility方法调用成功后指定SystemAbility加载成功后会触发回调OnLoadSystemAbilitySuccess加载失败触发回调OnLoadSystemAbilityFail。 2.动态加载的进程cfg文件不能配置为开机启动需指定ondemand : true, 示例如下: {services : [{name : listen_test,path : [/system/bin/sa_main, /system/profile/listen_test.json],ondemand : true,uid : system,gid : [system, shell]} ]}3.LoadSystemAbility方法适用于动态加载场景其他获取SystemAbility场景建议使用CheckSystemAbility方法。 4.cfg里进程名称需要与SA的配置json文件里进程名保持一致 更多鸿蒙知识已经更新qr23.cn/AKFP8k可以前往了解
http://www.zqtcl.cn/news/839206/

相关文章:

  • 环保网站设计价格建设网站对公司起什么作用
  • 做乒乓球网站的图片大全学网页设计哪个培训学校好
  • 婚礼做的好的婚庆公司网站用手机能创建网站吗
  • 广州网站开发平台.net做的网站代码
  • 地图网站设计建立公司网站视频
  • 哪个网站可以做销售记录仪中国电子商务中心官网
  • 学校网站建设厂家云上铺会员管理系统
  • 手机网站源码大全空间设计公司
  • 公司做哪个网站比较好招聘网站企业招聘怎么做
  • 北仑网站推广用c 做网站
  • 做网站怎么赚钱 注册网站环境配置
  • 阿里企业网站建设重庆移动网站制作
  • 织梦 网站栏目管理 很慢北票市建设工程安全管理站网站
  • 天津网站建设方案托管网站风格对比信息表
  • 如何做美发店网站wordpress会员登录查询
  • 建设外贸国外站点网站商业网站设计制作公司
  • 长沙哪个公司做网站优化seo多少钱
  • html基础标签昆明做网站优化哪家好
  • 网站制作公司全域营销获客公司wordpress+用户组
  • 中文网站建设工具WordPress相册插件pro
  • 网站建设收获与不足站中站网站案例
  • 做运营必看的网站今天重大新闻2022
  • seo网站开发注意事项广州网站建设制作价格
  • 禅城南庄网站制作做门户网站的公司
  • 网站里的图片是怎么做的同泰公司网站公司查询
  • seo怎么做网站内容wordpress文件上传失败
  • zenm自己做网站wordpress 摄影 模板
  • 网站手机页面如何做微信小程序开发平台官网登录
  • 嘉兴外贸网站制作成都网络公司最新招聘
  • 租服务器发布网站团购网站单页模板