外文翻譯-基于ssh的選課系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第1頁
外文翻譯-基于ssh的選課系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第2頁
外文翻譯-基于ssh的選課系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第3頁
外文翻譯-基于ssh的選課系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第4頁
外文翻譯-基于ssh的選課系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、1 外文資料翻譯譯文 Java自動配置的研究與應(yīng)用和基于XML元數(shù)據(jù)部署工具吳海李,龔任斌,王從斌石油化工科學(xué)研究院勘探開發(fā),西北地區(qū),中石油,535號嚴(yán)而灣路,甘肅省蘭州市730020,中國,Ph./Fax:8823/51551390*通訊作者,電子信箱:wuhl_xb摘要隨著上線A11的生產(chǎn)管理體系和驗(yàn)收,業(yè)務(wù)工作正在成為管理分布式系統(tǒng)越來越重要。如何保證系統(tǒng)的版本更新工作速度快,穩(wěn)定,高效,成為迫切需要解決的問題。我們設(shè)計(jì)和實(shí)現(xiàn)ConfigTool這是基于由執(zhí)行的XML元數(shù)據(jù)的自動配置和部署工具Java的。 ConfigTool實(shí)現(xiàn)解壓,修改,壓縮的自動化流程

2、和包的部署。另外,我們也研究和優(yōu)化文件壓縮算法,這是在ConfigTool使用。通過ConfigTool,業(yè)務(wù)工作會變得簡單,提高工作效率。關(guān)鍵字:分布式系統(tǒng);XML;自動配置和部署;壓縮算法。1、 介紹隨著上線驗(yàn)收A11的生產(chǎn)管理體系,業(yè)務(wù)工作正在成為管理分布式系統(tǒng)越來越重要。 如何確保系統(tǒng)的版本更新速度快的工作,穩(wěn)定,高效,成為一個(gè)亟待解決的問題是解決了。由于以下原因,我們開發(fā)ConfigTool。首先,分布式系統(tǒng)使用具有數(shù)萬的服務(wù)器有時(shí)數(shù)千不同的油田,除了與系統(tǒng)升級有關(guān)的配置文件分布在許多不同以 “.properties” 結(jié)束的文件,所以當(dāng)手動配置,這些配置文件將不可避免地產(chǎn)生很難找到

3、的錯(cuò)誤。其次,關(guān)系數(shù)據(jù)庫,實(shí)時(shí)數(shù)據(jù)庫和域名地址是在不同油田不同。這樣的配置項(xiàng)是數(shù)不勝數(shù)。這些條件有增加了維護(hù)工作量,并且所需的工作,以確保準(zhǔn)確性。 從圖1 A11的生產(chǎn)管理系統(tǒng)之間的關(guān)系,你可以想象這是多少配置文件和物品!圖1.A11的關(guān)系圖第三,當(dāng)開發(fā)人員發(fā)布程序(war或jar)的新版本,這只是一個(gè)某油田。要部署該程序的另一油田,運(yùn)營人們不得不解壓縮這場war或jar,然后找到合適的配置文件,并修改正確的項(xiàng)目,所有的壓縮解壓縮的文件和修改的文件到目標(biāo)war包或jar包,最后,部署在目標(biāo)war包/ jar包到目標(biāo)油田的應(yīng)用服務(wù)器。在這業(yè)務(wù)工作,解壓縮,壓縮和部署是重復(fù)性的工作。而在更大的意義

4、上,修改配置文件也是重復(fù)性工作;但在微范圍內(nèi),操作人員需要了解每個(gè)配置文件是什么具體的定義,需要找到正確的配置文件和項(xiàng)目進(jìn)行修改。在這種情況下,這是正常的維護(hù)一個(gè)配置文件,為每個(gè)油田的每一個(gè)環(huán)境。這樣做很容易通過犯錯(cuò)誤,而且成本和操作時(shí)間會隨的增加而線性增長部署環(huán)境。具有重大的現(xiàn)實(shí)意義的Soitis開發(fā)出智能自動配置和部署工具1。有許多關(guān)于軟件開發(fā)和測試的許多配置工具。自動配置WEBX的工具包,它是淘寶的開源Web框架,定義變量配置項(xiàng)目作為模板文件,運(yùn)行該工具時(shí),可以生成特定的配置文件基座上的相應(yīng)的模板文件4。但是,使用這些工具需要通過命令線或行家,它不具有一個(gè)違反直覺的界面和它的復(fù)雜配置自動

5、配置本身。 Ansible是Python實(shí)現(xiàn)自動化運(yùn)營管理工具。它包含了一些維修工具(puppet, Cfengine, chef, func)的優(yōu)點(diǎn),但它僅適用于Linux系統(tǒng)。木偶是基于C / S的配置管理工具的基礎(chǔ)框架。當(dāng)使用這個(gè)工具,你必須在中央服務(wù)器上安裝木偶大師,安裝在目標(biāo)主機(jī)上的傀儡客戶端軟件。當(dāng)客戶端連接的木偶大師,在木偶大師所定義的配置文件進(jìn)行編譯,并在客戶端上運(yùn)行。如果使用這個(gè)工具,其通信方式將影響A11的生產(chǎn)管理系統(tǒng)而這并不適用于我們的系統(tǒng)2-3。我們的目標(biāo)是設(shè)計(jì)自動化配置和部署工具,它完全沒有或很少需要人工作業(yè)。我們實(shí)現(xiàn)自動化配置和部署工具基于與Java XML元數(shù)據(jù)。

6、通過使用它,我們配置和部署每個(gè)程序版本的A11容易,并有效地降低了系統(tǒng)的運(yùn)行時(shí)間,使的概率失誤,極大地提高了工作效率。2.設(shè)計(jì)工具實(shí)現(xiàn)自動化配置和部署工具(稱為ConfigTool),我們設(shè)計(jì)了程序如下基于所有我們的研究和實(shí)際需要的。首先,選擇需要配置和部署war包/ jar包(是)(稱為A)需要配置和部署。第二,讀取并解析XML配置模板(稱為B),其中標(biāo)簽“CONF文件”(稱為C)對應(yīng)的配置文件的名稱,子標(biāo)記“CONF”使用鍵值對,以表達(dá)相關(guān)的配置項(xiàng)。而密鑰(稱為D)是配置項(xiàng)的 “.properties”配置文件中的名稱,值(稱為E)是這樣的配置項(xiàng)的值。三,解壓縮,并在壓縮文件中找到C,在C

7、中修改D的值作為E。壓縮所有文件為目標(biāo)的war包/ jar包(稱為F)。最后,部署F到目標(biāo)應(yīng)用程序服務(wù)器。2.1構(gòu)建和解析配置模板配置模板,其中包含了大量的配置XML文件信息,我們需要提取的配置文件,配置項(xiàng)目和目標(biāo)值需要從配置模板進(jìn)行修改。XML配置模板設(shè)計(jì)如下:標(biāo)簽“LIB”表示此配置模板是哪個(gè)油田或生產(chǎn)區(qū)。標(biāo)簽的“模板”,包括所有程序軟件包配置文件需要修改。每個(gè)程序包是一個(gè)“模板”標(biāo)簽,在其中的“應(yīng)用程序”屬性顯示的名稱這個(gè)程序包,“類型”屬性標(biāo)識的環(huán)境(開發(fā),測試或類型生產(chǎn)),“版本”屬性指定程序的版本號。標(biāo)簽的“源”屬性“CONF文件”表示當(dāng)前程序包的配置文件需要修改。 標(biāo)簽“CONF

8、”表示配置項(xiàng)和當(dāng)前配置文件的目標(biāo)值需要修改,其中“關(guān)鍵”屬性指示要修改哪些配置項(xiàng),“值”屬性指示對應(yīng)的目標(biāo)修改后的值。上面提到的所有的標(biāo)簽和屬性都是需要的。ConfigTool抽象的XML文件作為一個(gè)階級的每個(gè)標(biāo)簽,實(shí)現(xiàn)XML的分析基于JDOM配置模板,使用屬性類來實(shí)現(xiàn)閱讀和配置文件的修改。圖2. ConfigTool的 配置模板2.2壓縮,解壓縮算法ConfigTool使用Java的Ant庫完成減壓壓縮操作。在前面的算法,我們解壓縮war/jar中的所有文件包,然后根據(jù)配置模板的分析結(jié)果修改配置文件配置項(xiàng)。最后壓縮所有文件到目標(biāo)war/jar包。優(yōu)化算法主要用于壓縮過程,因?yàn)橐郧八惴ㄊ呛臅r(shí)的

9、壓縮處理。獲得目標(biāo)war/jar包通過兩種途徑。一個(gè)是修改所需要的配置文件 - 先壓縮,然后進(jìn)行修改,最后壓縮。另一種是對所有剩余的文件,只需在原來的war包/jar包將這些文件復(fù)制由字節(jié)流的目標(biāo)。因?yàn)樗惺S嗟奈募臄?shù)量遠(yuǎn)遠(yuǎn)超過該修改的配置文件,所以效率大大地提高4-6。我們做了兩種算法之間的比對。使用兩種算法使得在war包的配置時(shí)間相差不大。但他們在配置jar包有大的變化。由于jar的文件結(jié)構(gòu)比war更為復(fù)雜。當(dāng)然,副本更輕松。通過使用優(yōu)化算法,jar分組的共同的壓縮時(shí)間從最初的1-2分鐘減少到數(shù)秒。2.3自動部署ConfigTools自動部署功能可以單獨(dú)使用,也就是,用戶可以不要在課2.

10、1和2.2中引入的功能。我們定義在ConfigTool一個(gè)標(biāo)志,當(dāng)用戶使用以前的功能,標(biāo)記=1,否則標(biāo)志=0。如果flag=1,ConfigTool使用哈德森完成包的自動結(jié)構(gòu),它在自動減壓配置過程,然后部署構(gòu)造應(yīng)用到應(yīng)用服務(wù)器。 如果標(biāo)志為0,用戶應(yīng)該選擇節(jié)目包先部署。在本節(jié)中,我們使用哈德森它支持分布式結(jié)構(gòu)和抽象應(yīng)用服務(wù)器控制臺。 數(shù)字圖3是應(yīng)用服務(wù)器控制臺“抽象接口7-9中的一個(gè)。圖4顯示了ConfigTool的全自動部署過程。首先拿到一攬子方案的部署,然后選擇你要部署的應(yīng)用服務(wù)器(如:Tomcat/ WebSphere),然后使用哈德森使包裝的自動構(gòu)建,上傳構(gòu)造程序到應(yīng)用服務(wù)器,根據(jù)程序

11、的施工結(jié)構(gòu),以確定是否要部署包倉庫10。同時(shí),應(yīng)用該資源部署和代理中間件容器,然后部署應(yīng)用程序包,一小會兒后,ConfigTool將返回訪問地址并報(bào)告部署成功的。圖3.IBM WebSphere 應(yīng)用服務(wù)器的抽象接口圖4. ConfigTools自動部署的流程圖3、 結(jié)果與分析ConfigTool是自動配置和部署工具一個(gè)獨(dú)立的程序由Java實(shí)現(xiàn),視XML文件作為信息庫,其核心功能是自動從原始WAR/ WAR包到完成配置過程目標(biāo)的。隨著中國石油的油田運(yùn)行試驗(yàn)的經(jīng)驗(yàn),采用ConfigTool能夠順利管理配置的數(shù)百套的過程和部署環(huán)境在數(shù)十個(gè)領(lǐng)域的當(dāng)前。表1. ConfigTool的原理表1示出了該工

