一、Start.java 是ofbiz的启动类,主要做ofbiz的初始工作,函数为init(),用的到的启动文件framework\start\src\org\ofbiz\base\start\start.properties,初始化信息保存到Config类中:
String globalSystemPropsFileName = System.getProperty("ofbiz.system.props");
if (globalSystemPropsFileName != null) {
try {
System.getProperties().load(new FileInputStream(globalSystemPropsFileName));
} catch (IOException e) {
throw (IOException) new IOException("Couldn't load global system props").initCause(e);
}
}
this.config = Config.getInstance(args); 文件地址 //framework\start\src\org\ofbiz\base\start\start.properties
// parse the startup arguments
if (args.length > 0) {
this.loaderArgs = new String[args.length];
System.arraycopy(args, 0, this.loaderArgs, 0, this.loaderArgs.length);
}
if (fullInit) {
// initialize the classpath
&nbs

本文详细分析了OFBiz的启动过程,包括初始化配置、设置类加载器、创建日志目录、启动监听线程,以及通过StartupLoader加载容器配置。重点介绍了initClasspath方法,它将OFBiz的相关JAR包加入类路径,并使用自定义的NativeLibClassLoader。最后,探讨了如何通过ContainerLoader加载实现了Container接口的类。
最低0.47元/天 解锁文章
502

被折叠的 条评论
为什么被折叠?



