Skip to content
This repository has been archived by the owner on Jan 9, 2021. It is now read-only.

YMP框架模块管理器使用详解

suninformation edited this page Jul 25, 2013 · 1 revision

模块管理器使用详解

  • 通过实现IModule接口,创建测试模块:

      public class TestModule implements IModule {
      
          public void initialize(final Map<String, String> moduleCfgs) throws Exception {
              System.out.println(moduleCfgs.get("moduleName"));
          }
          
          public void destroy() throws Exception {
          }
      
      }
    
  • 将模块添加到配置文件的模块加载列表中:

      ymp.dev_model=false
      ymp.module_list=test
      ymp.modules.test=net.ymate.xxx.TestModule
      #
      ymp.configs.test.moduleName=TEST
    
  • 初始化YMP框架:

      YMP.initialize();