12、具的基本原理是:A代表油田的參數(shù)庫,每個(gè)油田都有一個(gè)圖書館。 B代表這是對應(yīng)于一個(gè)系統(tǒng)的配置的模板。其內(nèi)容涉及開發(fā),測試和生產(chǎn)環(huán)境的結(jié)構(gòu)。 C代表的目錄這是完全對應(yīng)的war/ jar包的配置文件。 D代表其中包括原裝包和C文件的目標(biāo)程序包。從左至右,ConfigTool自動生成部署的war/ jar包。 一個(gè)和B可以在XML/ Excel的編輯器進(jìn)行編輯。 C能快速生成相應(yīng)的通過ConfigTool配置文件目錄。 D程序?qū)⒆詣痈采w在原包C目錄的配置文件,并獲得目標(biāo)部署包。ConfigTool主要包含四個(gè)面板分別是“原包”,“配置參數(shù)”,“包”和“部署”。圖5顯示了“原包”面板,選擇程序的原包裝

13、在此面板的路徑,ConfigTool可以自動列出所有在這條道路的包,然后用戶可以選擇他們想要的配置和部署的包。圖5.ConfigTool的Original Package面板圖6顯示了“配置參數(shù)”面板。在這個(gè)面板中,選擇的路徑配置模板和目標(biāo)包部署,配置工具可以將環(huán)境解析該路徑的所有配置模板,并列出結(jié)果。并根據(jù)環(huán)境ConfigTool可以生成相應(yīng)的包。在“包”面板中,單擊“包”按鈕,ConfigTool先解壓縮原包裝,然后解析配置模板,根據(jù)該分析結(jié)果修改相應(yīng)的在配置文件中的配置項(xiàng),最后壓縮所有原始的和修改過的文件到目標(biāo)包。為確保安全,一些私人信息已經(jīng)覆蓋如圖6所示。圖6 ConfigTool的

14、Configuration Parameters 面板圖7示出了“包”面板。在“包”面板中,單擊“啟動包”按鈕,ConfigTool先解壓縮原包裝,然后解析配置模板,根據(jù)分析結(jié)果修改的配置對應(yīng)的配置項(xiàng)文件,最后壓縮所有原始的和修改過的文件到目標(biāo)包。圖7 ConfigTool的 Package 面板圖8示出了“部署”面板。在這個(gè)面板中,選擇應(yīng)用程序服務(wù)器的類型,在服務(wù)器IP,用戶名,密碼,以及部署路徑補(bǔ),ConfigTool將使用哈德森來自動創(chuàng)建目標(biāo)包并上傳,然后調(diào)用相應(yīng)的應(yīng)用程序服務(wù)器的抽象類來完成目標(biāo)包的自動部署。圖8 ConfigTool的Deploy 面板使用ConfigTool可以解決

15、的運(yùn)行和維護(hù)的問題,對于A11項(xiàng)目,簡化的所有油田A11系統(tǒng)的配置和部署的工作石油,有效地降低誤差率和配置的部署時(shí)間,大大提高了的工作效率和工具是容易使用。表2示出的對比度之前的影響,并后ConfigTool的應(yīng)用。表2對比前后ConfigTool為A11項(xiàng)目應(yīng)用后的效果對于A11項(xiàng)目,ConfigTool的應(yīng)用程序之前,每個(gè)油田的每一個(gè)版本程序(包括4個(gè)war和10個(gè) jar包),需要解壓,修改配置文件,壓縮,然后部署到服務(wù)器,在零錯(cuò)誤率的情況下,這過程將需要1-2天的每個(gè)版本,如果發(fā)生錯(cuò)誤,這將持續(xù)較長時(shí)間,通常為約一個(gè)星期。在使用ConfigTool只有近零差率花費(fèi)15分鐘。該從各油田1

16、-2人(S)的操作和維護(hù)人員數(shù)量減少1-2人(S)的所有油田。使用ConfigTool后,不僅降低了錯(cuò)誤率,但也不需要的培訓(xùn)時(shí)間。因?yàn)椴僮骱途S護(hù)人員不需要了解每個(gè)包和配置文件的關(guān)系和含義。更多重要的是,ConfigTool適用于所有的J2EE項(xiàng)目的配置和部署,它具有廣闊的應(yīng)用前景,用戶所要做的只是為每個(gè)包按照與前面介紹的格式寫配置模板。4. 結(jié)論和進(jìn)一步研究從我們的一切工作,我們可以看到,XML配置模板中包含了大量的項(xiàng)目的配置信息。使用ConfigTool可以有效地減少配置和維護(hù)人員的部署時(shí)間,也有助于通過手動避免降低錯(cuò)誤率更改配置文件,提高了工作效率。要修復(fù)耗時(shí)在壓縮過程中的挑戰(zhàn),我們描述了

17、一個(gè)高度可用的算法。該減壓過程算法的改進(jìn)是比以往更加實(shí)用,并且使ConfigTools界面更人性化也很重要。【參考文獻(xiàn)】1郭安.研究軟件配置管理中的應(yīng)用項(xiàng)目開發(fā).第六屆全國會議計(jì)算機(jī)應(yīng)用.中國北京. 2002; 3:1082至1084年.2滇西時(shí),博鼎,魏翠,亦名張,王王懷民.研究與實(shí)現(xiàn)部署和配置工具輕質(zhì)組件.計(jì)算機(jī)科學(xué). 2011; 06:165-168.3張一鳴,石滇西,鼎博,殷罡.研究和部署的執(zhí)行情況配置工具普適計(jì)算中間件.第四Jiont會議上和諧人機(jī)環(huán)境.中國武漢. 2008; 1:574-580.4 Pham Duc-Son, Venkatesh Svetha. Efficient

18、Algorithms for Robust Recovery of Images from Compressed Data. IEEE Transactions on Image Processing. 2013; 41(6): 2212-2221. 5 BL Kess, DR Steinwand, SE Reichenbach. Compression of the Global Land 1-km AVHRR Dataset. International Journal of Remote Sensing. 1996; 39(2): 1715-1723.6 Hach Faraz, Numa

19、nagic Ibrahim, Alkan Can, Sahinalp S Cenk. SCALCE: Boosting Sequence Compression Algorithms Using Locally Consistent Encoding. Oxford Journal of Science and athematics. 2012; 21(4): 2823-2830. 7林波,周名輝,劉天成,黃鋼,梅虹. Web容器集成框架的J2EE應(yīng)用程序服務(wù)器. Journal of Softwar. 2006; 17(5):1195至1203年.8李冰硼散,孫長岐,蘭陽.軟件智能部署方法.

20、雜志計(jì)算機(jī)應(yīng)用. 2009年; 01:248-252.9張?jiān)?,張?jiān)朴拢勘?云系統(tǒng)的自動部署體系結(jié)構(gòu)基于工作流.電信科學(xué). 2014年; 11:14-21.10趙天齊.在云計(jì)算的Web應(yīng)用程序的自動部署和資源配置環(huán)境.哈爾濱工業(yè)大學(xué). 2014年Telkomnika的版權(quán)是電氣工程,艾哈邁德系的財(cái)產(chǎn)達(dá)赫蘭大學(xué),未經(jīng)版權(quán)所有人明確的書面許可,其內(nèi)容不得復(fù)制或通過電子郵件發(fā)送給多個(gè)站點(diǎn)或發(fā)布到一個(gè)群發(fā)功能。但是,用戶可以打印,下載,或電郵文章以供個(gè)人使用2.外文原文 TELKOMNIKA, Vol.13, No.3, September 2015, pp. 10621068ISSN: 1693-6

21、930, accredited A by DIKTI, Decree No: 58/DIKTI/Kep/2013DOI: 10.12928/TELKOMNIKA.v13i3.1977 n 1062Received March 10, 2015; Revised June 5, 2015; Accepted June 24, 2015Research and Application of Java Auto-Configuration and Deployment Tool Based on XML MetadataWu Hailli*, Gong Renbin, Wang CongbinRes

22、earch Institute of Petroleum Exploration & Development-Northwest, PetroChina,No.535 Yanerwan Road, LanZhou, GanSu 730020, China, Ph./Fax: 8823/51551390*Corresponding author, e-mail: wuhl_xbAbstractWith the on-line and acceptance of A11s production management system, the operational wor

23、k is becoming increasingly critical to managing distributed system. How to ensure system version update work fast, stable and efficient, become an urgent problem to be solved. We design and implement ConfigTool which is a auto-configuration and deployment tool based on XML metadata implemented by Ja

24、va. ConfigTool realizes the automated processes of decompression, modification, compression and deployment of packages. In additon, we also study and optimize the file compression algotithm which is used in ConfigTool. Through ConfigTool, operational work can become simple and improving work efficie

25、ncy.Keywords: distributed system, XML, auto-configuration and deployment, compresssion algotithmCopyright 2015 Universitas Ahmad Dahlan. All rights reserved.1. IntroductionWith the on-line and acceptance of A11s production management system, the operational work is becoming increasingly critical to

26、managing distributed system. How to ensure system version update work fast, stable and efficient, become an urgent problem to be solved. Because of the following reasons, we developed ConfigTool.Firstly, the distributed system is used with tens of servers sometimes thousands in different oilfield, b

27、esides configuration files associated with system upgrading are distributed in many different files end with ”.properties”, so when configure these profiles manually will inevitably produce errors which are hard to find.Secondly, relational database, real-time database and domain name address are di

28、fferent in different oilfiled. Configuration items like these are countless. These conditions have increased the maintenance workload, and the work is needed to ensure the accuracy. From Figure 1 the relationship of A11s production management system, you can image how many configuration files and it

29、ems they are!Figure 1. The relationship of A11project.Thirdly, When developers release a new version of program (war or jar), its only for a certain oilfield. To deploy this program to another oilfield, operational people have to decompress this war or jar, then find the right configuration files an

30、d modify the right items, compressed all the extracted files and modified files into the target war or jar packages, finally, deploy the target war/jar package to the application server of the target oilfield. In this operational work, decompression, compression and deployment are repetitive work. W

31、hile in the larger sense, modify configuration files is also the repetitive work; but in the micro-scope, operational people need to understand each configuration file is what specific defined, and need to find the correct configuration files and items to modify. In this condition, its normal to mai

32、ntain one configuration files for every environment of every oilfield. Its very easy to make mistakes by doing this, and the cost and operational time will grow linearly along with the increase of deployment environments. Soitis of great practical significancetothe develop a intelligent autoconfigur

33、ation and deployment tool 1.There are many configuration tools about software development and testing. Autoconfig Toolkit of WebX which is Taobaos open-source web framework, define the variable configuration items as a template file, when running the tool can generate the specific profiles base on t

34、he corresponding template file 4. But to use the tools needs through the command line or maven, it doesnt have a counterintuitive interface and its complex to configure Autoconfig itself. Ansible is an automation operation management tool implemented by Python. It Contains the advantages of a number

35、 of maintenance tools (puppet, Cfengine, chef, func), but it is only applicable to Linux system. Puppet is a configuration management tools base on C/S framework. When using this tool, you have to Install Puppet master on a central server, Install the puppet client software on the target host. When

36、the client is connected on the Puppet master, the configuration files Defined in the Puppet master are compiled, and run on the client. If use this tool, its way of communication will affect the A11s production management system and its not applicable for our system 2-3.Our goal is to design automat

37、ion configuration and deployment tool which completely dont or need little manual work. We implement automation configuration and deployment tool based on XML metadata with Java. By using it we configure and deploy every program version of A11 easily, and effectively reduces the system operation tim

38、e and the probability of making mistakes, which greatly improves the work efficiency.2. Design and Implementation of ToolAutomation configuration and deployment tool (called as ConfigTool), we design its procedures as follows based on all of our research and the actual needs.First, select the war/ja

39、r package(s) (called A) which need(s) to configure and deploy.Second, read and parse the XML configuration template (called B), in which tag ”conffile” (called C) corresponds tothe name of the configuration file, subtag “conf” uses keyvalue pairs to express the associated configuration items. While

40、Key (called D) is a configuration items name in the “.properties” configuration file, value (called E) is this configuration items value.Third, decompress A, and find C in the decompressed files, modify Ds value as E in C. Compress all the files as target war/jar package (called F).At last, deploy F

41、 to the target application server.2.1. Build and Parse Configuration TemplateConfiguration Templateisa XML file which contains a large number of configuration information, we need to extract the configuration files, configuration items and the target values needed to modify from the configuration te

42、mplate.The XML configuration template is designed as follows:Tag “l(fā)ib” indicates this configuration template is for which oillfield or production area. Tag “templates” includes all the program packages whose configuration files needs to modify. Each program package is a “template” tag, in which the

43、“app” property indicates the name of this program package, “type” property identifies the type of environment (development, test or production), “version” property specifies the programs version number. The “src” property of tag “conffile” indicates which configuration files of the current program p

44、ackage need to modify. Tag “conf” indicates which configuration items and their target values of the current configuration file need to modify, in which “key” property indicates which configuration item you want to modify, “value” property indicates the corresponding target modified value. All the t

45、ags and properties mentioned above are required.Figure 2. The Configuration Template of ConfigToolConfigTool abstract each tag of the XML file as a class, implements the analysis of XML Configuration Template based on JDOM, uses the Properties Class to achieve the reading and modifying of the config

46、uration file.2.2. Compression-Decompression AlgorithmsConfigTool uses the Ant library of Java to complete the decompression and compression operation. In the previous algorithm, we decompress all the files of war/jar package, then according to the analysis results of the configuration template modif

47、y the configuration items of configuration files. Finally compress all the files into target war/jar package.The optimized algorithmis mainly for the compression process, because the previous algorithm is time-consuming in the compression process. The target war/jar package is obtained by two ways.

48、One is for the configuration files needed to modify-first decompress, then modify, last compress. The other is for all the remaining files, just copy these files in the original war/jar to the target by the byte stream. Because the number of all the remaining files is far more than that of modified

49、configuration files, so the efficiency is greatly raised 4-6.We made a intercomparison between two algorithms. Using the two algorithms makes Little difference onthe configuration time of war package. But they have large variations in configuring jar package. Because the file structure of jar is mor

50、e complicated than that of war. Of course, copy is easier. By using the optimized algorithm, the compression time of a common jar packet from initial 1-2 minutes reduced to a few seconds.2.3. Automatic DeploymentConfigTools automatic deployment function can be used separately, that is, user can not

51、use the function introduced in lesson 2.1 and 2.2. We define a flag in ConfigTool, when user uses the previous functions, flag=1, otherwise flag=0. If flag=1, ConfigTool use Hudson to complete the automatic construction of package which is decompressed in the automatic configuration process, then de

52、ploy the constructed application to the application server. If flag=0, user should select the program package to deploy first. In this section, we use Hudson which supports the distributed construction and abstract the application server consoles. Figure 3 is one of the application server consoles a

53、bstract interface 7-9.Figure 4 shows the ConfigTool whole automatic deployment process. First get the program package to deploy, then select the application server you want to deploy (eg: Tomcat/WebSphere), then use the Hudson make the automatic construction of the package, upload the constructed pr

54、ogram to the application server, according to programs construction structure to determine whether to deploy package warehouse 10. At the same time, apply the resource deployment and agent middleware container, then deploy the application package, after a little while, ConfigTool will return the acc

55、ess address and report that deployment is successful. Figure 3. The Abstract Interface of IBMWebSphere Application ServerFigure 4. Flow Chart of ConfigTools Automatic Deployment 3. Results and AnalysisConfigTool is a stand-alone program on auto-configuration and deployment tool implemented by Java,

56、regards XML file as information repositories, its core function is to automatically complete the configuration process from the original WAR/WAR package to the target ones. With the experience of the trial run in the oilfields of Petro China, using ConfigTool can smoothly manage the process of confi

57、guration and deployment of hundreds of sets of environment in dozens of areas currently. Table 1 shows the basic principle of the tool: Table 1. Principle of ConfigToolA represents the parameter library of oilfield, each oilfield has one library. B representsthe configuration template which is corre

58、sponding to one system. Its contents involve the configuration of development, test and production environment. C represents the directory of configuration files which are exactly corresponding to that of war/jar package. D represents target program package which consists of original package and the files in C.From left to rig

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論