ofbiz中的container-1
2015-06-18 15:18
453 查看
在ofbiz中,主要有三种container
系统启动时候的container
这个在启动类中被调用,根据framework\base\config\ofbiz-containers.xml中的定义加载其他容器
用来加载组件的container
在这里边定义的container会被顶层container启动,执行指定的class类
这里定义的container执行的时候基本上是组件还没有加载
组件中component-load.xml定义的container
这里边的容器基本上是在组件配置全部加载完毕后开始执行
总结:
这三个地方的container并没有什么不同,主要是因为启动顺序和作用的问题把这些container写在不同的配置文件中
本文出自 “沧海龙腾” 博客,谢绝转载!
系统启动时候的container
这个在启动类中被调用,根据framework\base\config\ofbiz-containers.xml中的定义加载其他容器
用来加载组件的container
在这里边定义的container会被顶层container启动,执行指定的class类
这里定义的container执行的时候基本上是组件还没有加载
组件中component-load.xml定义的container
这里边的容器基本上是在组件配置全部加载完毕后开始执行
//获取全部组件中定义的container List<ContainerConfig.Container> containersDefinedInComponents = ComponentConfig.getAllContainers(); for (ContainerConfig.Container containerCfg: containersDefinedInComponents) { boolean matchingLoaderFound = false; if (UtilValidate.isEmpty(containerCfg.loaders) && UtilValidate.isEmpty(loaders)) { //比较启动级别 matchingLoaderFound = true; } else { for (String loader: loaders) { if (UtilValidate.isEmpty(containerCfg.loaders) || containerCfg.loaders.contains(loader)) { matchingLoaderFound = true; break; } } } if (matchingLoaderFound) { Debug.logInfo("Loading component's container: " + containerCfg.name, module); Container tmpContainer = loadContainer(containerCfg, args); //加载Container,执行其中的init方法 this.loadedContainers.add(tmpContainer);//加入缓存 Debug.logInfo("Loaded component's container: " + containerCfg.name, module); } }
总结:
这三个地方的container并没有什么不同,主要是因为启动顺序和作用的问题把这些container写在不同的配置文件中
本文出自 “沧海龙腾” 博客,谢绝转载!
相关文章推荐
- Mybaits的参数详解
- AIX下安装GNU make
- Mybaits的执行过程及相关组件的生命周期
- AIX make概述 Dependency line needs colon or double colon operator
- Mybaits的resultMap详解
- There are no packages available for installation
- Mybaits的映射器配置详解
- Solr5 DataImport 处理1对多关系
- ubuntu设置cairo-dock自启动
- ]9.zookeeper原理解析-选举之QuorumPeerMain加载
- cookie 的Domain删除失败的问题
- obtainStyledAttributes深入理解
- Mybaits的配置文件详解
- win32: WM_PAINT 实现双缓冲缓图
- gethostbyname(domain) 老是返回 NULL, 凌乱了
- 关于FIN_WAIT1
- Mybaits简介
- STOP:c0000218 {Registry File Failure}
- Debug Assertion Failed!
- Debug Assertion Failed!