We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
框架本身不可能满足所有场景,想要做到不修改框架本身的代码也能满足很多特征需求,可以提供 勾子在框架的核心流程中做拦截操作。例如mybatis的拦截器,spring的PostBeanProcessor。
modular-spring提供了以下两个勾子接口:
public interface ModuleLoadListener { /** * 在调用{@link ModuleApplicationContext#refresh()}前调用 */ void beforeModuleLoad(ModuleConfig moduleConfig, ModuleApplicationContext applicationContext); /** * 在调用{@link ModuleApplicationContext#refresh()}后调用 */ void afterModuleLoad(ModuleConfig moduleConfig, ModuleApplicationContext applicationContext); }
public interface ApplicationStartupCallback { void action(); }
ModuleLoadListener提供了在一个模块初始化前和初始化后的处理逻辑的调用能力,而ApplicationStartupCallback提供了应用启动后的回调能力。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
为什么需要勾子
框架本身不可能满足所有场景,想要做到不修改框架本身的代码也能满足很多特征需求,可以提供
勾子在框架的核心流程中做拦截操作。例如mybatis的拦截器,spring的PostBeanProcessor。
modular-spring中的勾子接口
modular-spring提供了以下两个勾子接口:
ModuleLoadListener提供了在一个模块初始化前和初始化后的处理逻辑的调用能力,而ApplicationStartupCallback提供了应用启动后的回调能力。
The text was updated successfully, but these errors were encountered: