shadow-core: common
2022-03-16 12:21:05 0 举报
腾讯 shadow 分析
作者其他创作
大纲/内容
ContentProviderDelegateProvider 依赖注入类dynamic-pluginloader 通过这个类实现将 PluginLoader 中的ContentProviderDelegateProvider 实现注入到 PluginContainer 中
1. 设置监听
ContentProviderDelegateProvider
+ HostContentProviderDelegate getHostContentProviderDelegate();
获取
1 : 1
DelegateProviderHolderPrepareListener
+ void onPrepare();
ContentProviderDelegateProviderHolder
+ static ContentProviderDelegateProvider contentProviderDelegateProvider;- static DelegateProviderHolderPrepareListener sPrepareListener;
+ static void setContentProviderDelegateProvider(ContentProviderDelegateProvider contentProviderDelegateProvider)+ static void setDelegateProviderHolderPrepareListener(DelegateProviderHolderPrepareListener prepareListener)+ notifyDelegateProviderHolderPrepare()
PluginContainerContentProvider
+ HostContentProviderDelegate hostContentProviderDelegate
+ font color=\"#006064\
HostContentProviderDelegate
ContentProvider
桩其方法会调用 HostContentProviderDelegate 的相应方法
2. 获取 delegate
PluginContainerContentProvider 的被委托者接口被委托者通过实现这个接口中声明的方法达到替代委托者实现的目的,将 PluginContainerContentProvider 的行为动态化。
0 条评论
回复 删除
下一页