Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider目录是做什么目的的? #57

Closed
QinFred2003 opened this issue Feb 9, 2018 · 3 comments
Closed

provider目录是做什么目的的? #57

QinFred2003 opened this issue Feb 9, 2018 · 3 comments

Comments

@QinFred2003
Copy link
Contributor

QinFred2003 commented Feb 9, 2018

看到Sandbox有两个项目和"provider"相关,好像也是一种用SPI进行插件加载的架构。
${SANDBOX_TARGET_DIR}/provider/sandbox-mgr-provider.jar
但是实现是空的
com.alibaba.jvm.sandbox.provider.mgr.EmptyModuleJarLoadingChain
com.alibaba.jvm.sandbox.provider.mgr.EmptyModuleLoadingChain

另外在DefaultCoreModuleManager里面看到下面这个片段
/**
* 用户模块文件加载回调
*/
final private class InnerModuleJarLoadCallback implements ModuleJarLoader.ModuleJarLoadCallback {
@OverRide
public void onLoad(File moduleJarFile) throws Throwable {
providerManager.loading(moduleJarFile);
}
}

这个是不是说去掉这块也不影响主要功能, 只是说给用户一个口子在每个模块文件加载时候可以有一定的方式可以影响?

@QinFred2003 QinFred2003 changed the title ProviderClassLoader provider目录是做什么目的的? Feb 9, 2018
@QinFred2003 QinFred2003 reopened this Feb 9, 2018
@QinFred2003
Copy link
Contributor Author

咨询一下问题

@oldmanpushcart
Copy link
Collaborator

的确是你想的这样。因为考虑到在不同场景下模块管理的开放性,所以才设计了这个钩子。

比如一些公司希望加载的module都必须经过他们的解密运算或者签名运算

还有一些是希望对module有统一的版本管控

但目前这块API设计得不是太优雅,所以没公布出来。

@QinFred2003
Copy link
Contributor Author

非常感谢你的解答,非常清楚了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants