锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日韩精品无码专区加勒比☆,亚洲日本中文字幕天天更新,鲁死你资源站亚洲avhttp://m.tkk7.com/persister/category/37332.htmlzh-cnMon, 13 Sep 2010 08:02:06 GMTMon, 13 Sep 2010 08:02:06 GMT60OFBiz鐨凪VC妗嗘灦http://m.tkk7.com/persister/archive/2010/08/27/253196.htmlpersisterpersisterFri, 27 Aug 2010 14:32:00 GMThttp://m.tkk7.com/persister/archive/2010/08/27/253196.htmlhttp://m.tkk7.com/persister/comments/253196.htmlhttp://m.tkk7.com/persister/archive/2010/08/27/253196.html#Feedback0http://m.tkk7.com/persister/comments/commentRss/253196.htmlhttp://m.tkk7.com/persister/services/trackbacks/253196.htmlOFBiz鏄竴涓潪甯稿己澶х殑浼佷笟鏋舵瀯浣撶郴錛岃繖閲屽彧鎻忚堪瀹僊VC鏂歸潰鐨勫唴瀹癸紝浠嶮VC鐨勮搴﹀幓鐪嬶紝OFBiz閲囩敤鐨勬槸Service to Worker妯″紡錛屽ぇ鍚嶉紟榧庣殑Struts 1閲囩敤鐨勪篃鏄繖縐嶆灦鏋勩係ervice to Worker妯″紡鐨勭洰鏍囧氨鏄淮鎶ction錛孷iew鍜孋ontroller涔嬮棿鐨勫垎紱匯?br />
Controller

ControlServlet鏄?a >Front Controller錛? 鎺ユ敹鎵鏈夌殑璇鋒眰錛屾槸璇鋒眰鐨勫叆鍙o紝鎵ц涓浜涚殑棰勫澶勭悊鍚庯紝浜ょ敱RequestHandler鍘誨鐞嗗疄闄呯殑璇鋒眰宸ヤ綔錛孷iew灞傜殑澶勭悊浜ょ粰 ViewHandler榪涜澶勭悊錛孷iewHandler鏈夊緢澶氬疄鐜扮被錛岃繕鍙互鑷畾涔夛紝鍙互闆嗘垚寰堝欏甸潰灞傛樉紺烘妧鏈紝濡侸SP鍜孎reeMarker絳夛紝 澶勭悊嫻佺▼濡備笅鍥炬墍紺猴細


MVC鐨勮В鑰︾殑鍦版柟灝辨槸閫氳繃controller.xml閰嶇疆鏂囦歡瀹炵幇鐨勶紝閰嶇疆鏂囦歡濡備笅鎵紺猴細

<request-map uri="login">
        
<security https="false" auth="false"/>
        
<event type="java" path="com.xxx.ldap.LdapLoginWorker" invoke="login"/>
        
<response name="success" type="view" value="main"/>
        
<response name="error" type="view" value="login"/>
</request-map>

<view-map name="main" type="screen" page="component://xxx/widget/CustomerScreens.xml#main"/>

<view-map name="login" type="screen" page="component://xxx/widget/CommonScreens.xml#login"/>

request-map鐨剅esponse鍏冪礌鏈変竴涓睘鎬ame錛岃繖涓猲ame鐞嗚涓婂彲浠ヤ換鎰忛夊彇錛屼笉榪嘜FBiz鍐呯疆浜唖uccess鍜? error榪欎袱涓鹼紝榪欑被浼間簬Struts 2銆傚睘鎬ype濡傛灉鏄痸iew琛ㄧず寰楀埌涓涓〉闈紝value鍊煎浜巚iew-map涓殑name灞炴у箋備箣鎵浠ヤ笉鐩存帴鍐欎笂欏甸潰錛岃屾槸澧炲姞view- map錛屼竴鏄負浜嗚В鑰︼紝浜屾槸閽堝涓嶅悓鐨剉iew錛屽彲浠ヨ緗笉鍚岀殑type絳夊睘鎬с倀ype灞炴у緢鍏抽敭錛屾鏄繖涓睘鎬у府鍔㎡FBiz闆嗘垚涓嶅悓鐨勬樉紺哄眰鎶鏈? common-controller瀹氫箟浜嗕笉鍚岀殑type鍜屽叾瀵瑰簲鐨刅iewHandler錛?/p>

    <!-- view handlers -->
    
<handler name="screen" type="view" class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>
    
<handler name="screenfop" type="view" class="org.ofbiz.widget.screen.ScreenFopViewHandler"/>
    
<handler name="screenxml" type="view" class="org.ofbiz.widget.screen.ScreenXmlViewHandler"/>
    
<handler name="screentext" type="view" class="org.ofbiz.widget.screen.ScreenTextViewHandler"/>
    
<handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/>
    
<handler name="ftl" type="view" class="org.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>   
    
<handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/>

榪欓噷鐨刵ame灝卞搴攙iew map涓殑type銆傚疄鐜拌В鑰︾殑綾諱笉鏄疐ront Controller鑰屾槸RequestHandler錛岃姹備唬鐞嗙被錛屽湪榪欓噷璐熻矗璇誨彇controller.xml鏂囦歡涓殑瀵瑰簲鍏崇郴錛屾牴鎹瓼ront Controller鍙戦佽繃鏉ョ殑璇鋒眰錛岄夋嫨鐩稿簲鐨勪笟鍔″姩浣滆繘琛屼笟鍔℃洿鏂幫紝騫朵笖閫夋嫨鐩稿簲鐨勮鍥綱iew鍘昏В鏋愬茍灞曠ず銆傚湪Service to Worker妯″紡涓紝RequestHandler綾葷殑瑙掕壊灝辨槸Dispatcher銆?br />


View
OFBiz鏀寔寰堝綾誨瀷鐨勯〉闈㈠睍紺烘妧鏈紝JSP/FreeMarker/Velocity/PDF/Widget絳夈侽FBiz鏈甯哥敤鐨勫氨鏄疻idget鍜?a >FreeMarker銆俉idget鏄疧FBiz鑷繁鐗規湁鐨勯〉闈㈡妧鏈紝濂藉灝辨槸鍙互涓嶇敤鍐欎換浣昲tml鍜宑ss浠g爜灝卞彲浠ュ緱鍒頒竴涓粺涓鐨勫畬鏁寸殑欏甸潰錛屽睍紺虹殑涓氬姟鏁版嵁涔熷彲浠ヨ交鏉劇殑鑾峰彇銆傜己鐐規槸錛氫笉鍍廎reeMarker鏄竴涓函欏甸潰鎶鏈紝浠巖equest鍜宻ession涓緱鍒頒笟鍔℃暟鎹紝鐒跺悗鐩存帴灝嗗叾灞曠ず澶勭悊銆俉idget鎶鏈皢涓氬姟鏁版嵁鑾峰彇鍜屼笟鍔℃暟鎹睍紺烘販鍦ㄤ竴璧鳳紝鍚庡彴寮鍙戜漢鍛樺拰欏甸潰璁捐浜哄憳涓嶈兘鍚堜綔鍒嗗伐錛岀敋鑷沖彧鏈夊悗鍙拌璁′漢鍛樻墠鑳藉紑鍙慜FBiz搴旂敤銆侽FBiz涔嬫墍浠ヨ璁¤嚜宸辯殑欏甸潰鎶鏈紝涓嶰FBiz瀹炵幇ERP/CRM澶嶆潅鐨勪笟鍔$郴緇熸椂鍒嗕笉寮鐨勩侲RP/CRM涓氬姟緋葷粺澶嶆潅澶氬彉錛屾ā鍧椾紬澶氥備粈涔堟牱鐨勬鏋惰兘澶熸弧瓚寵繖鏍風殑緋葷粺鍛細涓鏄傚簲涓氬姟鍙樺寲錛岀浜岄傚悎蹇熷紑鍙戯紝絎笁欏甸潰椋庢牸鑳藉涓鑷淬侽FBiz灝辨槸榪欐牱鐨勬鏋訛紝entity娣誨姞鍑忓皯涓涓瓧孌碉紝鍦∣FBiz涓彧闇瑕佸湪entitymodel涓仛淇敼錛屽湪杈撳叆欏甸潰錛屾樉紺洪〉闈紝淇敼欏甸潰閮戒笉鐢ㄥ仛浠諱綍鐨勪慨鏀瑰氨鍙互鐪嬪埌鍙樺寲錛岃屼笖涓氬姟閫昏緫妯″潡涔熶笉鐢ㄤ慨鏀瑰氨鍙互瀵瑰彉鍖栫殑瀛楁榪涜緇存姢錛岄潪甯哥殑Easy銆侽FBiz閫傚悎蹇熷紑鍙戯紝鐔熸倝浜哋FBiz寮鍙戠殑浜哄憳錛屽紑鍙戜竴涓狢ustomer妯″潡錛屽鐢ㄦ埛榪涜澧炲垹鏀瑰拰澶嶆潅鐨勬煡璇紝涓涓皬鏃惰凍澶燂紝澶熷揩浜嗗惂銆傜敱浜庝笉鐩存帴鎿嶄綔html鍜宑ss浠g爜錛屼嬌鐢∣FBiz寮鍙戠殑鍚勪釜妯″潡閮介暱寰椾竴鏍鳳紝榪欐槸寰堝璁捐浜哄憳鏈熸湜鐨勩傝█褰掓浼狅紝榪樻槸浠庢妧鏈笂鍒嗘瀽View鐨勮璁°傚墠闈㈣浜嗛氳繃瀹炵幇ViewHandler鎺ュ彛錛孫FBiz闆嗘垚浜嗕笉鍚岀殑欏甸潰鎶鏈互渚涢夋嫨銆傜浉鍏崇殑綾誨叧緋誨浘濡備笅錛?br />
View Handler:



ViewHandler璐熻矗閫夋嫨鐩稿簲鐨凴enderer錛岃繘琛岄〉闈㈡樉紺虹殑鍑嗗宸ヤ綔,瀵逛簬綆鍗曠殑欏甸潰鎶鏈JSP錛孞spViewHandler鐩存帴榪涜澶勭悊錛屼笉鍐嶅鎵樼粰鍏朵粬Renderer榪涜澶勭悊銆侫bstractViewHandler鐨勫瓙綾諱腑錛屽寘鍚玈creen瀛楃溂鐨凥andler閫氬父鐩稿杈冨鏉傦紝瑙佷笂鍥句腑涓嬮潰鍝簺Handler錛屽吀鍨嬬殑鏄疭creenWidgetViewHandler銆?br />
View Renderer:



Renderer璐熻矗鍏蜂綋鐨勬樉紺哄伐浣溿?br />

鏈畬寰呯畫






persister 2010-08-27 22:32 鍙戣〃璇勮
]]>
OFBiz涓璊OB鐨勮繍琛屾満鍒?/title><link>http://m.tkk7.com/persister/archive/2010/02/26/313974.html</link><dc:creator>persister</dc:creator><author>persister</author><pubDate>Fri, 26 Feb 2010 03:17:00 GMT</pubDate><guid>http://m.tkk7.com/persister/archive/2010/02/26/313974.html</guid><wfw:comment>http://m.tkk7.com/persister/comments/313974.html</wfw:comment><comments>http://m.tkk7.com/persister/archive/2010/02/26/313974.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/persister/comments/commentRss/313974.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/persister/services/trackbacks/313974.html</trackback:ping><description><![CDATA[OFBiz鎵ц鍚庡彴浠誨姟鐨勭被鍦╫rg.ofbiz.service.job涓?br /> <br /> JobPoller鍜孞obInvoker鏄富瑕佺殑涓や釜綾伙紝涓涓礋璐f煡璇㈠彲浠ユ墽琛岀殑Job錛屽彟涓涓墽琛孞ob浠誨姟銆侸ob綾誨浘濡備笅鎵紺恒?br /> <br /> <img alt="" src="http://m.tkk7.com/images/blogjava_net/persister/job1.JPG" width="504" height="314" /><br /> <br /> <strong>1.Job杞</strong><br /> <br /> 鍒涘緩JobManager鏃訛紝浼氬垱寤篔obPoller鐨勪竴涓疄渚嬨侸obPoller瀹炵幇浜哛unnable鎺ュ彛錛屼互姝ゅ垱寤虹嚎紼嬪悗<br /> 閫氳繃JobManager涓鐩磋疆璇㈡槸鍚︽湁Job闇瑕佹墽琛岋紝濡傛灉鏈夊灝嗗叾鏀懼叆闃熷垪涓?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">synchronized</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> run() {<br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> wait 30 seconds before the first poll</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">            java.lang.Thread.sleep(</span><span style="color: rgb(0, 0, 0);">30000</span><span style="color: rgb(0, 0, 0);">);<br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">        } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (InterruptedException e) {<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);"> (isRunning) {<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> grab a list of jobs to run.</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">                List</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">Job</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> pollList </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> jm.poll();<br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Debug.logInfo("Received poll list from JobManager [" + pollList.size() + "]", module);</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (Job job : pollList) {<br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">                    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (job.isValid()) {<br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">                        queueNow(job);<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);">                        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Debug.logInfo("Job [" + job.getJobId() + "] is queued", module);</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">                    }<br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);">                }<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> NOTE: using sleep instead of wait for stricter locking</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);">                java.lang.Thread.sleep(pollWaitTime());<br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">            } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (InterruptedException e) {<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">                Debug.logError(e, module);<br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);">                stop();<br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">27</span> </div> <br /> queueNow鏂規硶灝嗚鎵цjob鏀懼叆鍒伴槦鍒椾腑錛屽鏋滈槦鍒椾腑鐨勭瓑寰呮墽琛岀殑job鏁伴噺寰堝錛岄偅涔堝氨鍒涘緩涓瀹氭暟閲忕殑綰跨▼鎵ц榪欎簺job銆?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> queueNow(Job job) {<br />  </span>2<span style="color: rgb(0, 0, 0);">         </span><span style="color: rgb(0, 0, 255);">synchronized</span><span style="color: rgb(0, 0, 0);"> (run) {<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">            run.add(job);<br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (Debug.verboseOn()) Debug.logVerbose(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">New run queue size: </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> run.size(), module);<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (run.size() </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> pool.size() </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> pool.size() </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> maxThreads()) {<br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">synchronized</span><span style="color: rgb(0, 0, 0);"> (pool) {<br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (run.size() </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> pool.size() </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> pool.size() </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> maxThreads()) {<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);">                    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> calcSize </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (run.size() </span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);"> jobsPerThread()) </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);"> (pool.size());<br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">                    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> addSize </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> calcSize </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> maxThreads() </span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);"> maxThreads() : calcSize;<br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">                    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> addSize; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);">                        JobInvoker iv </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> JobInvoker(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">, invokerWaitTime());<br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">                        pool.add(iv);<br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);">                    }<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);">                }<br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span></div> <br /> JobInvoker灝辨槸鎵ц鐨勭嚎紼嬶紝瀹冧粠queue涓彇job騫舵墽琛屻侸obInvoker綰跨▼涓嶆槸涓鐩磋繍琛屼笅鍘伙紝榪愯鐨勬椂闂撮暱搴﹁秴榪囦竴瀹氱殑鍊鹼紙瑙乻erviceengine.xml涓璽tl鐨勫鹼級綰跨▼灝變細鍋滄騫朵粠pool涓垹闄ゃ侸obInvoker鐨剅un鏂規硶涓璲ob.exec()鎵ц鍏蜂綋鐨勪換鍔°?br /> <br /> <br /> <strong>2.Job鎵ц</strong><br /> <br /> Job綾婚兘鏈変竴涓猠xec鏂規硶錛岀敤鎴鋒墽琛孞ob鐨剆ervice銆傚GenericServiceJob涓殑exec鏂規硶濡備笅錛?br /> <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> exec() </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> InvalidJobException {<br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">        init();<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> no transaction is necessary since runSync handles this</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> get the dispatcher and invoke the service via runSync -- will run all ECAs</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">            LocalDispatcher dispatcher </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> dctx.getDispatcher();<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">            Map</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">String, Object</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> result </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> dispatcher.runSync(getServiceName(), getContext());<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> check for a failure</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> isError </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> ModelService.RESPOND_ERROR.equals(result.get(ModelService.RESPONSE_MESSAGE));<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (isError) {<br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">                 String errorMessage </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (String) result.get(ModelService.ERROR_MESSAGE);<br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">                 </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.failed(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Exception(errorMessage));<br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (requester </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);">                requester.receiveResult(result);<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">        } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Throwable t) {<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> pass the exception back to the requester.</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (requester </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">) {<br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">                requester.receiveThrowable(t);<br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">27</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> call the failed method</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">28</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.failed(t);<br /> </span><span style="color: rgb(0, 128, 128);">29</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">30</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">31</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> call the finish method</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">32</span> <span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.finish();<br /> </span><span style="color: rgb(0, 128, 128);">33</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">34</span> </div> <br /> 鍦ㄦ墽琛宻ervice鎵ц錛屾湁涓涓猧nit鏂規硶錛屽湪PersistedServiceJob綾諱腑init鏂規硶涓昏鏄敓鎴愪笅涓涓墽琛岀殑浠誨姟錛屽鏋滄湁鐨勮瘽銆備篃鍗蟲槸璇存瘡涓涓猨ob鏄敱褰撴椂鎵ц鐨勮繖涓猨ob鐢熸垚鐨勶紝鏍規嵁鏄粈涔堝憿錛熶富瑕佹槸涓や釜鍙橀噺錛歵empExprId鍜宮axRecurrenceCount錛宨nit鏂規硶涓細<br />     <br /> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);">    TemporalExpression expr </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">    ……<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (expr </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> UtilValidate.isNotEmpty(job.getString(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">tempExprId</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">))) {<br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">                expr </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> TemporalExpressionWorker.getTemporalExpression(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.delegator, job.getString(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">tempExprId</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">            } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (GenericEntityException e) {<br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">                </span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> RuntimeException(e.getMessage());<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">            }<br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">        }<br /> </span><span style="color: rgb(0, 128, 128);">11</span> </div> <br /> TemporalExpressionWorker閲岄潰鏈変竴涓猰akeTemporalExpression鏂規硶寰堥噸瑕侊紝浠庤繖涓柟娉曞彲浠ョ煡閬撴庝箞閰嶇疆TemporalExpression瀹炰綋鏁版嵁浜嗭紝褰撶劧瑕佺粨鍚圱emporalExpressions綾伙紝閲岄潰瀹氫箟浜嗗悇縐嶉厤緗殑緇嗚妭銆?br /> <br /> tempExprTypeId鏈夊涓嬪嚑縐嶏細<br /> <br /> DateRange<br /> DayInMonth<br /> DayOfMonthRange<br /> DayOfWeekRange<br /> Difference<br /> Frequency<br /> Intersection<br /> MonthRange<br /> TimeOfDayRange<br /> Union<br /> <br /> 姣斿濡傛灉甯屾湜鏈嶅姟鍙墽琛屼竴嬈★紝鍙互濡備笅閰嶇疆錛?br />     <TemporalExpression tempExprId="RUNONCE" tempExprTypeId="FREQUENCY" integer1="1" integer2="1"/><br />     <JobSandbox jobId="CurrencyRateSynAll" jobName="Currency Rate SynAll" runTime="2010-02-26 09:38:00.000" serviceName="currencyRateSynAll" poolId="pool" runAsUser="system" tempExprId="RUNONCE" maxRecurrenceCount="0"/><br /> <br /> maxRecurrenceCount="0" 琛ㄧず錛屼笉閲嶅銆倀empExprTypeId="FREQUENCY" integer1="1" integer2="1"琛ㄧず涓騫存墽琛屼竴嬈°傛墍浠ユ誨叡鎵ц涓嬈″氨緇撴潫浜嗐?br /> <br /> 姣忓ぉ閮芥墽琛屽彲浠ヨ繖鏍烽厤緗細<br /> <br /> <TemporalExpression tempExprId="MIDNIGHT_DAILY" tempExprTypeId="TIME_OF_DAY_RANGE" string1="20:00:00" string2="20:00:00"/><br />     <JobSandbox jobId="MailNotification" jobName="Mail Notification Job" runTime="2010-02-25 18:00:00.000" serviceName="mailNotificantion" poolId="pool" runAsUser="system" tempExprId="MIDNIGHT_DAILY" maxRecurrenceCount="-1"/><br /> <br /> maxRecurrenceCount="-1"琛ㄧず鏃犻檺寰幆涓嬪幓銆倀empExprId="MIDNIGHT_DAILY" tempExprTypeId="TIME_OF_DAY_RANGE" string1="20:00:00" string2="20:00:00"/>琛ㄧず姣忓ぉ鏅氫笂鍏偣鎵ц銆?br /> <br /> 姣忎釜鏈堜竴嬈′換鍔″彲浠ュ涓嬮厤緗細<br /> <br /> <TemporalExpression tempExprId="ONCEINMONTH" tempExprTypeId="FREQUENCY" date1="2010-02-26 11:05:00.000" integer1="2" integer2="1"/><br />     <JobSandbox jobId="CurrencyRateSyn" jobName="Currency Rate Syn" runTime="2010-02-26 11:05:00.000" serviceName="currencyRateSyn" poolId="pool" runAsUser="system" tempExprId="ONCEINMONTH" maxRecurrenceCount="-1"/><br /> <br /> tempExprTypeId="FREQUENCY" date1="2010-02-26 11:05:00.000" integer1="2" integer2="1"琛ㄧず姣忔湀涓嬈★紝鏃墮棿灝辨槸date1瀹氫箟鐨勬椂闂達紝濡傛灉娌$敤瀹氫箟date1錛岄偅涔堝氨鏄綋鍓嶆椂闂淬?br /> <br /> 榪欓噷鐨勯厤緗浉褰撶伒媧伙紝濂藉ソ鎺屾彙銆?br />     <br /> <img src ="http://m.tkk7.com/persister/aggbug/313974.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/persister/" target="_blank">persister</a> 2010-02-26 11:17 <a href="http://m.tkk7.com/persister/archive/2010/02/26/313974.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>OFBiz涓璼ervices璋冪敤鏈哄埗http://m.tkk7.com/persister/archive/2010/02/24/313799.htmlpersisterpersisterWed, 24 Feb 2010 07:19:00 GMThttp://m.tkk7.com/persister/archive/2010/02/24/313799.htmlhttp://m.tkk7.com/persister/comments/313799.htmlhttp://m.tkk7.com/persister/archive/2010/02/24/313799.html#Feedback0http://m.tkk7.com/persister/comments/commentRss/313799.htmlhttp://m.tkk7.com/persister/services/trackbacks/313799.html
    LocalDispatcher dispatcher = dctx.getDispatcher();
    Map<String, Object> result = dispatcher.runSync(getServiceName(), getContext());

LocalDispatcher鏄湰鍦拌皟搴﹀櫒錛屽疄鐜版湇鍔$殑鍚屾寮傛璋冨害鍜屽畾鏃朵換鍔$殑璋冨害銆備笌鏈嶅姟璋冨害鐩稿叧鐨勭被鍥懼涓嬶細



LocalDispatcher鏄竴涓帴鍙o紝瀹炰緥鍖栫殑閮芥槸GenericDispatcher綾伙紝ContextFilter瀹炵幇浜哠ervlet Filter錛屼細鍒濆鍖栦竴涓狦enericDispatcher,騫跺皢鍏跺瓨鏀懼湪ServletContext涓紝浠ュ鏁翠釜搴旂敤浣跨敤銆?br /> 鍦ㄨ姹傚鐞嗚繃紼嬩腑錛屽鏋滈亣鍒皊ervice鐨別vent錛岄偅涔圗ventHandler浼氫嬌鐢↙ocalDispatcher鎵цservice銆?br /> 瀹為檯涓奊enericDispatcher鍙槸涓涓狿roxy錛岃嚜宸卞茍涓嶅鐞嗙浉鍏崇殑璋冨害宸ヤ綔錛岀湡姝f渶鑻︽渶绱殑璋冨害宸ヤ綔鏄敱ServiceDispatcher瀹屾垚鐨勩備笅闈㈠叿浣撶爺絀朵竴涓婦ispatcher鍚屾鍜屽紓姝ヨ皟鐢ㄦ柟娉曠殑瀹炵幇浠g爜錛?br />
1.鍚屾璋冪敤

閫氳繃dispatcher璋冪敤runSync鏂規硶錛屼篃鍗蟲槸璋冪敤GenericDispatcher鐨剅unSync鏂規硶錛?br />     
        /**
         * @see org.ofbiz.service.LocalDispatcher#runSync(java.lang.String, java.util.Map)
         */
        public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context)
        throws ServiceValidationException, GenericServiceException
        {
            ModelService service = ctx.getModelService(serviceName);
            return dispatcher.runSync(this.name, service, context);
        }

dispatcher瀹為檯鏄疭erviceDispatcher瀵硅薄銆係erviceDispatcher鐨剅unSync鏂規硶鏈変笁鐧懼琛岋紝姣旇緝澶嶆潅錛?br /> 浣嗘渶緇堣皟鐢╯ervice鐨勬槸GenericEngine銆?br />
    GenericEngine engine = this.getGenericEngine(modelService.engineName);
    ……
    
    Map<String, Object> invokeResult = engine.runSync(localName, modelService, context);
  
GenericEngine鏄叾宸ュ巶綾籊enericEngineFactory鑾峰彇鐨勶紝榪欎釜Factory綾婚潪甯哥畝鍗曪細

public class GenericEngineFactory {

    protected ServiceDispatcher dispatcher = null;
    protected Map<String, GenericEngine> engines = null;

    public GenericEngineFactory(ServiceDispatcher dispatcher) {
        this.dispatcher = dispatcher;
        engines = FastMap.newInstance();
    }

    /**
     * Gets the GenericEngine instance that corresponds to given the name
     *@param engineName Name of the engine
     *@return GenericEngine that corresponds to the engineName
     */
    public GenericEngine getGenericEngine(String engineName) throws GenericServiceException {
        Element rootElement = null;

        try {
            rootElement = ServiceConfigUtil.getXmlRootElement();
        } catch (GenericConfigException e) {
            throw new GenericServiceException("Error getting Service Engine XML root element", e);
        }
        Element engineElement = UtilXml.firstChildElement(rootElement, "engine", "name", engineName);

        if (engineElement == null) {
            throw new GenericServiceException("Cannot find a service engine definition for the engine name [" + engineName + "] in the serviceengine.xml file");
        }

        String className = engineElement.getAttribute("class");

        GenericEngine engine = engines.get(engineName);

        if (engine == null) {
            synchronized (GenericEngineFactory.class) {
                engine = engines.get(engineName);
                if (engine == null) {
                    try {
                        ClassLoader loader = Thread.currentThread().getContextClassLoader();
                        Class<?> c = loader.loadClass(className);
                        Constructor cn = c.getConstructor(ServiceDispatcher.class);
                        engine = (GenericEngine) cn.newInstance(dispatcher);
                    } catch (Exception e) {
                        throw new GenericServiceException(e.getMessage(), e);
                    }
                    if (engine != null) {
                        engines.put(engineName, engine);
                    }
                }
            }
        }

        return engine;
    }
}

浠庨厤緗枃浠秙erviceengine.xml鏂囦歡涓幏鍙栫浉搴旂殑engine瀛愮被錛屽java鐨勬槸org.ofbiz.service.engine.StandardJavaEngine
bsh鐨勬槸org.ofbiz.service.engine.BeanShellEngine銆?br />
Java鐨凷tandardJavaEnignerunSync鏂規硶閲囩敤鐨勬槸鍙嶅皠鏉ユ墽琛岀浉搴旂殑鏂規硶錛屽涓嬶細

        Class<?> c = cl.loadClass(this.getLocation(modelService));
            Method m = c.getMethod(modelService.invoke, DispatchContext.class, Map.class);
            result = m.invoke(null, dctx, context);
            
涓嶅悓鐨凟ngine瀹炵幇鐨勬柟寮忎笉涓鏍楓?br />
2. 寮傛璋冪敤

寮傛璋冪敤鎬庝箞瀹炵幇鐨勫憿錛熷疄鐜板紓姝ョ殑鍘熺悊灝辨槸鍚姩涓涓嚎紼嬫潵鎵ц鐩稿簲鐨勪笟鍔¢昏緫錛屽師鏂規硶鐩存帴榪斿洖錛屼粠鑰屽疄鐜板紓姝ャ傚叿浣撳疄鐜扮殑鏃跺欏彲浠ユ牴鎹疄闄呮儏鍐佃屽畾錛屾瘮濡傚皢涓氬姟閫昏緫灝佽鎴愪竴涓換鍔★紝灝嗘浠誨姟鏀懼埌涓涓換鍔¢摼涓紝綰跨▼姹犻噰鐢ㄥ厛榪涘厛鍑虹殑鏂瑰紡鏉ラ夋嫨浠誨姟榪涜鎵ц銆侽FBiz涓庝箞瀹炵幇鍛紵鍏蜂綋鏌ョ湅GenericAsyncEngine鐨剅unAsync鏂規硶鍙戠幇鏄氳繃涓涓敓鎴愪竴涓狫ob鏉ュ疄鐜扮殑錛?br />
        job = new GenericServiceJob(dctx, jobId, name, modelService.name, context, requester);
        try {
            dispatcher.getJobManager().runJob(job);
        } catch (JobManagerException jse) {
            throw new GenericServiceException("Cannot run job.", jse);
        }
瀵逛簬Job鐨勬墽琛岋紝鎰熷叴瓚g殑鍙互鐪嬫垜鐨勫彟涓綃囨枃绔?a href="http://m.tkk7.com/persister/archive/2010/02/26/313974.html">OFBiz涓璊ob鐨勮繍琛屾満鍒?/a>銆?br />



persister 2010-02-24 15:19 鍙戣〃璇勮
]]>
OFBiz鐨勪腑鏂囦貢鐮佽В鍐蟲柟妗?/title><link>http://m.tkk7.com/persister/archive/2009/08/10/290568.html</link><dc:creator>persister</dc:creator><author>persister</author><pubDate>Mon, 10 Aug 2009 08:58:00 GMT</pubDate><guid>http://m.tkk7.com/persister/archive/2009/08/10/290568.html</guid><wfw:comment>http://m.tkk7.com/persister/comments/290568.html</wfw:comment><comments>http://m.tkk7.com/persister/archive/2009/08/10/290568.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/persister/comments/commentRss/290568.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/persister/services/trackbacks/290568.html</trackback:ping><description><![CDATA[<p>OFBiz寮鍙戞椂閬囧埌涔辯爜鐨勯棶棰橈紝MySQL鏁版嵁搴撴彃鍏ヤ腑鏂囨暟鎹椂鍑虹幇浜嗕竴涓棶棰橈紝鎶ュ憡涓枃閿欒錛歩ncorrect string value 錛庯紟錛庯紟錛?/p> <p>1.榪欐椂鐢變簬瀛楃緙栫爜涓嶄竴鑷村鑷寸殑錛屽簲璇ュ皢鏁版嵁搴撳搴旂殑琛ㄦ垨coloum鏀規垚uft-8錛屾墍浠ュ鏋滃湪CustomerExtra榪欒〃涓瓨鍌ㄤ腑鏂囩殑璇濓紝闇瑕佸皢<br />   姝よ〃鍙﹀榪樻湁operationlog琛ㄧ殑charset鏀規垚utf-8</p> <p>2.Servlet涓瓧絎︽樉紺轟負璇佸埜鐨勪腑鏂囷紝鑰屼笖琛ㄤ篃璁劇疆涓簎tf-8錛屼絾鏄暟鎹簱鍜岄〉闈㈣繕鏄貢鐮侊紝鎬庝箞鍥炰簨錛?br />   榪欓噷闇瑕佷慨鏀筳dbc url鐨勫弬鏁幫紝濡傚皢jdbc:mysql://localhost/ccbportal?zeroDateTimeBehavior=convertToNull<br />   鏀規垚錛歫dbc:mysql://localhost/ccbportal?zeroDateTimeBehavior=convertToNull&amp;useUnicode=true&amp;characterEncoding=UTF-8</p> <p>3.鍓嶅彴杈撳叆鐨勬槸涓枃錛屽埌鍚庡彴灝卞彉鎴愪簡涔辯爜錛屾庝箞鍥炰簨錛?br />   鏃犺浣曠琛ㄥ崟鎻愪氦閮藉彲浠ュ湪鍚庡彴鐨刯ava鏂囦歡涓氳繃String des = new String(s.getBytes("iso8859-1"),"UTF-8");<br />   鏉ヨ漿鎹㈡垚浣犳兂瑕佺殑UTF錛?緙栫爜鏂瑰紡銆備絾濡傛灉姣忓閮藉姞璇嶅彞澶夯鐑︼紝鏁呭垎post鍜実et涓ょ鏂瑰紡鍖哄垎鎻愪氦銆?br />   鍐欎竴涓狥ilter鍗沖彲瑙e喅闂錛?br />   </p> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);"> import java.io.IOException;<br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);"> import javax.servlet.ServletException;<br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);"> import javax.servlet.Filter;<br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);"> import javax.servlet.FilterChain;<br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);"> import javax.servlet.FilterConfig;<br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);"> import javax.servlet.ServletRequest;<br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);"> import javax.servlet.ServletResponse;<br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);"> public class SetCharacterEncodingFilter implements Filter {<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">  protected String encoding = "GBK";<br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">  protected FilterConfig filterConfig = null;<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">  protected boolean ignore = true;<br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);">  public void init(FilterConfig filterConfig) throws ServletException {<br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);">   this.filterConfig = filterConfig;<br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">   this.encoding = filterConfig.getInitParameter("encoding");<br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">   String value = filterConfig.getInitParameter("ignore");<br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);">   if (value == null)<br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">    this.ignore = true;<br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">   else if (value.equalsIgnoreCase("true"))<br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);">    this.ignore = true;<br /> </span><span style="color: rgb(0, 128, 128);">27</span> <span style="color: rgb(0, 0, 0);">   else if (value.equalsIgnoreCase("yes"))<br /> </span><span style="color: rgb(0, 128, 128);">28</span> <span style="color: rgb(0, 0, 0);">    this.ignore = true;<br /> </span><span style="color: rgb(0, 128, 128);">29</span> <span style="color: rgb(0, 0, 0);">   else<br /> </span><span style="color: rgb(0, 128, 128);">30</span> <span style="color: rgb(0, 0, 0);">    this.ignore = false;<br /> </span><span style="color: rgb(0, 128, 128);">31</span> <span style="color: rgb(0, 0, 0);">  }<br /> </span><span style="color: rgb(0, 128, 128);">32</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">33</span> <span style="color: rgb(0, 0, 0);">  public void doFilter(ServletRequest request, ServletResponse response,<br /> </span><span style="color: rgb(0, 128, 128);">34</span> <span style="color: rgb(0, 0, 0);">    FilterChain chain) throws IOException, ServletException {<br /> </span><span style="color: rgb(0, 128, 128);">35</span> <span style="color: rgb(0, 0, 0);">   // Conditionally select and set the character encoding to be used<br /> </span><span style="color: rgb(0, 128, 128);">36</span> <span style="color: rgb(0, 0, 0);">   if (ignore || (request.getCharacterEncoding() == null)) {<br /> </span><span style="color: rgb(0, 128, 128);">37</span> <span style="color: rgb(0, 0, 0);">    String encoding = selectEncoding(request);<br /> </span><span style="color: rgb(0, 128, 128);">38</span> <span style="color: rgb(0, 0, 0);">    if (encoding != null) {<br /> </span><span style="color: rgb(0, 128, 128);">39</span> <span style="color: rgb(0, 0, 0);">     request.setCharacterEncoding(encoding);<br /> </span><span style="color: rgb(0, 128, 128);">40</span> <span style="color: rgb(0, 0, 0);">    }<br /> </span><span style="color: rgb(0, 128, 128);">41</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">42</span> <span style="color: rgb(0, 0, 0);">   }<br /> </span><span style="color: rgb(0, 128, 128);">43</span> <span style="color: rgb(0, 0, 0);">   // Pass control on to the next filter<br /> </span><span style="color: rgb(0, 128, 128);">44</span> <span style="color: rgb(0, 0, 0);">   chain.doFilter(request, response);<br /> </span><span style="color: rgb(0, 128, 128);">45</span> <span style="color: rgb(0, 0, 0);">  }<br /> </span><span style="color: rgb(0, 128, 128);">46</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">47</span> <span style="color: rgb(0, 0, 0);">  protected String selectEncoding(ServletRequest request) {<br /> </span><span style="color: rgb(0, 128, 128);">48</span> <span style="color: rgb(0, 0, 0);">   return (this.encoding);<br /> </span><span style="color: rgb(0, 128, 128);">49</span> <span style="color: rgb(0, 0, 0);">  }<br /> </span><span style="color: rgb(0, 128, 128);">50</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">51</span> <span style="color: rgb(0, 0, 0);">  public void destroy() {<br /> </span><span style="color: rgb(0, 128, 128);">52</span> <span style="color: rgb(0, 0, 0);">   this.encoding = null;<br /> </span><span style="color: rgb(0, 128, 128);">53</span> <span style="color: rgb(0, 0, 0);">   this.filterConfig = null;<br /> </span><span style="color: rgb(0, 128, 128);">54</span> <span style="color: rgb(0, 0, 0);">  }<br /> </span><span style="color: rgb(0, 128, 128);">55</span> <span style="color: rgb(0, 0, 0);"> }<br /> </span><span style="color: rgb(0, 128, 128);">56</span> <span style="color: rgb(0, 0, 0);">  <br /> </span></div> <p><br /> web.xml娣誨姞姝ilter錛?br /> </p> <div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">encodeFilter</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> com.aicent.ccb.filter.SetCharacterEncodingFilter</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">encoding</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">GBK</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">ignore</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">true</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">encodeFilter</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/control/*</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">  <br /> </span></div> <p> </p> <img src ="http://m.tkk7.com/persister/aggbug/290568.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/persister/" target="_blank">persister</a> 2009-08-10 16:58 <a href="http://m.tkk7.com/persister/archive/2009/08/10/290568.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍒嗗竷寮忎簨鍔″強鍏跺湪OFBiz鐨勫疄鐜?/title><link>http://m.tkk7.com/persister/archive/2009/04/19/266439.html</link><dc:creator>persister</dc:creator><author>persister</author><pubDate>Sun, 19 Apr 2009 10:01:00 GMT</pubDate><guid>http://m.tkk7.com/persister/archive/2009/04/19/266439.html</guid><wfw:comment>http://m.tkk7.com/persister/comments/266439.html</wfw:comment><comments>http://m.tkk7.com/persister/archive/2009/04/19/266439.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/persister/comments/commentRss/266439.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/persister/services/trackbacks/266439.html</trackback:ping><description><![CDATA[<span style="font-size: 10pt;"><span style="font-size: 10pt;"> <strong>1銆佸垎甯冨紡浜嬪姟鐩稿叧姒傚康</strong><br /> <span style="font-size: small;">鍒嗗竷寮忎簨鍔″鐞嗭紙Distributed Transaction Processing錛孌TP錛夋槸鎸囦竴涓簨鍔″彲鑳芥秹鍙婂涓暟鎹簱鎿嶄綔錛屽垎甯冨紡浜嬪姟澶勭悊鐨勫叧閿槸蹇呴』鏈変竴縐嶆柟娉曞彲浠ョ煡閬撲簨鍔″湪浠諱綍鍦版柟鎵鍋氱殑鎵鏈夊姩浣滐紝鎻愪氦鎴栧洖婊氫簨鍔$殑鍐沖畾蹇呴』浜х敓緇熶竴鐨勭粨鏋滐紙鍏ㄩ儴鎻愪氦鎴栧叏閮ㄥ洖婊氾級銆?/span><span style="font-family: "Courier New";"><br /> </span><span style="font-size: small;"><span style="font-family: "Courier New";"> X/Open </span>緇勭粐錛堝嵆鐜板湪鐨?span style="font-family: "Courier New";"> Open Group </span>錛夊畾涔変簡鍒嗗竷寮忎簨鍔″鐞嗘ā鍨嬨?span style="font-family: "Courier New";"> X/Open DTP </span>妯″瀷錛?span style="font-family: "Courier New";"> 1994 </span>錛夊寘鎷簲鐢ㄧ▼搴忥紙<span style="font-family: "Courier New";"> AP </span>錛夈佷簨鍔$鐞嗗櫒錛?span style="font-family: "Courier New";"> TM </span>錛夈佽祫婧愮鐞嗗櫒錛?span style="font-family: "Courier New";"> RM </span>錛夈侀氫俊璧勬簮綆$悊鍣紙<span style="font-family: "Courier New";"> CRM </span>錛夊洓閮ㄥ垎銆備竴鑸紝甯歌鐨勪簨鍔$鐞嗗櫒錛?span style="font-family: "Courier New";"> TM </span>錛夋槸浜ゆ槗涓棿浠訛紝甯歌鐨勮祫婧愮鐞嗗櫒錛?span style="font-family: "Courier New";"> RM </span>錛夋槸鏁版嵁搴擄紝甯歌鐨勯氫俊璧勬簮綆$悊鍣紙<span style="font-family: "Courier New";"> CRM </span>錛夋槸娑堟伅涓棿浠躲?/span><span style="font-family: "Courier New";"><br /> </span><span style="font-size: small;">銆銆閫氬父鎶婁竴涓暟鎹簱鍐呴儴鐨勪簨鍔″鐞嗭紝濡傚澶氫釜琛ㄧ殑鎿嶄綔錛屼綔涓烘湰鍦頒簨鍔$湅寰呫傛暟鎹簱鐨勪簨鍔″鐞嗗璞℃槸鏈湴浜嬪姟錛岃屽垎甯冨紡浜嬪姟澶勭悊鐨勫璞℃槸鍏ㄥ眬浜嬪姟銆?/span><br /> <p style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span>    鎵璋撳叏灞浜嬪姟錛屾槸鎸囧垎甯冨紡浜嬪姟澶勭悊鐜涓紝澶氫釜鏁版嵁搴撳彲鑳介渶瑕佸叡鍚屽畬鎴愪竴涓伐浣滐紝榪欎釜宸ヤ綔鍗蟲槸涓涓叏灞浜嬪姟錛屼緥濡傦紝涓涓簨鍔′腑鍙兘鏇存柊鍑犱釜涓嶅悓鐨勬暟鎹簱銆傚 鏁版嵁搴撶殑鎿嶄綔鍙戠敓鍦ㄧ郴緇熺殑鍚勫浣嗗繀欏誨叏閮ㄨ鎻愪氦鎴栧洖婊氥傛鏃朵竴涓暟鎹簱瀵硅嚜宸卞唴閮ㄦ墍鍋氭搷浣滅殑鎻愪氦涓嶄粎渚濊禆鏈韓鎿嶄綔鏄惁鎴愬姛錛岃繕瑕佷緷璧栦笌鍏ㄥ眬浜嬪姟鐩稿叧鐨勫叾瀹? 鏁版嵁搴撶殑鎿嶄綔鏄惁鎴愬姛錛屽鏋滀換涓鏁版嵁搴撶殑浠諱竴鎿嶄綔澶辮觸錛屽垯鍙備笌姝や簨鍔$殑鎵鏈夋暟鎹簱鎵鍋氱殑鎵鏈夋搷浣滈兘蹇呴』鍥炴粴銆?/span>  <br /> </span></p> <p style="margin: 0cm 0cm 0pt;"><span style="font-size: small;">   涓鑸儏鍐典笅錛屾煇涓鏁版嵁搴撴棤娉曠煡閬撳叾瀹冩暟鎹簱鍦ㄥ仛浠涔堬紝鍥犳錛屽湪涓涓?span style="font-family: "Courier New";"> DTP </span>鐜涓紝浜ゆ槗涓棿浠舵槸蹇呴渶鐨勶紝鐢卞畠閫氱煡鍜屽崗璋冪浉鍏蟲暟鎹簱鐨勬彁浜ゆ垨鍥炴粴銆傝屼竴涓暟鎹簱鍙皢鍏惰嚜宸辨墍鍋氱殑鎿嶄綔錛堝彲鎭㈠錛夊獎灝勫埌鍏ㄥ眬浜嬪姟涓?/span></p> <span style="font-size: small;"><span style="font-family: "Courier New";">   XA </span>灝辨槸<span style="font-family: "Courier New";"> X/Open DTP </span>瀹氫箟鐨勪氦鏄撲腑闂翠歡涓庢暟鎹簱涔嬮棿鐨勬帴鍙h鑼冿紙鍗蟲帴鍙e嚱鏁幫級錛屼氦鏄撲腑闂翠歡鐢ㄥ畠鏉ラ氱煡鏁版嵁搴撲簨鍔$殑寮濮嬨佺粨鏉熶互鍙婃彁浜ゃ佸洖婊氱瓑銆?span style="font-family: "Courier New";"> XA </span>鎺ュ彛鍑芥暟鐢辨暟鎹簱鍘傚晢鎻愪緵銆?/span><br /> <p style="margin: 0cm 0cm 0pt;"><span style="font-family: "Courier New";">   <span style="font-size: small;">XA </span></span><span style="font-size: small;">涓庝袱闃舵鎻愪氦鍗忚</span></p> <p style="margin: 0cm 0cm 0pt;"><span style="font-family: "Courier New";">   </span><span style="font-size: small;">閫氬父鎯呭喌涓嬶紝浜ゆ槗涓棿浠朵笌鏁版嵁搴撻氳繃<span style="font-family: "Courier New";"> XA </span>鎺ュ彛瑙勮寖錛屼嬌鐢ㄤ袱闃舵鎻愪氦鏉ュ畬鎴愪竴涓叏灞浜嬪姟錛?span style="font-family: "Courier New";"> XA </span>瑙勮寖鐨勫熀紜鏄袱闃舵鎻愪氦鍗忚銆?/span><span style="font-family: "Courier New";"><br /> </span><span style="font-size: small;"><span> 鍦ㄧ涓闃舵錛屼氦鏄撲腑闂翠歡璇鋒眰鎵鏈夌浉鍏蟲暟鎹簱鍑嗗鎻愪氦錛堥鎻愪氦錛夊悇鑷殑浜嬪姟鍒嗘敮錛屼互紜鏄惁鎵鏈夌浉鍏蟲暟鎹簱閮藉彲浠ユ彁浜ゅ悇鑷殑浜嬪姟鍒嗘敮銆傚綋鏌愪竴鏁版嵁搴撴敹鍒伴 鎻愪氦鍚庯紝濡傛灉鍙互鎻愪氦灞炰簬鑷繁鐨勪簨鍔″垎鏀紝鍒欏皢鑷繁鍦ㄨ浜嬪姟鍒嗘敮涓墍鍋氱殑鎿嶄綔鍥哄畾璁板綍涓嬫潵錛屽茍緇欎氦鏄撲腑闂翠歡涓涓悓鎰忔彁浜ょ殑搴旂瓟錛屾鏃舵暟鎹簱灝嗕笉鑳藉啀鍦ㄨ浜? 鍔″垎鏀腑鍔犲叆浠諱綍鎿嶄綔錛屼絾姝ゆ椂鏁版嵁搴撳茍娌℃湁鐪熸鎻愪氦璇ヤ簨鍔★紝鏁版嵁搴撳鍏變韓璧勬簮鐨勬搷浣滆繕鏈噴鏀撅紙澶勪簬涓婇攣鐘舵侊級銆傚鏋滅敱浜庢煇縐嶅師鍥犳暟鎹簱鏃犳硶鎻愪氦灞炰簬鑷繁鐨? 浜嬪姟鍒嗘敮錛屽畠灝嗗洖婊氳嚜宸辯殑鎵鏈夋搷浣滐紝閲婃斁瀵瑰叡浜祫婧愪笂鐨勯攣錛屽茍榪斿洖緇欎氦鏄撲腑闂翠歡澶辮觸搴旂瓟銆?/span>鍦ㄧ浜岄樁孌碉紝浜ゆ槗涓棿浠跺鏌ユ墍鏈夋暟鎹簱榪斿洖鐨勯鎻愪氦緇撴灉錛屽鎵鏈夋暟鎹簱閮藉彲浠ユ彁浜わ紝浜ゆ槗涓棿浠跺皢瑕佹眰鎵鏈夋暟鎹簱鍋氭寮忔彁浜わ紝榪欐牱璇ュ叏灞浜嬪姟琚彁浜ゃ傝屽鏋滄湁浠諱竴鏁版嵁搴撻鎻愪氦榪斿洖澶辮觸錛屼氦鏄撲腑闂翠歡灝嗚姹傛墍鏈夊叾瀹冩暟鎹簱鍥炴粴鍏舵搷浣滐紝榪欐牱璇ュ叏灞浜嬪姟琚洖婊氥?/span><span style="font-family: "Courier New";"><br /> </span><span style="font-size: small;">銆銆浠ヤ竴涓叏灞浜嬪姟涓轟緥錛?span style="font-family: "Courier New";"> AP </span>棣栧厛閫氱煡浜ゆ槗涓棿浠跺紑濮嬩竴涓叏灞浜嬪姟錛屼氦鏄撲腑闂翠歡閫氳繃<span style="font-family: "Courier New";"> XA </span>鎺ュ彛鍑芥暟閫氱煡鏁版嵁搴撳紑濮嬩簨鍔★紝鐒跺悗<span style="font-family: "Courier New";"> AP </span>鍙互瀵規暟鎹簱綆$悊鐨勮祫婧愯繘琛屾搷浣滐紝鏁版嵁搴撶郴緇熻褰曚簨鍔″鏈湴璧勬簮鐨勬墍鏈夋搷浣溿傛搷浣滃畬鎴愬悗浜ゆ槗涓棿浠墮氳繃<span style="font-family: "Courier New";"> XA </span>鎺ュ彛鍑芥暟閫氱煡鏁版嵁搴撴搷浣滃畬鎴愩備氦鏄撲腑闂翠歡璐熻矗璁板綍<span style="font-family: "Courier New";"> AP </span>鎿嶄綔榪囧摢浜涙暟鎹簱錛堜簨鍔″垎鏀級銆?span style="font-family: "Courier New";"> AP </span>鏍規嵁鎯呭喌閫氱煡浜ゆ槗涓棿浠舵彁浜よ鍏ㄥ眬浜嬪姟錛屼氦鏄撲腑闂翠歡浼氶氳繃<span style="font-family: "Courier New";"> XA </span>鎺ュ彛鍑芥暟瑕佹眰鍚勪釜鏁版嵁搴撳仛棰勬彁浜わ紝鎵鏈夋暟鎹簱榪斿洖鎴愬姛鍚庤姹傚悇涓暟鎹簱鍋氭寮忔彁浜わ紝姝ゆ椂涓絎斿叏灞浜嬪姟緇撴潫銆?/span></p> <p style="margin: 0cm 0cm 0pt;"><span style="font-family: "Courier New";">   </span><span style="font-size: small;"><span style="font-family: "Courier New";">XA </span>瑙勮寖瀵瑰簲鐢ㄦ潵璇達紝鏈澶уソ澶勫湪浜庝簨鍔$殑瀹屾暣鎬х敱浜ゆ槗涓棿浠跺拰鏁版嵁搴撻氳繃<span style="font-family: "Courier New";"> XA </span>鎺ュ彛鎺у埗錛?span style="font-family: "Courier New";"> AP </span>鍙渶瑕佸叧娉ㄤ笌鏁版嵁搴撶殑搴旂敤閫昏緫鐨勫鐞嗭紝鑰屾棤闇榪囧鍏沖績浜嬪姟鐨勫畬鏁存э紝搴旂敤璁捐寮鍙戜細綆鍖栧緢澶氥?/span></p> <p style="margin: 0cm 0cm 0pt;"><span style="font-family: "Courier New";">   </span><span style="font-size: small;">鍏蜂綋鏉ヨ錛屽鏋滄病鏈変氦鏄撲腑闂翠歡錛屽簲鐢ㄧ郴緇熼渶瑕佸湪紼嬪簭鍐呴儴鐩存帴閫氱煡鏁版嵁搴撳紑濮嬨佺粨鏉熷拰鎻愪氦浜嬪姟錛屽綋鍑虹幇寮傚父鎯呭喌鏃跺繀欏葷敱涓撻棬鐨勭▼搴忓鏁版嵁搴撹繘琛屽弽鍚戞搷浣滄墠鑳藉畬鎴愬洖婊氥傚鏋滄槸鏈夊緢澶氫簨鍔″垎鏀殑鍏ㄥ眬浜嬪姟錛屽洖婊氭椂鎯呭喌灝嗗彉寰楀紓甯稿鏉傘傝屼嬌鐢?span style="font-family: "Courier New";"> XA </span>鎺ュ彛錛屽垯鍏ㄥ眬浜嬪姟鐨勬彁浜ゆ槸鐢變氦鏄撲腑闂翠歡鎺у埗錛屽簲鐢ㄧ▼搴忓彧闇閫氱煡浜ゆ槗涓棿浠舵彁浜ゆ垨鍥炴粴浜嬪姟錛屽氨鍙互鎺у埗鏁翠釜浜嬪姟錛堝彲鑳芥秹鍙婂涓紓鍦扮殑鏁版嵁搴擄級鐨勫叏閮ㄦ彁浜ゆ垨鍥炴粴錛屽簲鐢ㄧ▼搴忓畬鍏ㄤ笉鐢ㄨ冭檻鍐叉閫昏緫銆?/span><span style="font-family: "Courier New";"><br /> </span><span><span style="font-size: small;"> 鍦ㄤ竴涓秹鍙婂涓暟鎹簱鐨勫叏灞浜嬪姟涓紝涓轟繚璇佸叏灞浜嬪姟鐨勫畬鏁存э紝鐢變氦鏄撲腑闂翠歡鎺у埗鏁版嵁搴撳仛涓ら樁孌墊彁浜ゆ槸蹇呰鐨勩備絾鍏稿瀷鐨勪袱闃舵鎻愪氦錛屽鏁版嵁搴撴潵璇翠簨鍔′粠寮 濮嬪埌緇撴潫錛堟彁浜ゆ垨鍥炴粴錛夋椂闂寸浉瀵硅緝闀匡紝鍦ㄤ簨鍔″鐞嗘湡闂存暟鎹簱浣跨敤鐨勮祫婧愶紙濡傞昏緫鏃ュ織銆佸悇縐嶉攣錛夛紝鐩村埌浜嬪姟緇撴潫鏃舵墠浼氶噴鏀俱傚洜姝わ紝浣跨敤鍏稿瀷鐨勪袱闃舵鎻愪氦鐩稿 鏉ヨ浼氬崰鐢ㄦ洿澶氱殑璧勬簮錛屽湪緗戠粶鏉′歡涓嶆槸寰堝ソ錛屽浣庨熺綉銆佺綉緇滈綈擱綣侊紝鎯呭喌浼氭洿涓轟弗閲嶃?/span></span><span style="font-family: "Courier New";"><br /> </span><span style="font-size: small;">銆銆褰撲竴涓叏灞浜嬪姟鍙秹鍙婁竴涓暟鎹簱鏃訛紝鏈変竴縐嶄紭鍖栨柟寮忥紝鍗充竴闃舵鎻愪氦銆傚綋<span style="font-family: "Courier New";"> AP </span>閫氱煡浜ゆ槗涓棿浠舵彁浜や簨鍔℃椂錛屼氦鏄撲腑闂翠歡鐩存帴瑕佹眰鏁版嵁搴撴彁浜や簨鍔★紝鐪佸幓涓ら樁孌墊彁浜や腑鐨勭涓闃舵錛屽彲浠ョ緝鐭鐞嗕竴涓簨鍔$殑鏃墮棿錛屼互鎻愰珮浜嬪姟澶勭悊鐨勬晥鐜囥備綔涓轟袱闃舵鎻愪氦鐨勪竴縐嶇壒渚嬶紝涓庝袱闃舵涓鏍鳳紝涓闃舵鎻愪氦涔熸槸鏍囧噯鐨勩?/span></p> <p style="margin: 0cm 0cm 0pt;"><strong>XA鐨勮姹?/strong> <br /> 瀵逛簬jms鏉ヨ錛岄渶瑕侀厤緗敮鎸乆A鐨?connection factory. <br /> 瀵逛簬db鏉ヨ錛岄渶浣跨敤鏀寔XA鐨凧DBC driver. <br /> </p> <p style="margin: 0cm 0cm 0pt;"><strong>涓ら樁孌墊彁浜?2 phase commit)</strong> <br /> 鍏堣transaction鐨勭鐞嗭紝濡備笅鍥俱?nbsp;</p> <p style="margin: 0cm 0cm 0pt;"><img alt="" src="http://m.tkk7.com/images/blogjava_net/persister/046a643e-1b51-3aa3-9ac2-779f5e4755ea.bmp.png" width="447" height="237" /><br />   <br /> transaction manager涓庝笉鍚岀殑resource manager閮芥湁浜や簰銆? <br /> <br /> 鍦╬hase1鏃訛紝transaction manager鍚戜袱涓猺esouce璇㈤棶鏄惁鍙互鍑嗗鎻愪氦銆俁esouce鍙洖澶峳eady, not_ready鎴栨槸read_only. 褰撲袱涓兘ready鏃訛紝鍒欏彲浠ヨ繘鍏hase2 榪涜鎻愪氦銆備換浣曚竴涓洖澶峮ot_ready鍒欐暣涓猼ransaction 鍥炴粴銆傚洖澶峳ead_only鐨勮祫婧愬湪phase2闃舵琚帓闄ゅ湪鎻愪氦榪囩▼涔嬪銆? <br /> <img alt="" src="http://m.tkk7.com/images/blogjava_net/persister/dd3536a3-d5fa-3e43-b905-8e13a755c9ca.bmp.png" width="300" height="256" /><br /> </p> <p style="margin: 0cm 0cm 0pt;"><br /> </p> <strong>2.JTA</strong><br /> JTA(Java Transaction API) 涓?J2EE 騫沖彴鎻愪緵浜嗗垎甯冨紡浜嬪姟鏈嶅姟銆?br /> 瑕佺敤 JTA 榪涜浜嬪姟鐣屽畾錛屽簲鐢ㄧ▼搴忚璋冪敤 javax.transaction.UserTransaction 鎺ュ彛涓殑鏂規硶銆? <p>璁╂垜浠潵鍏蟲敞涓嬮潰鐨勮瘽錛?br />  “鐢?JTA 鐣屽畾浜嬪姟錛岄偅涔堝氨闇瑕佹湁涓涓疄鐜?javax.sql.XADataSource 銆? javax.sql.XAConnection 鍜?javax.sql.XAResource 鎺ュ彛鐨?JDBC 椹卞姩紼嬪簭銆備竴涓疄鐜頒簡榪欎簺鎺ュ彛鐨勯┍鍔ㄧ▼搴忓皢鍙互鍙備笌 JTA 浜嬪姟銆備竴涓?XADataSource 瀵硅薄灝辨槸涓涓?XAConnection 瀵硅薄鐨勫伐鍘傘?XAConnection s 鏄弬涓?JTA 浜嬪姟鐨?JDBC 榪炴帴銆?#8221;<br /> 瑕佷嬌鐢↗TA浜嬪姟錛屽繀欏諱嬌鐢╔ADataSource鏉ヤ駭鐢熸暟鎹簱榪炴帴錛屼駭鐢熺殑榪炴帴涓轟竴涓猉A榪炴帴銆?/p> <p>XA榪炴帴錛坖avax.sql.XAConnection錛夊拰闈瀀A錛坖ava.sql.Connection錛夎繛鎺ョ殑鍖哄埆鍦ㄤ簬錛歑A鍙互鍙備笌JTA鐨勪簨鍔★紝鑰屼笖涓嶆敮鎸佽嚜鍔ㄦ彁浜ゃ?/p> Note:<br /> Oracle, Sybase, DB2, SQL Server,MySQL(5.0浠ュ悗InnoDB瀛樺偍寮曟搸)絳夊ぇ鍨嬫暟鎹簱鎵嶆敮鎸乆A, 鏀寔鍒嗗竷浜嬪姟銆?<br /> <br /> <strong>3.OFBiz涓疄鐜扮殑浜嬪姟<br /> </strong>OFBiz閲囩敤<a >Apache Commons DBCP</a>浣滀負鏁版嵁搴撹繛鎺ユ睜鎶鏈紝鍒嗗竷寮忎簨鍔℃槸閫氳繃Apache <a >Geronimo Transaction</a>瀹炵幇鐨勩備笅闈㈡槸閮ㄥ垎瀹炵幇綾誨叧緋伙細<br /> <br /> <img alt="" src="http://m.tkk7.com/images/blogjava_net/persister/transaction.JPG" width="622" height="504" /><br /> <br /> <br /> <strong> </strong>TransactionFactory鍜孋onnectionFactory閮藉彲浠ヨ嚜宸卞疄鐜板茍涓斿湪entityengine.xml涓繘琛岄厤緗紝OFBiz涓粯璁ら厤緗殑鏄?/span></span>GeronimoTransactionFactory鍜孌BCPConnectionFactory銆侽FBiz涓疄鐜頒簨鍔′笉闇瑕佹樉紺鴻皟鐢紝鍦╯ervices.xml涓殑service榪涜閰嶇疆錛岄厤緗殑欏圭洰鏈変袱涓猺equire-new-transaction鍜寀se-transaction錛屾槸鍚﹁搗涓涓柊鐨勪簨鍔″拰鏄惁鍚敤浜嬪姟錛岄粯璁ゆ槸false鍜宼rue銆傚鏋滀笉鏄噰鐢╯ervice錛宔vent涓簀ava瀹炵幇錛岄偅涔堥渶瑕佹墜鍔ㄥ疄鐜頒簨鍔★紝閫氬父濡備笅錛?br /> <br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">try</span><span style="color: #000000;"> {<br /> <br />      beganTransaction </span><span style="color: #000000;">=</span><span style="color: #000000;"> TransactionUtil.begin(DEFAULT_TX_TIMEOUT);<br /> <br /> </span><span style="color: #008000;">     //</span><span style="color: #008000;">db operation</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">     return "success";<br /> } </span><span style="color: #0000ff;">catch</span><span style="color: #000000;"> (Exception e) {<br />      e.printStackTrace();<br />      TransactionUtil.rollback(beganTransaction, e.getMessage(), e);<br />      </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">error</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> } </span><span style="color: #0000ff;">finally</span><span style="color: #000000;"> {<br />     TransactionUtil.commit(beganTransaction);<br /> }</span></div> <br /> <br /> <br /> <span style="font-size: 10pt;"><span style="font-size: 10pt;"><br /> </span></span> <img src ="http://m.tkk7.com/persister/aggbug/266439.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/persister/" target="_blank">persister</a> 2009-04-19 18:01 <a href="http://m.tkk7.com/persister/archive/2009/04/19/266439.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>OSWorkflow涓嶰FBiz鐨勯泦鎴?/title><link>http://m.tkk7.com/persister/archive/2009/04/12/265066.html</link><dc:creator>persister</dc:creator><author>persister</author><pubDate>Sat, 11 Apr 2009 16:01:00 GMT</pubDate><guid>http://m.tkk7.com/persister/archive/2009/04/12/265066.html</guid><wfw:comment>http://m.tkk7.com/persister/comments/265066.html</wfw:comment><comments>http://m.tkk7.com/persister/archive/2009/04/12/265066.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/persister/comments/commentRss/265066.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/persister/services/trackbacks/265066.html</trackback:ping><description><![CDATA[     鎽樿: 1.OSWorklow鐨勫熀鏈蹇? Osworkflow鏄畬鍏ㄧ敤java璇█緙栧啓鐨勫紑鏀炬簮浠g爜鐨勫伐浣滄祦寮曟搸錛屽叿鏈夋樉钁楃殑鐏墊椿鎬у強瀹屽叏闈㈠悜鏈夋妧鏈儗鏅殑鐢ㄦ埛鐨勭壒鐐廣傜敤鎴峰彲浠ユ牴鎹嚜韜殑闇姹傚埄鐢ㄨ繖嬈懼紑婧愯蔣浠惰璁$畝鍗曟垨鏄鏉傜殑宸ヤ綔嫻併侽sworkflow鍑犱箮鎻愪緵浜嗘墍鏈夌敤鎴峰彲鑳藉湪瀹為檯嫻佺▼瀹氫箟涓渶瑕佺敤鍒扮殑宸ヤ綔嫻佹瀯鎴愬厓绱狅紝濡傦細鐜妭錛坰tep錛夈佹潯浠訛紙conditions錛夈佸驚鐜紙loops錛夈佸垎鏀紙splits錛?..  <a href='http://m.tkk7.com/persister/archive/2009/04/12/265066.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/persister/aggbug/265066.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/persister/" target="_blank">persister</a> 2009-04-12 00:01 <a href="http://m.tkk7.com/persister/archive/2009/04/12/265066.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>OFBiz's trunk version閬囧埌鐨勪袱涓棶棰?/title><link>http://m.tkk7.com/persister/archive/2009/03/30/262857.html</link><dc:creator>persister</dc:creator><author>persister</author><pubDate>Mon, 30 Mar 2009 04:38:00 GMT</pubDate><guid>http://m.tkk7.com/persister/archive/2009/03/30/262857.html</guid><wfw:comment>http://m.tkk7.com/persister/comments/262857.html</wfw:comment><comments>http://m.tkk7.com/persister/archive/2009/03/30/262857.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/persister/comments/commentRss/262857.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/persister/services/trackbacks/262857.html</trackback:ping><description><![CDATA[<h3 class="type_reprint" title="杞澆">1. <a >鍦╡clipse涓嬭繍琛屾垨璋冭瘯Ofbiz鐨勫嚭鐜?span class="hilite1">Can't</span> <span id="pftp99b" class="hilite2">find</span> <span id="7hdjdfx" class="hilite3">bundle</span> <span id="vthdpfn" class="hilite4">for</span> <span id="1jf7zb9" class="hilite5">base</span> </a></h3> <strong>鍏抽敭瀛? ofbiz</strong> <br /> <br /> eclipse 涓埄鐢╫rg.ofbiz.<span id="d9b1dpb" class="hilite5">base</span>.start.Start綾昏繍琛孫fbiz 鍑虹幇閿欒: <br /> <br /> Exception in thread "main" java.lang.ExceptionInInitializerError <br /> at org.ofbiz.<span id="z19l99x" class="hilite5">base</span>.util.Debug.<clinit>(Debug.java:90) <br /> at org.ofbiz.<span id="v77999p" class="hilite5">base</span>.container.ContainerLoader.load(ContainerLoader.java:50) <br /> at org.ofbiz.<span id="bh9dlf7" class="hilite5">base</span>.start.Start.initStartLoaders(Start.java:248) <br /> at org.ofbiz.<span id="j7r9v9r" class="hilite5">base</span>.start.Start.init(Start.java:87) <br /> at org.ofbiz.<span id="hnb79dp" class="hilite5">base</span>.start.Start.main(Start.java:403) <br /> Caused by: java.util.MissingResourceException: <span id="rfd197l" class="hilite1">Can't</span> <span id="7vb9b9r" class="hilite2">find</span> <span id="7xt99b9" class="hilite3">bundle</span> <span id="v7rf79v" class="hilite4">for</span> <span id="fzn17p9" class="hilite5">base</span> <span id="thtj9hb" class="hilite6">name</span> <span id="7rjvljn" class="hilite7">cache</span>, <span id="zjd9tv9" class="hilite8">locale</span> zh_CN <br /> at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836) <br /> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805) <br /> at java.util.ResourceBundle.getBundle(ResourceBundle.java:549) <br /> at org.ofbiz.<span id="7vfjv9x" class="hilite5">base</span>.util.<span id="ld7bv9f" class="hilite7">cache</span>.UtilCache.setPropertiesParams(UtilCache.java:217) <br /> at org.ofbiz.<span id="x99jf97" class="hilite5">base</span>.util.<span id="tfhd99x" class="hilite7">cache</span>.UtilCache.setPropertiesParams(UtilCache.java:213) <br /> at org.ofbiz.<span id="7r9d9z9" class="hilite5">base</span>.util.<span id="rjpjfjn" class="hilite7">cache</span>.UtilCache.<init>(UtilCache.java:172) <br /> at org.ofbiz.<span id="d79h7jn" class="hilite5">base</span>.util.UtilProperties.<clinit>(UtilProperties.java:53) <br /> ... 5 more <br /> <br /> 鍘熷洜鏄病鏈夋紜緗瓺ebug鐜錛孫FBiz Wiki涓婄殑<a >鏂囩珷</a>鎻忚堪鐨勫緢璇︾粏錛屾寜鐓у畠鐨勬楠よ緗紝灝變笉浼氬嚭鐜頒笂闈㈢殑闂銆?br /> <br /> 2.trunk 涓畾涔塭ntity鏃跺湪entitymodel涓紝濡傛灉瀹氫箟鐨刧roup鍦╫rg.ofbiz涓氨涓嶉渶瑕佸湪entitygroup涓畾涔夛紝鑰岃嚜瀹氫箟鐨?br /> 濡傚湪com.aicent涓紝瀹炰綋瀛樻斁鍦ㄤ笉鍚岀殑鏁版嵁搴擄紝閭d箞闇瑕佸畾涔塭ntitygroup銆傚洜姝ゅ鑷寸殑涓涓棶棰樺氨鏄細<br /> 濡傛灉鏈夎嚜瀹氫箟瀹炰綋鍦╡ntitymodel涓畾涔変簡浣嗘槸娌℃湁鍔犲叆鍒癳ntitygroup涓紝閭d箞灝變細瀵艱嚧姝ゅ疄浣撻粯璁ゆ斁鍦ㄥ湪org.ofbiz涓粠鑰屽湪ofbiz鐨勬暟鎹簱涓緩琛ㄤ簡錛岃繖鐐瑰緱娉ㄦ剰銆?br /> <br /> <img src ="http://m.tkk7.com/persister/aggbug/262857.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/persister/" target="_blank">persister</a> 2009-03-30 12:38 <a href="http://m.tkk7.com/persister/archive/2009/03/30/262857.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>OFBiz寮鍙戦渶瑕佺敤鍒扮殑鍑犱釜閲嶈錛堥厤緗級鏂囦歡http://m.tkk7.com/persister/archive/2009/01/21/252211.htmlpersisterpersisterWed, 21 Jan 2009 06:25:00 GMThttp://m.tkk7.com/persister/archive/2009/01/21/252211.htmlhttp://m.tkk7.com/persister/comments/252211.htmlhttp://m.tkk7.com/persister/archive/2009/01/21/252211.html#Feedback0http://m.tkk7.com/persister/comments/commentRss/252211.htmlhttp://m.tkk7.com/persister/services/trackbacks/252211.html
1銆侀鍏堟槸entityengine.xml鏂囦歡錛岃繖涓枃浠舵槸閰嶇疆鏁版嵁婧愮殑錛屼篃鍖呮嫭鏁版嵁搴撹繛鎺ユ睜銆佷簨鍔″疄鐜扮被鐨勯厤緗拰瀛楁綾誨瀷閰嶇疆鏂囦歡銆備紒涓氱駭緋葷粺鐨勫紑鍙戜竴鑸兘紱諱笉寮鏁版嵁搴擄紝閭d箞鍦∣FBiz涓紝鏁版嵁搴撶殑閰嶇疆灝卞湪榪欎釜閰嶇疆鏂囦歡閲岄潰錛屽厛閰嶇疆涓涓猤roup-map錛岀劧鍚庨厤緗叾瀵瑰簲鐨勬暟鎹簮錛?br />
<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"
   distributed-cache-clear-enabled
="false">
        
<group-map group-name="org.ofbiz" datasource-name="ofbiz"/>
        
<group-map group-name="com.aicent" datasource-name="portal"/>
    
</delegator>

    
<datasource name="ofbiz"
            helper-class
="org.ofbiz.entity.datasource.GenericHelperDAO"
            field-type-name
="mysql"
            check-on-start
="false"
            add-missing-on-start
="false"
            check-pks-on-start
="false"
            use-foreign-keys
="true"
            join-style
="ansi-no-parenthesis"
            alias-view-columns
="false"
            drop-fk-use-foreign-key-keyword
="true"
            table-type
="InnoDB" 
            character-set
="latin1"
            collate
="latin1_swedish_ci">
        
<read-data reader-name="seed"/>
        
<read-data reader-name="seed-initial"/>
        
<read-data reader-name="demo"/>
        
<read-data reader-name="ext"/>
        
<inline-jdbc
                
jdbc-driver="com.mysql.jdbc.Driver"
        jdbc-uri
="jdbc:mysql://localhost/ofbiztrunk"
                jdbc-username
="root"
                jdbc-password
="123456"
                isolation-level
="ReadCommitted"
                pool-minsize
="2"
                pool-maxsize
="20"/>
        
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
    
</datasource>

datasource閰嶇疆閲岄潰鏈変竴涓?span style="color: #ff0000;">field-type-name="mysql"錛屽埌entitymodel.xml閰嶇疆鏂囦歡灝辯煡閬撴槸騫插悧鐢ㄧ殑浜嗐?br />
2.entitymodel.xml & entitygroup.xml
  OFBiz鏈川涓婃潵璇磋繕鏄潰鍚戞暟鎹簱鐨勮璁★紝entitymodel.xml鐨勯厤緗甧ntity鐨勶紝entity瀹炰綋瀵瑰簲鏁版嵁搴撻噷闈㈢殑table錛屽疄浣撶殑field瀵瑰簲鏁版嵁搴撻噷闈㈢殑瀛楁,濡備笅鏄竴涓猠ntity閰嶇疆錛?br />
<entity entity-name="Customerinfo" package-name="com.aicent.ccb" no-auto-stamp="true"
        title
="customerinfo">
        
<field name="id" type="int10" ></field>
        
<field name="name" type="varchar128"></field>
        
<field name="customernameshort" type="varchar16"></field>
        
<field name="country" type="varchar64"></field>
        
<field name="businessaddr" type="text"></field>
        
<field name="mailaddr" type="text"></field>
        
<field name="billaddr" type="text"></field>
        
<field name="phone" type="varchar32"></field>
        
<field name="fax" type="varchar32"></field>
        
<field name="website" type="varchar128"></field>
        
<field name="note" type="text"></field>
</entity>

閲岄潰鏈変竴涓猼ype錛岃繖涓猼ype瀵瑰簲鏁版嵁搴撳瓧孌電殑綾誨瀷錛堟棩鏈熷瀷錛屽瓧絎︿覆鍨嬶紝鏁村瀷絳夛級錛岃繖涓浜庡叧緋誨湪鍝噷鍛紵灝卞湪鍒氭墠璇寸殑field-type-name閲岄潰閰嶇疆錛屽鏋滈厤緗負mysql錛岄偅涔坋ntitygengine.xml涓璵ysql鐨?br /> field-type鎸囧悜鐨勬枃浠舵槸錛?br />
<field-type name="mysql" loader="fieldfile" location="fieldtypemysql.xml"/>

鍦╢ieldtypemysql.xml涓紝灝卞彲浠ユ壘鍒板int10,varchar128琛ㄧず鐨勫疄闄卪ysql瀛楁綾誨瀷浜嗭細

 1 <fieldtypemodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 2         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/fieldtypemodel.xsd">
 3   <!-- ===================== field-type-def ==================== -->
 4     <!-- General Types --> 
 5     <field-type-def type="blob" sql-type="BLOB" java-type="java.sql.Blob"></field-type-def>
 6     
 7     <field-type-def type="date-time" sql-type="DATETIME" java-type="java.sql.Timestamp"></field-type-def>
 8     <field-type-def type="date" sql-type="DATE" java-type="java.sql.Date"></field-type-def>
 9     <field-type-def type="time" sql-type="TIME" java-type="java.sql.Time"></field-type-def>
10     
11     <field-type-def type="currency-amount" sql-type="DECIMAL(18,2)" java-type="java.math.BigDecimal"><validate method="isSignedDouble" /></field-type-def>
12     <field-type-def type="currency-precise" sql-type="DECIMAL(18,3)" java-type="java.math.BigDecimal"><validate method="isSignedDouble" /></field-type-def>
13     <field-type-def type="fixed-point" sql-type="DECIMAL(18,6)" java-type="java.math.BigDecimal"><validate method="isSignedDouble" /></field-type-def>
14     <field-type-def type="floating-point" sql-type="DECIMAL(18,6)" java-type="Double"><validate method="isSignedDouble" /></field-type-def>
15     <field-type-def type="numeric" sql-type="DECIMAL(20,0)" java-type="Long"><validate method="isSignedLong" /></field-type-def>
16     <field-type-def type="integer" sql-type="INTEGER" java-type="Integer"></field-type-def>
17     
18     <field-type-def type="id" sql-type="VARCHAR(20)" java-type="String"></field-type-def>
19     <field-type-def type="id-long" sql-type="VARCHAR(60)" java-type="String"></field-type-def>
20     <field-type-def type="id-vlong" sql-type="VARCHAR(250)" java-type="String"></field-type-def>
21     
22     <field-type-def type="indicator" sql-type="CHAR(1)" java-type="String"></field-type-def>
23     <field-type-def type="very-short" sql-type="VARCHAR(10)" java-type="String"></field-type-def>
24     <field-type-def type="short-varchar" sql-type="VARCHAR(60)" java-type="String"></field-type-def>
25     <field-type-def type="long-varchar" sql-type="VARCHAR(255)" java-type="String"></field-type-def>
26     <field-type-def type="very-long" sql-type="LONGTEXT" java-type="String"></field-type-def>
27    
28     <field-type-def type="comment" sql-type="VARCHAR(255)" java-type="String"></field-type-def>
29     <field-type-def type="description" sql-type="VARCHAR(255)" java-type="String"></field-type-def>
30     <field-type-def type="name" sql-type="VARCHAR(100)" java-type="String"></field-type-def>
31     <field-type-def type="value" sql-type="VARCHAR(255)" java-type="String"></field-type-def>
32     
33     <!-- customize field type definitions for ccb -->
34     <field-type-def type="text" sql-type="TEXT" java-type="String"></field-type-def>
35     
36     <field-type-def type="char" sql-type="CHAR(1)" java-type="String"></field-type-def>
37     <field-type-def type="char125" sql-type="CHAR(125)" java-type="String"></field-type-def>
38     <field-type-def type="varchar16" sql-type="VARCHAR(16)" java-type="String"></field-type-def>
39     <field-type-def type="varchar20" sql-type="VARCHAR(20)" java-type="String"></field-type-def>
40     <field-type-def type="varchar24" sql-type="VARCHAR(24)" java-type="String"></field-type-def>
41     <field-type-def type="varchar50" sql-type="VARCHAR(50)" java-type="String"></field-type-def>
42     <field-type-def type="varchar64" sql-type="VARCHAR(64)" java-type="String"></field-type-def>
43     <field-type-def type="varchar128" sql-type="VARCHAR(128)" java-type="String"></field-type-def>
44 </fieldtypemodel>

OFBiz榪欓噷涓轟粈涔堜笉鍦╡ntitymodel閲岄潰鐩存帴浣跨敤瀛楁鍦ㄦ暟鎹簱涓殑綾誨瀷錛岃岃繖涔堢粫鍛紵鎴戞兂鑷沖皯鏈変袱涓洰鐨勶細棣栧厛鏄叕鍙鎬紒涓氬紑鍙戞椂鍙互閽堝浣跨敤鐨勫瓧孌電被鍨嬫湁涓涓鑼冿紝鎵鏈夌殑瀛楁閮介噰鐢ㄨ繖涓厤緗枃浠朵腑鐨勫瓧孌電被鍨嬶紝鑰屼笉鏄紑鍙戜漢鍛樿嚜宸遍殢鎰忓畾涔夋暟鎹簱瀛楁鐨勭被鍨嬶紱絎簩鏄負浜嗕嬌鐢ㄤ笉鍚孷endor鐨勬暟鎹簱錛屽鏋滄兂浠巑ysql鎹㈡垚oracle錛屽彧闇瑕佸畾涔夊彟涓浠絝ieldtypeoracle.xml錛宖ield-type-def涓璼ql-type涓嶅彉錛岃宻ql-tye鎹㈡垚oracle鐨勭被鍨嬪嵆鍙?br />
entitygroup.xml閰嶇疆鏂囦歡鏃剁敤浜庨厤緗甧ntitymodel.xml涓厤緗殑entity鏄睘浜庡摢涓猤roup鐨勶紝榪欎釜group瀵瑰簲entityengine.xml涓殑group-name錛屽鏋滃繕璁板湪entitygroup.xml涓厤緗紝閭d箞鍦∣FBiz 9涔嬪墠錛岃繖涓猠ntity灝辨棤娉曚嬌鐢紝涓嶄細鍒涘緩鐩稿簲鐨則able錛孫FBiz 9浠ュ悗錛岄粯璁ょ殑group name鏄痮rg.ofbiz銆?br />
<entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation
="http://www.ofbiz.org/dtds/entitygroup.xsd">


    
<entity-group group="com.aicent" entity="Customerextra" />
    
<entity-group group="com.aicent" entity="Customerinfo" />

</entitygroup>

3.ofbiz-containers.xml 閲岄潰閰嶇疆浜嗗悇縐嶅鍣ㄧ被錛岀粡甯鎬慨鏀圭殑瀹瑰櫒灝辨槸name涓篶atalina-container鐨勫鍣紝浣跨敤鐨勬槸embeded tomcat錛岄噷闈㈠彲浠ヤ慨鏀瑰悇縐峵omcat鐨勯厤緗」錛屽氨鍍忔垜浠慨鏀箃omcat鐨勯厤緗枃浠秙erver.xml涓鏍鳳紝鍦ㄩ噷闈慨鏀圭鍙g瓑淇℃伅銆?br />
4.log4j.xml 鏃ュ織閰嶇疆鏂囦歡

5.component-load.xml 榪欎釜鏂囦歡鍦ㄥ嚑涓枃浠跺す涓兘瀛樺湪錛屽framework,applications,specialpurpose涓侽FBiz灝嗕竴涓釜搴旂敤瀹炵幇涓篶omponent錛岃繖浜沜omponnet鏄氨濂藉儚tomcat涓瓀ebapps涓殑涓涓釜web搴旂敤銆傛瘡嬈℃槸鍚﹀姞杞借繖涓猚omponent鍙互鍦╟omponent-load.xml閰嶇疆錛屽鏋滀笉鎯沖姞杞斤紝娉ㄩ噴鎺夊氨鍙互銆?br />
<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation
="http://ofbiz.apache.org/dtds/component-loader.xsd">
    
<load-component component-location="commonext"/><!-- common component used by most other components -->     
    
<load-component component-location="securityext"/>
    
<!--
    <load-component component-location="party"/>
    <load-component component-location="content"/>
    <load-component component-location="workeffort"/>
    <load-component component-location="product"/>
    <load-component component-location="manufacturing"/>
    <load-component component-location="accounting"/>
    <load-component component-location="humanres"/>
    <load-component component-location="order"/>
    <load-component component-location="marketing"/>
    
-->
</component-loader>

鍒板簳鍝簺鐩綍涓嬬殑component-load.xml鏈夋晥鍛紝榪欎釜鐩綍鍦╢ramework/base/config/component-load.xml榪涜繘琛岄厤緗細

<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation
="http://ofbiz.apache.org/dtds/component-loader.xsd">
    
<load-components parent-directory="framework"/> 
    
<load-components parent-directory="themes"/> 
    
<load-components parent-directory="applications"/>
    
<load-components parent-directory="specialpurpose"/>
    
<load-components parent-directory="hot-deploy"/>
</component-loader>

6.general.properties 榪欓噷闈㈤厤緗殑涓滆タ寰堝錛屽ぇ瀹惰嚜宸卞幓鐪嬪惂銆?br />
7.cache.properties 閰嶇疆OFBiz涓殑緙撳瓨錛岄厤緗繖涓枃浠墮渶瑕佸OFBiz涓殑緙撳瓨鏈夋墍浜嗚В錛岃繖涓湪鍚庣畫鏂囩珷涓繘琛屽垎鏋愩?br />
鍏朵粬榪樻湁涓浜涙瘮杈冮厤緗殑鏂囦歡錛屽氨涓嶄竴涓璇存槑浜嗐?br />


persister 2009-01-21 14:25 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 国产国产成年年人免费看片| 91九色老熟女免费资源站| 女人18毛片免费观看| 亚洲人成黄网在线观看| 59pao成国产成视频永久免费| 亚洲四虎永久在线播放| 三年片在线观看免费观看大全动漫| 亚洲日韩精品无码一区二区三区 | 日日摸夜夜添夜夜免费视频| 免费观看男人免费桶女人视频| 亚洲日韩AV无码一区二区三区人| 女人张开腿等男人桶免费视频 | 亚洲AV成人无码网站| 国产一级特黄高清免费大片| 理论片在线观看免费| 亚洲中文字幕伊人久久无码| 中国精品一级毛片免费播放| 亚洲va在线va天堂va四虎 | 国产精品亚洲lv粉色| 亚洲午夜福利精品久久| a成人毛片免费观看| 亚洲明星合成图综合区在线| 毛片网站免费在线观看| 一级黄色毛片免费看| 久久久无码精品亚洲日韩按摩| 男人的好免费观看在线视频| 自拍偷自拍亚洲精品播放| 不卡一卡二卡三亚洲| 18未年禁止免费观看| 无码一区二区三区亚洲人妻| 亚洲色无码一区二区三区| 成人免费在线看片| 成a人片亚洲日本久久| 亚洲av综合色区| 处破痛哭A√18成年片免费| 好吊色永久免费视频大全| 久久精品亚洲中文字幕无码麻豆| 日本19禁啪啪无遮挡免费动图| 国产免费一级高清淫曰本片| 亚洲免费黄色网址| 国产精品亚洲不卡一区二区三区 |