Ofbiz初探

主導建設一個電子商務系統
希望從Ofbiz瞭解中獲得一些借鑑
1.下載ofbiz,目前的版本是10.04,下載地址
readme.txt查看
2.開始
   下載後解壓,在解壓後的目錄中找到readme.txt,
    系統中需要安裝有JDK1.6以上的版本,注意是JDK,不是JRE
3.編譯
    Linux:./ant run-install
    Windows:ant run-install   
4. 運行
    編譯完成後,運行
    Unix類系統:startofbiz.sh
    Windows:startofbiz.bat
     運行完成後
    前臺查看:http://localhost:8080/ecommerce
    後臺查看:https://localhost:8443/webtools
    用戶名;Admin,密碼:ofbiz
ant 分析暫時略過,ant不熟悉
startofbiz.sh分析
   設備各種參數,運行 ofbiz.jar文件
5 源代碼分析
    開始運行文件位於 Framework->start->src->org->base->start->Start.java(解壓ofbiz.jar就可以知道開始運行此文件)
    5.1 Start.java分析
         先分析運行
         Start.init();
         Start.start();// Start是一個線程
      
        //init
        讀取配置文件
        初始化Classpath
        初始化LOG路徑
        初始化listenerthread
        初始化StartLoaders
       
        run:啓動管理監聽線程,監聽管理指令
        start:
     5.2   啓用loader,開始loader

       讀取配置文件,org/ofbiz/base/start/install.properties  

       啓動loader :Framework->base->src->org->base->container->Containerloader.java
       Container先load,再start
     
      要啓用的Container在  Framework->base->config->install-container.xml中定義
       一共啓動的Container是   ComponentContainer,ClassLoaderContainer,EntityDataLoadContainer
      先init,再start
     
     5.3 componentContainer分析
          從 component-load.xml載入component
          都是從目錄下載入多個component
         1)先從framework目錄中,根據目錄下的component-load.xml載入單個的component
         2)  再從theme目錄,theme目錄中沒有component-load.xml.
              子目錄中有ofbiz-component.xml,
        3) 再從application目錄
       4)再從sepcialpurpose目錄
       5)再從hotdeploy目錄
     5.4 從ClassLoaderContainer
    5.5  從EntityDataLoadContainer, Start()函數 從DelegatorFactory GetDelegator
           entity目錄下 META-INF定義了 DelegatorFactoryImpl實例
          
          new GenericDelegator
          中間從StringUtil中打印OWASP內容
          ModelReader
         從EntityEngine.xml中取出DelegatorInfo 取default delegator
         載入Entity
         entity檢查
         help
         datasource檢查
    deleagator生成結束
    initEntityEcaHandler
     
  
   
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章