ofbiz下的ajax,ofbiz中的ofbiz-component.xml和加载过程

在ofbiz中,有一个非常重要的配置文件ofbiz-component.xml,这个文件告诉ofbiz需要加载那些容器和类,在start.properties中有如下定义//ofbiz容器加载类,用来加载其他容器,ofbiz

ofbiz.start.loader1=org.ofbiz.base.container.ContainerLoader

//ofbiz加载的组件级别

ofbiz.start.loader1.loaders=main,rmi

ContainerLoader根据framework\base\config\ofbiz-containers.xml中定义的容器按顺序启动容器//此处的loaders="main,rmi,pos,install",包含start.properties中的加载级别,该容器是符合要求的启动容器,事实上生产模式上只启动这一个容器

component-container是组件加载容器,根据framework\base\config\component-load.xml中定义的组件目录查找component-load.xml文件然后加载这些文件

这些配置都存放在org.ofbiz.base.component.ComponentConfig中// this is not a UtilCache because reloading may cause problems

//普通组件配置文件存放位置

protected static Map componentConfigs = FastMap.newInstance();

//web组件配置文件存放位置

protected static Map> serverWebApps = FastMap.newInstance();

下边看一个最基本的component-load.xml文件结构

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">

这些配置文件都会被加载到ComponentCofig类中,在这个类中有相应的字段用来存放这些配置protected String globalName = null;

protected String rootLocation = null;

protected String componentName = null;

protected boolean enabled = true;

protected Map resourceLoaderInfos = FastMap.newInstance();

protected List classpathInfos = FastList.newInstance();

protected List entityResourceInfos = FastList.newInstance();

protected List serviceResourceInfos = FastList.newInstance();

protected List testSuiteInfos = FastList.newInstance();

protected List keystoreInfos = FastList.newInstance();

protected List webappInfos = FastList.newInstance();

protected List containers = FastList.newInstance();

最后通过Map将这些配置保存,提供给下一步使用

总结:

以上流程可以通过下图进行展示

2a4c41d92adc1fe17ea125001e72a71b.png

个人见解,如有错误,请不吝赐教

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值