启动加载Module

  1. Hasor.create().build(new UserModule(),new ClassModule() ...);

Module加载Module

  1. public class RootModule implements Module {
  2. public void loadModule(ApiBinder apiBinder) throws Throwable {
  3. ...
  4. apiBinder.installModule(new UserModule());
  5. apiBinder.installModule(new ClassModule());
  6. ...
  7. }
  8. }

配置文件加载Module

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <config xmlns="http://www.hasor.net/sechma/main">
  3. <!-- 默认要装载的模块 -->
  4. <hasor.modules>
  5. <module>net.hasor.web.render.RenderWebPlugin</module>
  6. <module>net.hasor.plugins.startup.StartupModule</module>
  7. <module>net.hasor.plugins.aop.AopModule</module>
  8. </hasor.modules>
  9. </config>

  1. Hasor.create().mainSettingWith("my-hconfig.xml").build();