锘??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-xylz,imxylzhttp://www.5432034.com/xylz/鍏虫敞鍚庣鏋?#37835;?#37510;佷腑闂翠欢銆佸垎甯冨紡鍜屽苟鍙戠紪绋?/description>zh-cnWed, 19 Jun 2019 10:40:28 GMTWed, 19 Jun 2019 10:40:28 GMT60涓栫晫閭︽梾琛岀綉(鍖椾含)鎷涜仒Java楂樼骇/璧勬繁宸?#32459;?#29999;堝墠绔?#23480;?#32459;?#29999;?绉诲姩寮鍙?#23480;?#32459;?#29999;?#32475;塤20150616鏇存柊http://www.5432034.com/xylz/archive/2013/11/05/406019.htmlimxylzimxylzTue, 05 Nov 2013 09:01:00 GMThttp://www.5432034.com/xylz/archive/2013/11/05/406019.htmlhttp://www.5432034.com/xylz/comments/406019.htmlhttp://www.5432034.com/xylz/archive/2013/11/05/406019.html#Feedback15http://www.5432034.com/xylz/comments/commentRss/406019.htmlhttp://www.5432034.com/xylz/services/trackbacks/406019.html
  • 宸ヤ綔鍦扮偣锛?#37718;椾含
  • 涓栫晫閭︽梾琛岀綉鏄?#28051;涓柊鍨嬪嚭澧冭嚜鍔╂梾琛岀ぞ鍖?#37724;岀?#38747;瓙鍟?#37716;?#23534;鏀惧钩鍙?#38171;?#28000;ユ彁渚涒?#28051;?#37804;?#37718;?#29723;?#32459;嬪?#27692;?#33333;湇鍔?#38171;?#26946;?#37804;?#28000;?#23011;?#37510;?#26946;?#29840;ㄩ噺澧冨?#26668;嚜鍔?#23059;糕?#28051;?#37929;爣銆?/li>
  • 鎴?#28000;?#37928;勭?#25120;珯锛?a href="http://www.shijiebang.com">http://www.shijiebang.com
  • 鍏?#27996;?#37812;?#28000;?#38171;?a href="http://www.shijiebang.com/about/us/">http://www.shijiebang.com/about/us/
  • B杞暟浜?/li>
  • 鎷涜仒鑱屼綅
    • Java 楂樼骇/璧勬繁宸?#32459;?#29999;?/li>
    • PHP 宸?#32459;?#29999;?/li>
    • 娴嬭瘯宸?#32459;?#29999;?/li>
    • ?#22688;绔?#23480;?#32459;?#29999;?/li>
    • 绉诲姩寮鍙?#23480;?#32459;?#29999;?Android/iOS)
    • 鍏?#28729;?#29999;?#37734;?#37510;佹帹骞?#37510;佽繍钀?#37510;佷骇鍝?#37510;佽璁?#32475;?#27996;烘墠
  • 寰呴亣
    • 涓?#27996;?#38001;旂綉鍏?#37721;?#37930;嬮綈+鏈熸潈 锛?#28000;?#37706;煎嚑浣?#38338;嚜?#32321;锛?/li>
  • 鐗瑰埆璇存槑

    • 鏈塯ithub甯?#37721;? stackoverflow 鏈?#29840;?#37914;垎涓?#28003;?/li>
    • 涓嶄細缈籷iang鐨?#28051;嶅缓璁?#37814;曢掔畝鍘?/li>
    • 灏界铻?#29863;勬?#22796;偣閽?#38171;屼絾渚?#37906;舵潯?#27426;?#22728;鑻?#38171;堝垱涓?#28003;?#37711;惰壈锛?/li>
    • 蹇呴?#26127;嚜璁?#28051;?#38001;?#37828;?#38171;堝?#20805;娇?#22470;浜?#29825;?#28051;鸿嚜?#32321;涓?#38001;?#37828;?#38171;?#29781;?#37832;夎繖浠?#38343;告皵锛?/li>
    • 瀵规梾娓?#37812;?#38000;呮梾琛?#37832;?#37711;磋叮
    • 涓涓兘澶?#36423;?#38315;熻嚜鎴?#37812;?#38336;?#37928;勭幆澧?#38171;屽鏋?#28051;嶈兘寤?#29825;?#32468;嬪嵆鍘诲?#32472;壘浠?#28598;?/li>
    • 鏃犳剰涔?#37928;勬妧鏈?#37510;佸伐鍏?#29781;佹?#20635;病鏈?/li>
  • 鏈鍚庣?#21228;渶鍚?/p>

    • ?#30045;鍘嗗啓鍚?#32457;嶇簿閫?#37928;?#38171;屽缓璁?#28051;?#37922;?#38000;冭檻
  • 鑱旂?#32472;?#29808;紡
    • imxylz##gmail.com
  • 鏇存柊鏃?#38338;?#38171;?2015/06/16



    ]]>
    Java 8 鍏?#38338;??#26570;鐗?#37804;?/title><link>http://www.5432034.com/xylz/archive/2013/10/16/405031.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Tue, 15 Oct 2013 16:33:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2013/10/16/405031.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/405031.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2013/10/16/405031.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/405031.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/405031.html</trackback:ping><description><![CDATA[<p>2013/09/05 宸茬粡鍙?#29999;?#27996;?a href="http://openjdk.java.net/projects/jdk8/" >JDK 8</a>鐨?a href="http://openjdk.java.net/projects/jdk8/milestones#Developer_Preview" >M8 Developer Preview</a>鐗?#37832;?#37510;?鍦?a href="http://openjdk.java.net/projects/jdk8/milestones#Feature_Complete" >M7(2013/06/13)</a><span class="Apple-converted-space"> </span>鎵鏈夋柊鐗?#37804;?#23480;茬粡灏?#37911;?#38171;?M8 ?#32148;涓?#23534;鍙?#38000;呴?#21230;鐗?#38171;屽熀鏈?#28051;?#37721;?#37922;?#38171;屽彲鐢?a href="http://jdk8.java.net/download.html" >Oracle缃戠珯涓?#26462;?/a>銆?鎸夌収<a href="http://openjdk.java.net/projects/jdk8/milestones" >璁?#37714;?/a><a href="http://openjdk.java.net/projects/jdk8/milestones#General_Availability" >GA(General Availability)</a>鐗?#37832;?搴?#29831;?#37734;?014骞?鏈?#28000;?#37721;?#29999;?#38171;屽鏋滈?#21700;埄姝e紡鐗堜及璁?#37724;孏A鐗?#37832;?#37929;?#37722;?#38171;屼篃灏?#37828;?#29831;?#37734;?#37828;?#39582;?鏈?#28000;?#28751;辨?#32033;浣?#37922;↗DK 8浜?#37510;?/p> <p>杩欐JDK 8 涓鍏?#29999;?#37833;?#27996;?a href="http://openjdk.java.net/projects/jdk8/features" >55涓柊鐗?#37804;?/a>锛岀洰?#22688;鎵鏈堿PI搴?#29831;ラ兘宸茬粡?#21909;缁?#38171;?姝?#37734;?#26473;?#29723;岄?#31160;ug娴嬭瘯銆?#26473;欐鏇存柊鐨?#37716;?#25652;?#23011;擩DK 6/JDK 7?#20824;瑕佸ぇ锛屽?#33333;湡浜嗗嚑娆?#38171;屼篃?#28522;甯?#28000;?#27996;?#37832;?#23536;?#37510;?鎴?#28051;?#27996;哄?#21975;?#22250;姳璐瑰嚑涓?#37832;?#37928;勫涔?#37827;?#38338;?#38171;屽姫鍔涜窡涓奐ava 8鐨?#37721;?#29999;冭?#20634;銆傚綋鐒?#37922;?#27996;?#28725;笿ava 7涓嶅お鐔熸倝锛屽?#29363;鍚屾椂涔熷涔?#28051;婮ava 7鐨凙PI銆?/p> <p>鐩墠鏀?#37816;丣DK 8鐨処DE鏈?#38171;?/p> <ul> <li><a href="https://netbeans.org/downloads/" >Netbeans 7.4</a></li> <li><a href="http://www.jetbrains.com/idea/download/" >IDEA 12</a></li> <li><a href="http://downloads.efxclipse.org/eclipse-java8/" >?#28522;瀹?#37826;?#37928;凟clipse</a>, 瀹?#37826;?#38343;瑕佸埌鏄?#39582;碕ava 8姝e紡鍙?#29999;?#28000;?#37722;?/li> </ul> <p>?#33503;?#28522;鎵鏈塉DK 8鐨勭壒鎬DE?#20824;?#20824;鏀?#37816;?#38171;屽?#29363;闇瑕侀殢鏃舵?#23384;柊IDE浠?#28186;?#38014;?#23536;?#37831;村ソ鐨?#23534;鍙戠幆澧?#38171;屾帹?#23832;浣?#37922;↖DEA銆?/p> <br /> <h2>Java 8 ?#26570;鐗?#37804;?#37711;?#38338;?/h2> <ol> <li>鏃?#38338;?#29723;?/li> <li>Lambda</li> <li>娴佸紡鎿嶄綔 – Stream API</li> <li>鎺?#37721;?#27035;?#29825;?#37826;规硶 – Default Method</li> <li>鏃?#37832;?#37724;屾椂闂?– Date & Time (JSR 310)</li> <li>闆?#37722;堟墿?#30541; – Collections API</li> <li>?#33503;鍙戞?#23940;綔 – Concurrency API additions</li> <li>IO/NIO 鎵╁睍 – IO/NIO API additions</li> <li>鍙嶅皠鍜屾敞瑙?#37831;存柊 – Reflection and annotation changes</li> <li>Base64</li> <li>鍏?#28729;?#37722;?#32457;?#37831;存柊 – Other additions</li> </ol> <hr /> <h2>Java 7 ?#26570;鐗?#37804;?#37711;?#38338;?/h2> <ol> <li>瀛楃涓?#37734;╯witch?#33105;鐨?#28003;?#37922;?/li> <li>try-with-resources ?#22172;?#23017;閲?#37824;?#29863;勬簮</li> <li>娉?#37736;嬪疄渚嬪垱寤?#37928;勭?#35826;瀷?#24121;鏂?/li> <li>澶?#23534;?#29999;竎atch鎿嶄綔</li> <li>鏂囦欢API鎵╁睍</li> <li>闆?#37722;圓PI鏇存柊</li> <li>?#33503;鍙戠紪绋婣PI鏇存柊</li> <li>Unicode 6.0鐨勬敮鎸?/li> <li>JDBC 4.1 鏀?#37816;?RowSet 1.1</li> </ol> <p> [鏇存柊鏃?#38338;? 2013/10/16] <br/> [鍘熸枃鍦板潃锛?a target="_blank" href="http://imxylz.com/java/">Java 8 鍏?#38338;??#26570;鐗?#37804;?/a>] </p><img src ="http://www.5432034.com/xylz/aggbug/405031.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2013-10-16 00:33 <a href="http://www.5432034.com/xylz/archive/2013/10/16/405031.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Bash鍛?#28000;?#29882;?#23536;?#37928;勭紦瀛?/title><link>http://www.5432034.com/xylz/archive/2013/10/13/path-cache-of-bash-command.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Sun, 13 Oct 2013 14:16:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2013/10/13/path-cache-of-bash-command.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/404935.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2013/10/13/path-cache-of-bash-command.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/404935.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/404935.html</trackback:ping><description><![CDATA[     鎽?#29781;? Bash 涓?#27996;嗘彁楂?#37723;?#28000;?#37928;勮В鏋?#38315;熷害锛屽皢瑙?#37835;?#26473;?#37928;勫懡浠?#37928;?#37711;?#29882;?#23536;勪繚瀛?#37734;╤ash琛ㄤ腑锛屽?#29363;涓?#23046;?#37813;?#29723;岀?#21228;?#36346;?#28751;?#37827;?#38343;杩?#29723;屽?#23942;瑙?#37835;?#37510;傚鏋?#37734;╯hell?#33105;淇?#37824;?#27996;?#23480;茬粡缂?#28699;?#26473;?#37928;勫懡浠?#29882;?#23536;?#38171;?#38317;?#28052;坆ash鍙兘涓嶈兘绔嬪嵆鐢熸晥銆?#26473;欐牱灏变細鍙戠?#29111;懡浠?#28051;嶈兘瑙?#37835;?#37812;?#38000;呮?#22246;欢涓嶅瓨鍦?#37928;?#38338;?#26864;?#38171;屽?#30028;鍙?#37813;?#29723;屾?#22246;欢纭?#28729;?#28699;?#37734;?#37510;?nbsp; <a href='http://www.5432034.com/xylz/archive/2013/10/13/path-cache-of-bash-command.html'>闃?#29831;?#37711;?#37826;?/a><img src ="http://www.5432034.com/xylz/aggbug/404935.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2013-10-13 22:16 <a href="http://www.5432034.com/xylz/archive/2013/10/13/path-cache-of-bash-command.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>MAC涓嬫壒?#22138;杞?#37817;NG鍜孞PEGhttp://www.5432034.com/xylz/archive/2013/10/08/404759.htmlimxylzimxylzTue, 08 Oct 2013 09:17:00 GMThttp://www.5432034.com/xylz/archive/2013/10/08/404759.htmlhttp://www.5432034.com/xylz/comments/404759.htmlhttp://www.5432034.com/xylz/archive/2013/10/08/404759.html#Feedback1http://www.5432034.com/xylz/comments/commentRss/404759.htmlhttp://www.5432034.com/xylz/services/trackbacks/404759.html sips鐨?#37722;?#32457;?#37716;熻兘?#28522;甯?#23534;哄ぇ锛屽弬鑰?a target="_blank" href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/sips.1.html">甯?#37716;?#37826;囨。銆?br /> 杩?#38322;?#37812;?#28000;?#37721;?#37922;?#37714;?#37711;朵腑鐨?#28051;涓?#37716;熻兘锛?#26462;?#37817;㈠浘鐗?#37837;煎紡銆?br />
    鍛?#28000;?#37721;?#38000;?#38171;?br />
        sips -s format jpeg --out b.jpg a.png
    ?#21843;涓涓猵ng?#22738;?#22138;杞?#37817;pg鐨勮剼鏈?#38171;?br />

        cat  
    ~/bin/png2jpg
        #
    !/bin/bash
        # convert png files to jpeg files
        # usage: png2jpg 
    <file>

        
    for f in "$@"
        
    do
            sips 
    -s format jpeg --out "${f%.*}.jpg" "$f"
        done
    鍚屾?#23792;啓涓涓猨pg?#22738;?#22138;杞?#37817;ng鐨勮剼鏈?#38171;?br />

        cat 
    ~/bin/jpg2png
        #
    !/bin/bash
        # convert jpeg files to png files
        # usage: jpg2png 
    <file>

        
    for f in "$@"
        
    do
            sips 
    -s format png --out "${f%.*}.png" "$f"
        done
    浣?#37922;?#28186;嬪瓙锛?br />

        鉃?nbsp;
    ~/Downloads $ png2jpg QQ20131008-*.png
        
    /Users/adyliu/Downloads/QQ20131008-2.png
          
    /Users/adyliu/Downloads/QQ20131008-2.jpg
        
    /Users/adyliu/Downloads/QQ20131008-3.png
          
    /Users/adyliu/Downloads/QQ20131008-3.jpg
        
    /Users/adyliu/Downloads/QQ20131008-4.png
          
    /Users/adyliu/Downloads/QQ20131008-4.jpg
        鉃?nbsp;
    ~/Downloads $ ll QQ*
        
    -rw-r--r--  1 adyliu  staff    67K 10  8 15:43 QQ20131008-2.jpg
        
    -rw-r--r--1 adyliu  staff    88K 10  8 15:31 QQ20131008-2.png
        
    -rw-r--r--  1 adyliu  staff    23K 10  8 15:43 QQ20131008-3.jpg
        
    -rw-r--r--1 adyliu  staff    34K 10  8 15:31 QQ20131008-3.png
        
    -rw-r--r--  1 adyliu  staff    47K 10  8 15:43 QQ20131008-4.jpg
        
    -rw-r--r--1 adyliu  staff    44K 10  8 15:31 QQ20131008-4.png

    鍙?#38000;?#29863;勬枡:
    1. sips doc
    2. Resizing images using the command line
    3. Shell Parameter Expansion
    4. Extract filename and extension in bash
    鍘熸枃鍦板潃锛?a target="_blank" href="http://imxylz.com/blog/2013/10/08/batch-convert-png-to-jpeg-on-mac-os/">http://imxylz.com/blog/2013/10/08/batch-convert-png-to-jpeg-on-mac-os/

    imxylz 2013-10-08 17:17 鍙?#29723;?#29831;?#29825;?/a>
    ]]>
    Octopress鍔?#38315;烥oogle瀛椾綋娓叉煋http://www.5432034.com/xylz/archive/2013/09/22/move-google-fonts-to-local-server.htmlimxylzimxylzSun, 22 Sep 2013 13:42:00 GMThttp://www.5432034.com/xylz/archive/2013/09/22/move-google-fonts-to-local-server.htmlhttp://www.5432034.com/xylz/comments/404298.htmlhttp://www.5432034.com/xylz/archive/2013/09/22/move-google-fonts-to-local-server.html#Feedback0http://www.5432034.com/xylz/comments/commentRss/404298.htmlhttp://www.5432034.com/xylz/services/trackbacks/404298.html闃?#29831;?#37711;?#37826;?/a>

    imxylz 2013-09-22 21:42 鍙?#29723;?#29831;?#29825;?/a>
    ]]>JRebel 6.0.0 Crack (20141216鏇存柊)http://www.5432034.com/xylz/archive/2013/09/15/404098.htmlimxylzimxylzSun, 15 Sep 2013 15:24:00 GMThttp://www.5432034.com/xylz/archive/2013/09/15/404098.html闃?#29831;?#37711;?#37826;?/a>

    imxylz 2013-09-15 23:24 鍙?#29723;?#29831;?#29825;?/a>
    ]]>鐢?#29831;稴SL璇佷功鍙奛ginx鏀?#37816;丠TTPShttp://www.5432034.com/xylz/archive/2013/09/11/403965.htmlimxylzimxylzWed, 11 Sep 2013 13:58:00 GMThttp://www.5432034.com/xylz/archive/2013/09/11/403965.htmlhttp://www.5432034.com/xylz/comments/403965.htmlhttp://www.5432034.com/xylz/archive/2013/09/11/403965.html#Feedback0http://www.5432034.com/xylz/comments/commentRss/403965.htmlhttp://www.5432034.com/xylz/services/trackbacks/403965.html闃?#29831;?#37711;?#37826;?/a>

    imxylz 2013-09-11 21:58 鍙?#29723;?#29831;?#29825;?/a>
    ]]>?#27554;鏈?#38315;?#37815;?#38342;?#37722;?#37928;勫瓙鍏冪礌闆?#37722;?/title><link>http://www.5432034.com/xylz/archive/2013/08/17/402978.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Sat, 17 Aug 2013 09:44:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2013/08/17/402978.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/402978.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2013/08/17/402978.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/402978.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/402978.html</trackback:ping><description><![CDATA[<div>鎴?#38343;瑕佷竴涓?#28000;?#38342;?#37722;圢?#33105;?#27554;鏈?#38315;?#37815;㎝涓瓙鍏冪礌鐨勭畻?#30838;銆??#32139;鐒舵渶濂?#37928;?#37716;炴硶鏄?#28751;?#38342;?#37722;堟墦涔?#26916;哄簭锛岀劧鍚?#28000;庝腑閫?#37815;╁墠M涓?#37711;冪礌鍗?#37721;?#37510;?Java?#33105;鐜?#37812;?#37928;凙PI鍙?#28000;?#28003;?#37922;?#38171;?/div> <div> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->java.util.Collections.shuffle(List<?>)<br /> </div> </div> <div> <div>姝?#32480;?#23049;曢潪甯哥畝鍗?#38171;屽惊鐜疦娆?#38171;?#23011;?#23046;?#38336;?#25652;﹀噺灏?锛岄殢鏈鸿幏鍙?#37711;朵腑涓涓?#37711;冪礌锛岀劧鍚?#27996;?#37817;?#37711;跺绉?#37711;冪礌銆?/div> </div> <div> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">void</span> shuffle(List<?> list, Random rnd) {<br />     <span style="color: #0000FF; ">int</span> size = list.size();<br />     <span style="color: #0000FF; ">if</span> (size < SHUFFLE_THRESHOLD || list <span style="color: #0000FF; ">instanceof</span> RandomAccess) {<br />         <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i=size; i>1; i--)<br />             swap(list, i-1, rnd.nextInt(i));<br />     } <span style="color: #0000FF; ">else</span> {<br />         Object arr[] = list.toArray();<br /> <br />         <span style="color: #008000; ">//</span><span style="color: #008000; "> Shuffle array</span><span style="color: #008000; "><br /> </span>        <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i=size; i>1; i--)<br />             swap(arr, i-1, rnd.nextInt(i));<br /> <br />         <span style="color: #008000; ">//</span><span style="color: #008000; "> Dump array back into list</span><span style="color: #008000; "><br /> </span>        ListIterator it = list.listIterator();<br />         <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i=0; i<arr.length; i++) {<br />             it.next();<br />             it.set(arr[i]);<br />         }<br />     }<br /> }</div> </div> <div><br /> </div> <div> <div>鏈夌偣?#21104;鎬?#37928;剆wap鍑芥暟</div> </div> <div> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><br /> <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">void</span> swap(List<?> list, <span style="color: #0000FF; ">int</span> i, <span style="color: #0000FF; ">int</span> j) {<br />     <span style="color: #0000FF; ">final</span> List l = list;<br />     l.set(i, l.set(j, l.get(i)));<br /> }<br /> </div> </div> <div><br /> </div> <div> <div>鍏?#28729;?#37812;?#28000;?#37928;?#38343;姹傚?#22562;畝鍗?#38171;屽湪?#29056;鏈?#28051;?#37721;樼殑闆?#37722;堜腑锛屽娆?#38322;嶅?#23945;殢鏈鸿幏鍙?#37711;跺瓙闆?#38171;?#38007;?#27996;庡瓙闆?#37828;?#37722;?#37832;?#25652;?#37812;?#38000;呴殢鏈?#28051;?#38322;嶈鐨?#38171;?閲嶈鐨勬槸鍘?#38342;?#37722;堜腑鐨勬瘡涓?#37711;冪?#29371;兘鏈?#37929;?#28028;?#37928;勬鐜囧嚭鐜?#37734;ㄥ瓙闆?#37722;堜腑銆?/div> <div><br /> </div> <div>鑰冭?#25117;埌鎬ц兘浠?#37721;婂苟鍙?#29825;?#38338;?#38171;堝?#27697;嚎绋?#38171;?#37928;?#38343;瑕?#38171;?#37812;戞兂鍒?#27996;?#28051;涓畝鍗?#37928;勭畻?#30838;锛?/div> </div> <div>缁?#28729;歂涓?#37711;冪礌闆?#37722;?#38171;?#28000;庝腑閫?#37815;㎝(0<M<=N)涓?#37711;冪礌鐨?#37716;炴硶鏄?#38171;?/div> <div> <ol> <li>?#27554;鏈?#38315;?#37815;?#32497;?#23534;昁(0<=K<N), i=0, 绌哄瓙闆?/li> <li>鍙?#37832;夋晥鍏冪礌N(k-i),N(k+i) 鍔?#37711;?#37832;弧?#29913;闆哅</li> <li>i+=1, 閲嶅(2) 鐩?#37714;板瓙闆哅宸叉弧</li> <li>缁堟</li> </ol> </div> <div> <div>杩欐牱鍙栧嚭鏉?#37928;?#37711;冪礌铏界劧鍜屽?#29111;?#23342;泦椤哄簭鏈?#28051;瀹?#37928;?#37711;崇郴锛屼絾鏄?#23011;?#28051;?#37711;冪礌鍦ㄥ瓙闆?#38322;屽嚭鐜扮?#21228;鐜?#37929;稿綋锛屾弧瓒?#32513;?#37835;?#29781;佹眰銆?鏈鍚庣敓鎴?#37928;勭畻娉曞涓?#38171;?/div> </div> <div> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <T> List<T> randomList(List<T> views, <span style="color: #0000FF; ">int</span> max) {<br /> <br />     <span style="color: #0000FF; ">final</span> <span style="color: #0000FF; ">int</span> size = views.size();<br />     <span style="color: #0000FF; ">int</span> index = RandomUtils.nextInt(size);<br />     <span style="color: #008000; ">//<br /> </span>    List<T> ret = <span style="color: #0000FF; ">new</span> ArrayList<T>(max);<br />     <span style="color: #0000FF; ">int</span> low = index - 1, high = index;<br />     <span style="color: #0000FF; ">while</span> (max > 0 && (low >= 0 || high < size)) {<br />         <span style="color: #0000FF; ">if</span> (low >= 0 && max-- > 0) {<br />             ret.add(views.get(low));<br />         }<br />         <span style="color: #0000FF; ">if</span> (high < size && max-- > 0) {<br />             ret.add(views.get(high));<br />         }<br />         low--;<br />         high++;<br />     }<br />     <span style="color: #0000FF; ">return</span> ret;<br /> }</div> </div> <div><br /> </div> <div>姝?#32480;楁硶?#24359;瓒冲涓?#37911;圭偣锛?/div> <div> <ol> <li>瓒?#28598;?#36423;?/li> <li>绾?#32459;嬪畨鍏?#38171;堝?#29111;?#23342;泦鍚?#28051;?#37721;?#38171;?/li> <li>?#29913;鍏冪礌?#22189;鐜?#22994;?#37916;?#37929;稿綋锛?#37832;粡?#26271;瀛?#29831;?#37828;?/li> </ol> <div><br /> </div> </div> <div>鍙?#28598;?#38171;宻tackoverflow涓?#28052;?#37832;?#28051;浜?#37721;?#38000;冮摼鎺?#38171;?/div> <div> <ul> <li><a href="http://stackoverflow.com/questions/48087/select-a-random-n-elements-from-listt-in-c-sharp" target="_blank"> </a></li> <li><a href="http://stackoverflow.com/questions/48087/select-a-random-n-elements-from-listt-in-c-sharp" target="_blank">Select a random N elements from List in C#</a></li> <a href="http://stackoverflow.com/questions/48087/select-a-random-n-elements-from-listt-in-c-sharp" target="_blank"> </a> <li>http://mcherm.com/permalinks/1/a-random-selection-algorithm</li> <li>http://stackoverflow.com/questions/4702036/take-n-random-elements-from-a-liste</li> </ul> </div> <br /> <div>[ 鍘熸枃鍦板潃 <a href="http://imxylz.com/blog/2013/08/14/select-a-random-sublist-from-list-in-java/">http://imxylz.com/blog/2013/08/14/select-a-random-sublist-from-list-in-java/</a> ]</div><img src ="http://www.5432034.com/xylz/aggbug/402978.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2013-08-17 17:44 <a href="http://www.5432034.com/xylz/archive/2013/08/17/402978.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>鎹?#38014;稪ava绾?#32459;?#23033;犳墽琛?#28000;诲姟鎶涘嚭鐨?#23534;?#29999;?/title><link>http://www.5432034.com/xylz/archive/2013/08/05/402405.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Mon, 05 Aug 2013 08:45:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2013/08/05/402405.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/402405.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2013/08/05/402405.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/402405.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/402405.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">Java?#33105;绾?#32459;?#37813;?#29723;岀殑浠诲姟鎺?#37721;ava.lang.Runnable 瑕佹眰涓?#37814;涘嚭Checked寮?#29999;?#38171;?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">interface</span><span style="color: #000000; "> Runnable {<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">abstract</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> run();<br />}</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">閭?#28052;堝鏋?run() 鏂规硶?#33105;鎶涘嚭浜哛untimeException锛屽?#21973;細鎬庝?#22557;?#21229;悊浜?#38171;?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">閫?#29999;竕ava.lang.Thread瀵硅薄?#32333;琛?#29825;?#32515;?#28051;涓?#27035;?#29825;?#37928;?#23534;?#29999;?#28598;勭悊鏂规硶锛?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">java.lang.Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler)<br /></span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">鑰?#26473;?#28051;?#27035;?#29825;?#37928;?#38344;?#37804;?#37711;?#28766;鐨?#23534;?#29999;告崟鑾?#37826;规硶鏃惰?#25779;嚭鍫?#37837;?#37510;?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">?#32139;鐒?#38171;?#37812;?#28000;?#37721;?#28000;?#29781;?#37929;?#23005;?#27035;?#29825;?#28729;?#37916;?#38171;屽彧闇瑕佷竴涓嚜瀹?#28052;?#37928;刯ava.lang.Thread.UncaughtExceptionHandler鎺?#37721;?#28729;?#37916;?#37719;?#37721;?#37510;?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">interface</span><span style="color: #000000; "> UncaughtExceptionHandler {<br /><br />    </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> uncaughtException(Thread t, Throwable e);<br />}</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">鑰屽湪绾?#32459;?#23033;犱腑鍗存?#26055;緝鐗规畩銆?#27035;?#29825;ゆ儏鍐?#28051;?#38171;岀嚎绋?#23033;?java.util.concurrent.ThreadPoolExecutor ?#32048;Catch浣?#37813;鏈?#23534;?#29999;?#38171;??#32139;浠诲姟鎵?#29723;屽畬鎴?java.util.concurrent.ExecutorService.submit(Callable<t>))鑾?#37721;?#37711;?#32513;?#37835;?鏃?java.util.concurrent.Future.get())?#32048;鎶涘嚭姝untimeException銆?/t></p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">/**</span><span style="color: #008000; "><br /> * Waits if necessary for the computation to complete, and then<br /> * retrieves its result.<br /> *<br /> * </span><span style="color: #808080; ">@return</span><span style="color: #008000; "> the computed result<br /> * </span><span style="color: #808080; ">@throws</span><span style="color: #008000; "> CancellationException if the computation was cancelled<br /> * </span><span style="color: #808080; ">@throws</span><span style="color: #008000; "> ExecutionException if the computation threw an exception<br /> * </span><span style="color: #808080; ">@throws</span><span style="color: #008000; "> InterruptedException if the current thread was interrupted while waiting<br /> </span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br />V get() </span><span style="color: #0000FF; ">throws</span><span style="color: #000000; "> InterruptedException, ExecutionException;</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">鍏朵腑 ExecutionException 寮?#29999;?#37719;虫槸java.lang.Runnable 鎴?#38000;?java.util.concurrent.Callable 鎶涘嚭鐨?#23534;?#29999;?#37510;?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">涔?#28751;?#37828;?#29831;?#38171;岀嚎绋?#23033;?#37734;?#37813;?#29723;?#28000;诲姟鏃舵崟鑾?#27996;?#37813;鏈?#23534;?#29999;?#38171;屽苟灏?#23005;?#23534;?#29999;?#37716;?#37711;?#32513;?#37835;滀腑銆?#26473;欐牱涓鏉?#32510;?#32459;?#23033;犱腑鐨勬墍鏈夌嚎绋嬮兘灏?#37827;犳硶鎹?#38014;?#37714;?#37814;涘嚭鐨?#23534;?#29999;?#37510;?浠?#38000;屾?#29363;?#26338;?#26473;?#29825;?#32515;?#32510;?#32459;?#37928;?#27035;?#29825;?#37817;?#38014;?#37826;规硶鎷?#37812;?#37928;勯敊璇?#23534;?#29999;?#37510;?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">涔?#28051;?#37722;岄?#26473;?a href="http://stackoverflow.com/questions/1838923/why-is-uncaughtexceptionhandler-not-called-by-executorservice" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">?#22172;瀹?#28052;夌嚎绋?/a>鏉?#28729;?#37812;?#23534;?#29999;?#37928;?#37815;?#37812;?#37510;?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">濂?#37734;╦ava.util.concurrent.ThreadPoolExecutor 棰勭暀浜?#28051;涓?#37826;规硶锛岃繍琛屽湪浠诲姟鎵?#29723;屽畬姣?#26473;?#29723;屾墿?#30541;锛堝綋鐒?#28052;熼?#21229;暀涓涓猵rotected鏂规硶beforeExecute(Thread t, Runnable r)锛?#38171;?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline;">protected void afterExecute(Runnable r, Throwable t) { } </code></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">姝?#37826;规硶鐨?#27035;?#29825;?#28729;?#37916;?#28051;虹┖锛?#26473;欐牱鎴?#28000;?#28751;?#37721;?#28000;?#38315;?#26473;?#32513;?#37813;?#37812;?#38000;?#29781;?#37929;朤hreadPoolExecutor 鏉?#26440;惧?#25292;嚜瀹?#28052;?#37928;勯敊璇?#28598;勭悊銆?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">瑙?#37712;?#37716;?#23049;曞涓?#38171;?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">ThreadPoolExecutor threadPoolExecutor </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> ThreadPoolExecutor(</span><span style="color: #000000; ">11</span><span style="color: #000000; ">, </span><span style="color: #000000; ">100</span><span style="color: #000000; ">, </span><span style="color: #000000; ">1</span><span style="color: #000000; ">, TimeUnit.MINUTES, </span><span style="color: #008000; ">//<br /></span><span style="color: #000000; ">        </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> ArrayBlockingQueue</span><span style="color: #000000; "><</span><span style="color: #000000; ">Runnable</span><span style="color: #000000; ">></span><span style="color: #000000; ">(</span><span style="color: #000000; ">10000</span><span style="color: #000000; ">),</span><span style="color: #008000; ">//<br /></span><span style="color: #000000; ">        </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> DefaultThreadFactory()) {<br /><br />    </span><span style="color: #0000FF; ">protected</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> afterExecute(Runnable r, Throwable t) {<br />        </span><span style="color: #0000FF; ">super</span><span style="color: #000000; ">.afterExecute(r, t);<br />        printException(r, t);<br />    }<br />};<br /><br /></span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> printException(Runnable r, Throwable t) {<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (t </span><span style="color: #000000; ">==</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; "> </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> r </span><span style="color: #0000FF; ">instanceof</span><span style="color: #000000; "> Future</span><span style="color: #000000; "><?></span><span style="color: #000000; ">) {<br />        </span><span style="color: #0000FF; ">try</span><span style="color: #000000; "> {<br />            Future</span><span style="color: #000000; "><?></span><span style="color: #000000; "> future </span><span style="color: #000000; ">=</span><span style="color: #000000; "> (Future</span><span style="color: #000000; "><?></span><span style="color: #000000; ">) r;<br />            </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (future.isDone())<br />                future.get();<br />        } </span><span style="color: #0000FF; ">catch</span><span style="color: #000000; "> (CancellationException ce) {<br />            t </span><span style="color: #000000; ">=</span><span style="color: #000000; "> ce;<br />        } </span><span style="color: #0000FF; ">catch</span><span style="color: #000000; "> (ExecutionException ee) {<br />            t </span><span style="color: #000000; ">=</span><span style="color: #000000; "> ee.getCause();<br />        } </span><span style="color: #0000FF; ">catch</span><span style="color: #000000; "> (InterruptedException ie) {<br />            Thread.currentThread().interrupt(); </span><span style="color: #008000; ">//</span><span style="color: #008000; "> ignore/reset</span><span style="color: #008000; "><br /></span><span style="color: #000000; ">        }<br />    }<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (t </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">)<br />        log.error(t.getMessage(), t);<br />}</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">姝?#37716;炴硶鐨?#37711;?#38335;?#37734;?#27996;?#38171;?#27996;嬪疄涓?afterExecute ?#33503;涓嶄細鎬?#37828;?#37814;涘嚭寮?#29999;?Throwable t锛岄?#26473;囨煡鐪嬫簮鐮佸緱?#29025;锛屽紓甯?#37828;?#28751;佽鍦?#23005;?#37827;?#37928;凢uture瀵硅薄?#33105;鐨?#38171;?鑰屾Future瀵硅薄鍏?#28729;?#37828;?#28051;涓猨ava.util.concurrent.FutureTask<v>鐨?#28729;?#37916;?#38171;岄粯璁?#37928;剅un鏂规硶鍏?#28729;?#29835;?#37922;?#37928;?java.util.concurrent.FutureTask.Sync.innerRun()銆?/v></p><code style="margin: 0px; padding: 0px; border: 0px; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline;"> </code><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">void</span> innerRun() {<br />    <span style="color: #0000FF; ">if</span> (!compareAndSetState(0, RUNNING))<br />        <span style="color: #0000FF; ">return</span>;<br />    <span style="color: #0000FF; ">try</span> {<br />        runner = Thread.currentThread();<br />        <span style="color: #0000FF; ">if</span> (getState() == RUNNING) <span style="color: #008000; ">//</span><span style="color: #008000; "> recheck after setting thread</span><span style="color: #008000; "><br /></span>            innerSet(callable.call());<br />        <span style="color: #0000FF; ">else</span><br />            releaseShared(0); <span style="color: #008000; ">//</span><span style="color: #008000; "> cancel</span><span style="color: #008000; "><br /></span>    } <span style="color: #0000FF; ">catch</span> (Throwable ex) {<br />        innerSetException(ex);<br />    }<br />}<br /><br /><span style="color: #0000FF; ">void</span> innerSetException(Throwable t) {<br />    <span style="color: #0000FF; ">for</span> (;;) {<br />        <span style="color: #0000FF; ">int</span> s = getState();<br />        <span style="color: #0000FF; ">if</span> (s == RAN)<br />            <span style="color: #0000FF; ">return</span>;<br />        <span style="color: #0000FF; ">if</span> (s == CANCELLED) {<br />            <span style="color: #008000; ">//</span><span style="color: #008000; "> aggressively release to set runner to null,<br />            </span><span style="color: #008000; ">//</span><span style="color: #008000; "> in case we are racing with a cancel request<br />            </span><span style="color: #008000; ">//</span><span style="color: #008000; "> that will try to interrupt runner</span><span style="color: #008000; "><br /></span>            releaseShared(0);<br />            <span style="color: #0000FF; ">return</span>;<br />        }<br />        <span style="color: #0000FF; ">if</span> (compareAndSetState(s, RAN)) {<br />            exception = t;<br />            result = <span style="color: #0000FF; ">null</span>;<br />            releaseShared(0);<br />            done();<br />            <span style="color: #0000FF; ">return</span>;<br />        }<br />    }<br />}</div><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">杩?#38322;?#37812;?#28000;?#37721;?#28000;?#37930;嬪埌瀹?#37722;?#37818;?#27996;?#23534;?#29999;?#38171;屽皢寮?#29999;稿瓨?#20557;鍦╦ava.util.concurrent.FutureTask.Sync鐨別xception瀛楁?#20856;腑锛?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">/**</span><span style="color: #008000; "> The exception to throw from get() </span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> Throwable exception;<br /></span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">?#32139;鎴?#28000;?#38014;?#37721;?#23534;傛鎵?#29723;岀?#21229;粨鏋?#37827;?#38171;?java.util.concurrent.FutureTask.get()</p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">public</span><span style="color: #000000; "> V get() </span><span style="color: #0000FF; ">throws</span><span style="color: #000000; "> InterruptedException, ExecutionException {<br />    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> sync.innerGet();<br />}</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">java.util.concurrent.FutureTask.Sync.innerGet()</p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">V innerGet() </span><span style="color: #0000FF; ">throws</span><span style="color: #000000; "> InterruptedException, ExecutionException {<br />    acquireSharedInterruptibly(</span><span style="color: #000000; ">0</span><span style="color: #000000; ">);<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (getState() </span><span style="color: #000000; ">==</span><span style="color: #000000; "> CANCELLED)<br />        </span><span style="color: #0000FF; ">throw</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> CancellationException();<br />    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (exception </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">)<br />        </span><span style="color: #0000FF; ">throw</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> ExecutionException(exception);<br />    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> result;<br />}</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">寮?#29999;?#28751;变細琚?#37718;呰鎴怑xecutionException寮?#29999;?#37814;涘嚭銆?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">涔?#28751;?#37828;?#29831;村綋鎴?#28000;兂绾?#32459;?#23033;?ThreadPoolExecutor(java.util.concurrent.ExecutorService)?#24385;浜?#28000;诲姟鏃?#38171;?濡?#37835;?#28051;嶇?#21973;細浠诲姟缁?#37835;?#38171;團eture.get()锛?#38171;?#38317;?#28052;堟寮?#29999;?#28751;?#29722;?#32510;?#32459;?#23033;?#37722;?#37818;?#37510;?/p><pre style="margin-top: 0px; margin-bottom: 2.1em; padding: 0.8em 1em; border: 1px solid #05232b; font-family: Menlo, Monaco, 'Andale Mono', 'lucida console', 'Courier New', monospace; line-height: 1.45em; font-size: 13px; vertical-align: baseline; -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; box-shadow: rgba(0, 0, 0, 0.0588235) 0px 0px 10px; background-image: url(http://imxylz.com/images/noise.png?1375426420); background-color: #002b36; border-top-left-radius: 0.4em; border-top-right-radius: 0.4em; border-bottom-right-radius: 0.4em; border-bottom-left-radius: 0.4em; color: #93a1a1; overflow: auto; background-position: 0% 0%;"><div style="background-color: #eeeeee; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; "><</span><span style="color: #000000; ">T</span><span style="color: #000000; ">></span><span style="color: #000000; "> Future</span><span style="color: #000000; "><</span><span style="color: #000000; ">T</span><span style="color: #000000; ">></span><span style="color: #000000; "> submit(Callable</span><span style="color: #000000; "><</span><span style="color: #000000; ">T</span><span style="color: #000000; ">></span><span style="color: #000000; "> task);<br />Future</span><span style="color: #000000; "><?></span><span style="color: #000000; "> submit(Runnable task);</span></div></pre><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">鑰宩ava.util.concurrent.ScheduledThreadPoolExecutor鏄?#32513;?#37813;縏hreadPoolExecutor鐨?#38171;屽?#29363;?#20751;鍐电被浼?#37510;?/p><p style="margin: 0px 0px 1.5em; padding: 0px; border: 0px; font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif; line-height: 27.59375px; font-size: 18px; vertical-align: baseline; color: #222222; background-color: #f8f8f8;">缁?#29825;?#38171;岄?#26473;?#29781;?#37929;朤hreadPoolExecutor.afterExecute 鏂规硶锛?#37812;?#28000;墠?#20824;鎹?#38014;?#37714;?#28000;诲姟鐨?#23534;?#29999;?#38171;圧untimeException锛?#37510;?br /><br />鍘熸枃鍦板潃锛?span style="font-family: verdana, 'courier new'; font-size: 14px; line-height: 21px;"><a href="http://imxylz.com/blog/2013/08/02/handling-the-uncaught-exception-of-java-thread-pool/" target="_blank">http://imxylz.com/blog/2013/08/02/handling-the-uncaught-exception-of-java-thread-pool/</a></span></p><img src ="http://www.5432034.com/xylz/aggbug/402405.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2013-08-05 16:45 <a href="http://www.5432034.com/xylz/archive/2013/08/05/402405.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Python ?#29056;纭鏂?#28000;舵?#23940;綔http://www.5432034.com/xylz/archive/2013/02/24/395677.htmlimxylzimxylzSun, 24 Feb 2013 12:55:00 GMThttp://www.5432034.com/xylz/archive/2013/02/24/395677.htmlhttp://www.5432034.com/xylz/comments/395677.htmlhttp://www.5432034.com/xylz/archive/2013/02/24/395677.html#Feedback0http://www.5432034.com/xylz/comments/commentRss/395677.htmlhttp://www.5432034.com/xylz/services/trackbacks/395677.html

    File - ?#29056;纭鏂?#28000;舵?#23940;綔

    瀛?#28052;?#28051;闂?#29831;?#29815;锛?#37812;?#37804;?#37828;?#37728;?#23046;?#28000;?#37826;囦欢寮濮?#37510;傛枃鏈?#37826;囦欢鐨?#29831;诲啓鎿嶄綔鏄?#37812;?#23011;旇?#20904;湪?#21104;鐨勫熀鏈?#37716;熻兘銆?鍦?#26473;?#37826;?#38344;?#38171;孞ava璇?#29815;鍔熻兘姣旇?#20904;?#21700;ぇ锛岀敤鍒扮殑璁?#29825;?#22959;″紡涔熼潪甯?#28598;?#37510;?#37721;?#37828;?#28003;?#37922;?#29863;?#37833;?#28598;?#26473;囩箒鐞?#37510;?鑰孭ython鍦?#26473;?#37826;?#38344;?#29723;?#37916;伴潪甯稿ソ锛岀畝娲佷?#23941;け鍔熻兘锛屽?#21700;ぇ涓嶅け鎬ц兘锛岄?#28103;?#28051;嶅け浼?#38342;?#38171;屽?#23536;?#32457;?#29863;?#37510;?/p>

    鎴?#28000;?#28000;?#28051;涓?#37832;?#30045;鍗?#37928;?#23534;濮?#37510;?/p>

    with open('/etc/resolv.conf') as f:
    print(f.read())

    杩?#38322;?#37832;?#37922;?#37714;?a href="http://www.python.org/dev/peps/pep-0343/" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">with璇硶鏉?#37711;?#38338;?#37826;囦欢鍙?#37836;?#37510;?/p>

    open()

    棣?#37711;堟潵浜?#29785;?#28051;?a href="http://docs.python.org/3.3/library/functions.html#open" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">open()鍐?#32515;?#37713;芥暟銆?/p>

    open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
    Open file and return a corresponding file object. If the file cannot be opened, an OSError is raised.

    open()鐨?#37721;傛暟浼?#28598;?#38171;岄?#29999;?#38343;瑕?#37711;虫敞鐨勬槸mode/encoding/errors/newline绛?#37510;?/p>

    鏈浣?#28729;?#29882;?/h3>
    (1) 璇?#37721;?#37826;囦欢蹇呴』浼?#37711;?#28699;楃?#32042;?#29212;encoding 
    (2) 鐢?#28729;岀?#21228;?#20352;渶瑕?#37711;?#38338;?#38171;屾帹?#23832;浣?#37922;╳ith鎿嶄綔
    (3) 鎹?#29723;岀灏?#37721;兘鐨?#28003;?#37922;║NIX鏍煎紡(\n)锛屽?#30028;python鍙?#28000;?#37829;鸿兘杞?#37817;?
    (4) 濡?#37835;?#37721;?#28000;?#37928;?#29831;?#28751;?#37721;兘鐨?#28003;?#37922;╱tf-8?#32042;鐮佹潵澶勭悊?#28522;ascii瀛楃锛?#28051;嶈?#20343;緷璧?#37823;嶄綔?#37108;缁?#37928;勭紪?#29212;

    灏?#29840;村+

    澶?#28051;?#37826;囦欢鍚屾?#33333;?#23940;綔鍙?#28003;?#37922;╳ith鐨?#29831;硶锛?/p>

    with open('/etc/hosts','r') as f,open('/tmp/hosts','w') as t:
    //do something

    鎴?#38000;?/p>

    with f=open('/etc/hosts'),t=open('/tmp/hosts','w'):
    // do something

    file object

    鏂囦欢瀵硅薄鎻?#26473;扮?#21228;槸涓绉?#8220;娴?#8221;鎿嶄綔锛岄?#29999;?#37824;?#37816;乺ead()鎴?#38000;厀rite()鏂规硶銆?杩?#38322;岀?#21228;?#22246;欢瀵硅薄鏄?#28051;绉嶆?#20634;康涓?#37928;?#8220;鏂囦欢瀵硅薄”锛岄櫎浜?#29999;?#29785;?#37928;勭湡鏄?#37928;勭鐩?#37826;囦欢锛?#26473;?#37721;?#28000;?#37828;??#29219;?#22127;杈?#37711;?#26440;撳嚭鏂囦欢(stdin/stdout/stderr)锛屽唴瀛樼紦鍐?#37718;?StringIO,cStringIO)锛?socket锛宲ipes绛?#37510;?/p>

    杩?#37734;?a href="http://www.imxylz.com/python/io.html" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">io妯?#37735;椾腑鏈?#37711;?#28003;?#37928;勬弿杩?#37510;?/p>

    鏂?#37832;?#37823;嶄綔鍜?#27996;?#26473;?#37714;舵?#23940;綔鏈?#28051;浜?#37718;哄埆銆傚垎?#22470;浠?#32513;?#37510;?/p>

    Text I/O

    濡?#37835;?a href="http://docs.python.org/3.3/library/functions.html#open" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">mode?#33105;鍖?#37722;玹锛?#27035;?#29825;?#38171;?#38171;?#38317;?#28052;?#26473;?#37733;?#37928;勬祦鏄?#28051;涓?#32510;?#37826;?#37832;?#37823;嶄綔銆?/p>

    read() 鏄?#29831;?#37721;?#37826;?#37832;?#37928;勬渶?#30045;鍗?#37928;勬?#35268;硶銆?#26473;?#37733;?#37928;勬槸瀛楃涓插舰?#32033;鐨勭粨鏋?#38171;?#37724;屽?#20635;暟encoding鏈?#37711;?#38171;?#37510;?/p>

    read(n)
    Read and return at most n characters from the stream as a single str. If n is negative or None, reads until EOF.

    鍦?#23536;堝?#27692;?#22798;?#21616;剼鏈腑鏈?#38171;?/p>

    readme=open('./README.md').read() 

    ?#34987;浼?#37928;?#37922;ㄦ硶銆?#26473;?#37734;?#28051;涓?#36423;?#38315;?#32513;?#37833;?#37928;?#32459;嬪?#24526;腑闂?#26864;?#28051;嶅ぇ銆?#37734;?#23005;e紡鐨勬湇鍔′腑搴?#29831;ラ殢鏃?#37711;?#38338;?#37826;囦欢鍙?#37836;?#38322;?#37824;?#29863;勬簮銆?/p>

    灏?#29840;村+锛?/p>

    濡?#37835;?#23480;茬粡璇?#37721;?#37714;?#37826;?#28000;舵湯灏?#38171;宺ead()鍒?#26473;?#37733;?#32460;哄?#26947;涓?'銆?

    濡?#37835;?#29781;佽鍙?#28051;琛?#38171;屼娇鐢╮eadline()鏂规硶銆?/p>

    readline(limit=-1)
    Read until newline or EOF and return a single str. If the stream is already at EOF, an empty string is returned. If limit is specified, at most limit characters will be read.

    璇?#37721;?#28051;琛屾剰鍛崇潃鍜?#29723;岀粨鏉?#32471;?#37832;?#37711;?#38171;?#26473;?#28051;?#37832;夌偣澶?#37833;?#37510;?/p>

    璇?#37721;?#28598;?#29723;?#38171;屼娇鐢╮eadlines()鏂规硶銆?#26473;?#28751;?#26473;?#37733;?#28051;涓?#28699;楃涓?#37714;?#29723;?#37510;俽eadlines()涔?#37721;?#28000;?#38340;愬?#33333;渶澶?#29831;?#37721;?#28598;氬皯涓?#28699;楃銆?/p>

    灏?#29840;村+锛?/p>

    readline(limit=-1)鍜宺eadlines(limit=-1)瀵筶imit鐨勬弿杩?#28051;嶅お涓鑷?#37510;?
    readline(limit=-1)鎻?#26473;扮?#21228;槸璇?#37721;?#28051;琛?#38171;?#37832;澶?#28051;嶈秴杩噇imit涓?#28699;楃锛?#28051;?#37828;?#28699;楄妭锛?#38171;屽?#29363;鏈?#37721;?#38003;界粨鏋?#28051;?#37828;?#37836;?#28051;琛岀?#21229;粨鏉?#37510;?
    readlines(limit=-1)鎻?#26473;扮?#21228;槸璇?#37721;栧?#26947;锛岀洿鍒發imit涓?#28699;楃鎵鍦?#37928;?#29723;岀粨鏉?#37510;?#28052;?#28751;?#37828;?#26473;?#37733;?#37928;勭粨鏋?#28051;瀹?#37828;?#37836;?#28051;琛岀?#21229;粨鏉??#27342;?#28522;EOF)銆?

    渚嬪锛?br />>>> open('/tmp/x1','w').write('Python鐪?#37828;?#28051;涓?#28610;?#37722;屽\n鍙?#37828;?#38340;愬埗琚?#37715;?#29761;?#37812;?#28051;?#28051;?#37911;?#37832;?#27996;哱n鎴?#37824;?#37816;乸ython3.x')
    40
    >>> open('/tmp/x1','r').readline(10)
    'Python鐪?#37828;?#28051;涓?
    >>> open('/tmp/x1','r').readlines(10)
    ['Python鐪?#37828;?#28051;涓?#28610;?#37722;屽\n']

    readlines(limit)鏄?#28051;涓?#38341;?#28000;?#37918;?#29785;?#37928;?#38315;?#26440;?#37510;傚鏋?#37721;?#28000;?#28051;嶈?#20352;殢渚?#28028;?#26440;?#28051;涓?#37721;傛暟銆?a href="http://stackoverflow.com/questions/15050607/what-does-io-iobase-readlineshinit-mean-in-python" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">鍙?#38000;冭繖閲?/a>銆?/p>


    ?#21843;鍏?#37826;?#37832;?#37721;?#28003;?#37922;╳rite(s)鏂规硶锛?/p>

    write(s) Write the string s to the stream and return the number of characters written. 

    ?#21843;鍏?#37928;勬槸瀛楃涓?#38171;?#38000;?#28051;?#37828;?#28699;楄妭銆傚鏋?#29781;佸啓鍏?#28598;?#29723;屽?#26947;涓?#38171;屽彲浠?#28003;?#37922;╳ritelines(lines)鏂规硶銆?/p>

    灏?#29840;村+锛?/p>

    write(s)鍜寃ritelines(lines)涓嶄?#27692;皢琛岀粨鏉?#32471;﹀啓鍏?#37826;?#28000;舵祦銆傚?#29363;闇瑕佹?#23338;姩?#21843;鍏?#29723;岀粨鏉?#32471;?#37510;?

    Binary I/O

    浜?#26473;?#37714;舵?#20344;拰鏂?#37832;?#23092;佺被浼?#38171;屽彧鏄?#27996;?#26473;?#37714;舵?#20345;病鏈塭ncoding涓璇?#37510;傛墦寮浜?#26473;?#37714;舵?#20352;渶瑕佷紶鍏?#37721;傛暟mode?#33105;鍖?#37722;?#8217;b’銆?/p>

    渚嬪锛?/p>

    >>> type(open('/etc/hosts','rb').read())
    <class 'bytes'>

    瀵?#23011;?#37826;?#37832;?#23092;?#38171;?#27996;?#26473;?#37714;舵祦鏈?#28051;浜?#28751;?#37928;?#23480;埆锛?/p>

    鍏?#28729;?#37826;?#28000;舵?#23940;綔

    ?#27342;浜唕ead/write鏂规硶锛屾?#22246;欢瀵硅薄杩?#37832;?#28051;浜?#37711;?#28729;?#37928;勫唴缃?#37826;规硶锛?/p>

    灏?#37734;?a href="http://www.imxylz.com/python/io.html" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; vertical-align: baseline; color: #751590; -webkit-transition: color 0.3s; white-space: pre-wrap; word-wrap: break-word;">I/O浠?#32513;?#37831;?#28598;?#37928;勭煡璇?#37510;?/p>

    imxylz 2013-02-24 20:55 鍙?#29723;?#29831;?#29825;?/a>
    ]]>Crack JRebel 5.3.1http://www.5432034.com/xylz/archive/2012/12/26/393498.htmlimxylzimxylzWed, 26 Dec 2012 04:02:00 GMThttp://www.5432034.com/xylz/archive/2012/12/26/393498.htmlhttp://www.5432034.com/xylz/comments/393498.htmlhttp://www.5432034.com/xylz/archive/2012/12/26/393498.html#Feedback31http://www.5432034.com/xylz/comments/commentRss/393498.htmlhttp://www.5432034.com/xylz/services/trackbacks/393498.html
    鎴?#28051;鐩翠娇鐢?.1.0鐗?#37832;?#37928;刯rebel锛?#37828;痵ocial鍏?#29840;?#37911;?#37832;?#37928;?#37510;俿ocial鐗?#37832;細鍦?#37722;姩鏃惰繛鎺rebel鏈?#37716;?#37731;?#38171;坢yrebel)鑾?#37721;杔icense锛?#37722;屾椂浼氬皢涓浜涚儹閮?#32515;?#37928;勬?#26271;銆佽妭?#23475;鏃?#38338;?#37510;?#37804;ц兘绛?#37827;?#36423;楁彁浜?#37714;?#26473;?#32459;?#37832;?#37716;?#37731;?#37510;?br /> 鏈杩戜腑鍥界?#25120;粶鎶介锛?#26473;?#37818;rebel鏈?#37716;?#37731;?#37911;瑰埆鎱?#38171;屽鑷存瘡娆?#37722;姩鐨勬?#36346;欓兘闇瑕?0s浠?#28051;?#37928;勬椂闂存墠?#20824;寰?#37714;?#37832;?#37716;?#37731;?#37928;?#37725;嶅簲锛堝姞涓婅嚜?#23017;鏇存柊妫娴?#38171;?#37510;?#37832;涓?#28051;涓?#37814;鏈?#37818;?#38171;屽緢鏄?#37906;?#38171;?#37812;?#28051;嶈兘蹇?#37721;?#26473;?#32457;?#29723;?#28051;?#37510;?br />
    鍙?#28610;界?#26050;?#36346;浣曠?#30923;В瀹?#37510;?br /> 浠?.0寮濮媕rebel鐨勬?#38155;穯鏈哄埗鍋氬緱?#28522;甯告锛屽熀鏈?#28051;?#37827;犳硶杩?#29723;屽?#23943;紪璇戜慨鏀?#27996;?#37510;傚ソ鍦╦rebel姣旇?#20904;?#27702;亾锛?#28051;鐩?#37711;?#28729;规棫鐗?#37832;?#37928;刲icense妫娴?#37832;哄埗锛岀?#35826;嚭鎴?008骞村啓鐨勭?#30923;В宸?#32459;?#38171;岄?#21700;埄瑙?#37712;?#27996;?.1.0鐗?#37832;?#37510;?br /> 鐒?#37722;?#28051;?#26462;?#37832;?#26570;鐨?.1.2锛?0121217锛?#37911;?#37832;?#38171;屽?#28618;瘯浜?#28051;嬪眳鐒舵病鏈?#37812;?#37716;?#37510;傚お鍥?#27996;?#37510;?#26473;?#37828;?#28051;涓?#28751;?#37911;?#37832;?#38171;?#28051;?#28003;?#37824;瑰姩濡傛澶?#38171;?br />
    鎵?#23534;debug鏃?#36423;?#37722;?#37721;戠幇锛屾牴鏈?#28751;辨病鏈?#37716;?#26462;絡rebel.jar閲岄潰鐨凩icense鏂囦欢銆?#37721;嶇紪璇戞簮?#29212;鐪?#27996;?#28051;?#38171;?#37835;?#37906;?#38171;?#28000;?.1.2鐗?#37832;?#23534;濮?#28051;嶅啀鍔?#26462;絡rebel.jar閲岄潰鐨刲icense鏂囦欢浜?#38171;?#29831;?#28000;庣敤鎴?#28051;?#37929;綍锛宩rebel瀹夎鐩綍绛夎幏鍙杔icense鏂囦欢銆?#26473;欐牱灏辨病娉曢?#26473;?#28051;涓猨ar鍖呭垎鍙慾rebel浜?#37510;?br /> 灏唈rebel.lic鎷?#29840;?#37714;扮敤鎴?#28051;?#37929;綍鐨?jrebel鐩?#35120;曞嵆鍙?#37510;?br />
    ~ $ ls ~/.jrebel/jrebel.lic 
    /Users/adyliu/.jrebel/jrebel.lic

    鏉?#28051;?#23534;?#37812;浘銆?br />
    jrebel 5.1.2 crack
    jrebel 5.1.2 crack

    涓?#26462;?#37734;板潃


    Updated 2013/03/25
        JRebel鏇存柊鍒?.2.0鐗?#37832;?#38171;屾墍浠?#37721;?#28000;?#37824;惧嚭涓涓?#28003;庣増鏈?#38171;?#37812;?#28051;鐩翠娇鐢?#38171;?.1.2銆?.1.3灏辨殏鏃?#28051;嶅幓瑙?#37712;?#27996;?#37510;?br />


    Updated 2013/04/17
        JRebel 鏇存柊鍒?.2.2鐗?#37832;?#38171;屾墍浠?#37721;?#28000;?#37824;惧嚭涓涓?#28003;庣増鏈?.2.0銆?br />

    Updated 2013/06/06
        JRebel 鏇存柊鍒?.3.0鐗?#37832;?#38171;屾墍浠?#37721;?#28000;?#37824;惧嚭涓涓?#28003;庣増鏈?.2.2銆?br />

    Updated 2013/07/12
        JRebel 鏇存柊鍒?.3.1鐗?#37832;?#38171;屾墍浠?#37721;?#28000;?#37824;惧嚭涓涓?#28003;庣増鏈?.3.0銆?br />

    Updated 2013/09/15
        鏈?#26570;鐗?#37832;?#37928;?#28051;?#26462;?#37734;板潃鍦?#38171;?a href="http://www.5432034.com/xylz/archive/2013/09/15/404098.html">http://www.5432034.com/xylz/archive/2013/09/15/404098.html

    PS:
         鍚愭Ы涓?#38171;孞Rebel鏀?#37816;?#37928;?#37716;熻兘瓒?#37833;?#29906;?#28598;?#38171;屽鑷存湰?#38889;瓒?#37833;?#29906;?#28598;?#27996;?#38171;岀増鏈?.x宸茬粡蹇?M浜?#38171;?#38171;?#38171;?

     

    鍏?#38335;?#29831;?#38171;?JRebel 5.3.1 crack, JRebel 5.3.0 crack, JRebel 5.2.2 crack, JRebel 5.2.0 crack, JRebel 5.1.2 crack,JRebel 5.1.0 crack, JRebel 5.x crack



    imxylz 2012-12-26 12:02 鍙?#29723;?#29831;?#29825;?/a>
    ]]>SQLite3 C璇?#29815;API鍏?#38338;?/title><link>http://www.5432034.com/xylz/archive/2012/09/25/388519.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Tue, 25 Sep 2012 08:34:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/09/25/388519.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/388519.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/09/25/388519.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/388519.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/388519.html</trackback:ping><description><![CDATA[<h1>SQLite3 C璇?#29815;API鍏?#38338;?/h1> <h2>涓?#26462;絊QLite3</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鎴?#28000;?#28051;?#26462;絪qlite<a href="http://www.sqlite.org/sqlite-amalgamation-3071400.zip" rel="nofollow" style="text-decoration: none; ">?#31790;鐮佸寘</a>锛屽彧闇瑕?#37711;朵腑鐨剆qlite3.c銆乻qlite.h鍗?#37721;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鏈?#30045;鍗?#37928;?#28051;涓?#37714;?#23524;?#29723;?#37823;嶄綔</h2> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->#include <stdio.h><br /> #include "sqlite3.h"<br /> <br /> <span style="color: #0000FF; ">int</span> main(<span style="color: #0000FF; ">int</span> argc,<span style="color: #0000FF; ">char</span> *argv[]){<br />     <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *sql_create_table="create table t(id int primary key,msg varchar(128))";<br />     <span style="color: #0000FF; ">char</span> *errmsg = 0;<br />     <span style="color: #0000FF; ">int</span> ret = 0;<br /> <br />     sqlite3 *db = 0;<br />     ret = sqlite3_open("./sqlite3-demo.db",&db);<br />     <span style="color: #0000FF; ">if</span>(ret != SQLITE_OK){<br />         fprintf(stderr,"Cannot open db: %s\n",sqlite3_errmsg(db));<br />         <span style="color: #0000FF; ">return</span> 1;<br />     }<br />     printf("Open database\n");<br /> <br />     ret = sqlite3_exec(db,sql_create_table,NULL,NULL,&errmsg);<br />     <span style="color: #0000FF; ">if</span>(ret != SQLITE_OK){<br />         fprintf(stderr,"create table fail: %s\n",errmsg);<br />     }<br />     sqlite3_free(errmsg);<br />     sqlite3_close(db);<br /> <br />     printf("Close database\n");<br /> <br />     <span style="color: #0000FF; ">return</span> 0;<br /> }</div> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><br /> <br /> 鍦?#26473;?#28051;?#37823;嶄綔?#33105;鎴?#28000;?#37813;?#29723;?#27996;嗗涓?#37823;嶄綔锛?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>鎵?#23534;?#26271;鎹?#25652;?/li> <li>鎵?#29723;孲QL璇?#37721;?/li> <li>鍏?#38338;暟鎹?#25652;?/li> </ul> </dd></dl> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">?#32139;鐒惰?#27406;腑闂翠細鏈?#28051;浜涚?#33333;?#37928;?#37714;?#37826;?#28000;?#37721;?#37712;?#28699;?#37816;?#38333;?#37928;?#38322;?#37824;?#32475;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鎵?#23534;?#26271;鎹?#25652;?#37928;凙PI濡?#28051;?#38171;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> sqlite3_open(<br />   <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *filename,   <span style="color: #008000; ">/*</span><span style="color: #008000; "> Database filename (UTF-8) </span><span style="color: #008000; ">*/</span><br />   sqlite3 **ppDb          <span style="color: #008000; ">/*</span><span style="color: #008000; "> OUT: SQLite db handle </span><span style="color: #008000; ">*/</span><br /> );</div> 杩?#38322;屼細寮?#37711;?#28051;涓潪甯?#28598;?#37833;?#37928;剆qlite3鐨勬暟鎹?#32513;?#37835;?#37510;?#26473;?#28051;?#37837;规嵁闇瑕佷互鍚庨?#23678;儏浜?#29785;?#27996;?#37510;? <p> </p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鎵?#23534;?#26271;鎹?#25652;撻櫎浜?#26473;?#32457;嶅舰?#32033;?#21104;澶?#38171;?#26473;?#37832;塻qlite3_open銆乻qlite3_open16銆乻qlite3_open_v2?#22161;绉嶅舰?#32033;锛屽熀鏈?#28051;婄被浼?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">澶?#38318;ㄥ垎sql鎿嶄綔?#20824;鍙?#28000;?#38315;?#26473;噑qlite3_exec鏉?#28729;?#37812;?#38171;屽畠鐨凙PI褰㈠紡濡?#28051;?#38171;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> sqlite3_exec(<br />   sqlite3*,                                  <span style="color: #008000; ">/*</span><span style="color: #008000; "> An open database </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *sql,                           <span style="color: #008000; ">/*</span><span style="color: #008000; "> SQL to be evaluated </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">int</span> (*callback)(<span style="color: #0000FF; ">void</span>*,<span style="color: #0000FF; ">int</span>,<span style="color: #0000FF; ">char</span>**,<span style="color: #0000FF; ">char</span>**),  <span style="color: #008000; ">/*</span><span style="color: #008000; "> Callback function </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">void</span> *,                                    <span style="color: #008000; ">/*</span><span style="color: #008000; "> 1st argument to callback </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">char</span> **errmsg                              <span style="color: #008000; ">/*</span><span style="color: #008000; "> Error msg written here </span><span style="color: #008000; ">*/</span><br /> );</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鍚?#28051;?#37721;傛?#25198;?#21228;剰涔?#28051;?#38171;?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>sqlite3鎻?#26473;扮?#21228;槸?#26271;鎹?#25652;?#37721;?#37836;?/li> <li>sql 瑕佹墽琛岀殑SQL璇?#37721;?/li> <li>callback鍥?#29835;冨?#33445;暟</li> <li>void *鍥?#29835;冨?#33445;?#25198;?#21229;涓涓?#37721;傛暟</li> <li>errmsg閿?#29831;?#28103;℃伅锛屽鏋滄病鏈塖QL闂?#26864;?#37714;?#37706;?#28051;篘ULL</li> </ul> </dd></dl> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鍥?#29835;冨?#33445;暟?#32033;涓涓?#23011;旇?#20904;鏉?#37928;勫?#33445;暟銆?#28729;?#37928;?#37720;?#37736;?#37828;?#26473;欐牱鐨?<br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> callback(<span style="color: #0000FF; ">void</span> *<span style="color: #0000FF; ">params</span>,<span style="color: #0000FF; ">int</span> column_size,<span style="color: #0000FF; ">char</span> **column_value,<span style="color: #0000FF; ">char</span> **column_name){</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">姣?#28051;涓?#37721;傛暟?#21104;涔?#28641;?#28051;?#38171;?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>params鏄痵qlite3_exec浼?#37711;?#37928;勭鍥?#28051;?#37721;傛暟</li> <li>column_size鏄?#32513;?#37835;?#28699;楁鐨?#28051;暟</li> <li>column_value鏄?#26473;?#37733;?#29825;板綍鐨?#28051;浣嶅?#26947;鏁扮?#21228;寚閽?/li> <li>column_name鏄?#32513;?#37835;?#28699;楁鐨?#37722;?#32457;?/li> </ul> </dd></dl> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">閫?#29999;告儏鍐?#28051;媍allback鍦╯elect鎿嶄綔?#33105;?#32048;浣?#37922;?#37714;?#38171;屽挨鍏舵槸澶勭悊姣?#28051;琛?#29825;板綍?#26271;銆?#26473;?#37733;?#37928;勭粨鏋?#23011;?#28051;琛?#29825;板?#26338;兘?#32048;璋?#37922;?#28051;?#8220;鍥?#29835;冨?#33445;暟”銆?濡?#37835;滃洖璋冨?#33445;暟杩?#37733;?#27996;嗛潪0锛?#38317;?#28052;坰qlite3_exec灏?#26473;?#37733;濻QLITE_ABORT锛屽苟涓?#28052;?#37722;庣殑鍥?#29835;冨?#33445;暟涔?#28051;嶄細鎵?#29723;?#38171;?#37722;屾?#33333;湭鎵?#29723;岀殑?#29913;鏌?#29831;?#28052;?#28051;嶄細缁?#32513;?#37813;?#29723;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">瀵?#27996;?#37831;存柊銆佸?#29371;櫎銆佹彃鍏?#32475;?#28051;?#38343;瑕佸洖璋冨?#33445;?#25198;?#21228;?#23940;綔锛宻qlite3_exec鐨勭涓?#37510;?#32471;?#37733;?#28051;?#37721;傛暟鍙?#28000;?#28028;?#37711;?鎴?#38000;匩ULL銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">閫?#29999;告儏鍐?#28051;媠qlite3_exec杩?#37733;濻QLITE_OK=0鐨勭粨鏋?#38171;岄潪0缁?#37835;?#37721;?#28000;?#38315;?#26473;噀rrmsg鏉?#38014;?#37721;?#28725;瑰簲鐨勯敊璇?#37819;?#26473;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">Windows涓嬬紪璇?#38171;?/p> <pre style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin: 2px; border: 1px dashed; background-color: #f9f9f9; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; ">D:\home\dev\c>cl /nologo /TC sqlite3-demo.c sqlite3.c </pre> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">GCC涓嬬紪璇?</p> <pre style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin: 2px; border: 1px dashed; background-color: #f9f9f9; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; ">$ gcc -o sqlite3-demo.bin sqlite3-demo.c sqlite3.c </pre> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鍒犻櫎琛?#37823;嶄綔</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">涓?#27996;?#38339;?#23005;?#37736;冨溇?#26271;鎹?#38171;?#37812;?#28000;?#37734;?#37716;?#26462;芥暟鎹?#25652;?#37928;勬?#36346;?#37714;犻櫎琛?#37823;嶄綔銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">?#30045;鍗?#37928;?#37714;犻櫎鎿嶄綔鍙?#28000;?#37929;存帴浣?#37922;╯qlite3_exec鍗?#37721;?#37510;?#26473;?#38322;?#28051;?#38343;瑕佸洖璋冨?#33445;暟浠?#37721;?#37733;?#29835;冨?#33445;?#25198;殑鍙傛暟銆??#32139;鐒?#38343;瑕佸彲浠?#37711;虫敞sqlite3_exec杩?#37733;?#37928;勭粨鏋?#37828;?#37722;?#28051;篠QLITE_OK鐨?#37706;?#37510;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *sql_drop_table="drop table if exists t";<br />     <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *sql_create_table="create table t(id int primary key,msg varchar(128))";<br /> <img src="http://www.5432034.com/Images/dot.gif" alt="" /><img src="http://www.5432034.com/Images/dot.gif" alt="" /><br />     sqlite3_exec(db,sql_drop_table,0,0,&errmsg);<br />     sqlite3_exec(db,sql_create_table,0,0,&errmsg);</div> <p> </p> <h2>鎻?#37711;ユ暟鎹?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鎻?#37711;?#32471;?#28051;?#28527;?#26271;鎹?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    ret = sqlite3_exec(db,"insert into t(id,msg) values(1,'Ady Liu')",NULL,NULL,&errmsg);<br />     printf("Insert a record %s\n",ret == SQLITE_OK ? "OK":"FAIL");</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">杩?#37733;?#37706;紃et涓篠QLITE_OK鍗虫?#23940;綔鎴?#37716;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鎻?#37711;?#28598;氭潯?#26271;鎹?#38171;屽苟鍒犻櫎?#26271;鎹?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    ret = sqlite3_exec(db,"insert into t(id,msg) values(1,'Ady Liu')",NULL,NULL,&errmsg);<br />     printf("Insert a record %s\n",ret == SQLITE_OK ? "OK":"FAIL");<br />     ret = sqlite3_exec(db,"insert into t(id,msg) values(2,'IMXYLZ')",NULL,NULL,&errmsg);<br />     printf("Insert a record %s\n",ret == SQLITE_OK ? "OK":"FAIL");<br />     ret = sqlite3_exec(db,"delete from t where id < 3",NULL,NULL,&errmsg);<br />     printf("Delete records: %s\n",ret == SQLITE_OK ? "OK":"FAIL");</div> 鎻?#37711;?#28598;氭潯?#26271;鎹?#38171;岀畝鍗?#37928;?#28003;?#37922;╯qlite3_exec杩?#29723;孲QL鎵?#29723;屽嵆鍙?#37510;傚綋鐒惰繖閲?#37828;?#28729;屾暣鐨凷QL瀛楃涓?#37510;? <p> </p> <h2>棰勭紪璇戞?#23940;綔</h2> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->    <span style="color: #0000FF; ">int</span> i = 0;<br />    sqlite3_stmt *stmt;<br />    <span style="color: #0000FF; ">char</span> ca[255];<br /><img src="http://www.5432034.com/Images/dot.gif" alt="" /><img src="http://www.5432034.com/Images/dot.gif" alt="" /><br />    <span style="color: #008000; ">//</span><span style="color: #008000; ">prepare statement</span><span style="color: #008000; "><br /></span>    sqlite3_prepare_v2(db,"insert into t(id,msg) values(?,?)",-1,&stmt,0);<br />    <span style="color: #0000FF; ">for</span>(i=10;i<20;i++){<br />        sprintf(ca,"HELLO#%i",i);<br />        sqlite3_bind_int(stmt,1,i);<br />        sqlite3_bind_text(stmt,2,ca,strlen(ca),NULL);<br />        sqlite3_step(stmt);<br />        sqlite3_reset(stmt);<br />    }<br />    sqlite3_finalize(stmt);</div><span>棰勭紪璇戞?#23940;綔姣旇?#20910;?#33636;儲鐨?#38171;屽?#23678;暣鐨勯?#21229;紪璇戞?#23940;綔鐨勬祦绋?#37828;?#38171;?/span> <ol> <li>閫?#26473;噑qlite3_prepare_v2()鍒?#23524;?#28051;涓猻qlite3_stmt瀵硅薄</li> <li>閫?#26473;噑qlite3_bind_*()缁戝畾棰勭紪璇戝?#26945;鐨?#37706;?/li> <li>閫?#26473;噑qlite3_step()鎵?#29723;孲QL璇?#37721;?/li> <li>閫?#26473;噑qlite3_reset()閲嶇疆棰勭紪璇?#29831;?#37721;?#38171;岄?#23941;?#23942;?#23940;綔2澶?#23046;?/li> <li>閫?#26473;噑qlite3_finalize()閿姣?#29863;勬簮</li> </ol> <p>sqlite3_prepare_v2()鏈?#28051;?#28598;?#32457;嶇被浼?#37928;勫舰?#32033;锛屽?#23678;暣鐨凙PI璇硶鏄?#38171;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> sqlite3_prepare(<br />   sqlite3 *db,            <span style="color: #008000; ">/*</span><span style="color: #008000; "> Database handle </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *zSql,       <span style="color: #008000; ">/*</span><span style="color: #008000; "> SQL statement, UTF-8 encoded </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">int</span> nByte,              <span style="color: #008000; ">/*</span><span style="color: #008000; "> Maximum length of zSql in bytes. </span><span style="color: #008000; ">*/</span><br />   sqlite3_stmt **ppStmt,  <span style="color: #008000; ">/*</span><span style="color: #008000; "> OUT: Statement handle </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> **pzTail     <span style="color: #008000; ">/*</span><span style="color: #008000; "> OUT: Pointer to unused portion of zSql </span><span style="color: #008000; ">*/</span><br /> );</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鍚?#28051;?#37721;傛?#25198;殑瀹?#28052;?#28051;?#38171;?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>db涓簊qlite3鐨?#37721;?#37836;?/li> <li>zSql涓鸿?#20345;墽琛岀殑SQL璇?#37721;?/li> <li>nByte涓鸿?#20345;墽琛?#29831;?#37721;?#37734;▃Sql?#33105;鐨勬渶澶?#38336;?#25652;?#38171;屽鏋?#37828;?#29840;熸暟锛?#38317;?#28052;堝氨闇瑕侀?#23942;柊?#22172;?#23017;璁?#32480;?/li> <li>ppStmt涓?#26864;勭紪璇?#37722;庣殑鍙?#37836;?/li> <li>pzTail棰勭紪璇?#37722;?#37715;?#28051;?#37928;勫?#26947;涓?#38171;?#37832;?#26864;勭紪璇?#37812;?#37716;?#37812;?#38000;?#28598;?#28003;?#37928;?#38171;?#37928;勬寚閽?#38171;岄?#29999;告病浠涔?#37922;?#38171;屼紶鍏?鎴?#38000;匩ULL鍗?#37721;?#37510;?/li> </ul> </dd></dl> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><br /> 缁戝畾鍙傛暟sqlite3_bind_*鏈?#28598;?#32457;嶅舰?#32033;锛屽垎?#22470;瀵瑰簲涓?#37722;岀?#21228;暟鎹?#32491;诲瀷:<br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> sqlite3_bind_blob(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">void</span>*, <span style="color: #0000FF; ">int</span> n, <span style="color: #0000FF; ">void</span>(*)(<span style="color: #0000FF; ">void</span>*));<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_double(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">double</span>);<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_int(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">int</span>);<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_int64(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, sqlite3_int64);<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_null(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>);<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_text(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span>*, <span style="color: #0000FF; ">int</span> n, <span style="color: #0000FF; ">void</span>(*)(<span style="color: #0000FF; ">void</span>*));<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_text16(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">void</span>*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">void</span>(*)(<span style="color: #0000FF; ">void</span>*));<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_value(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">const</span> sqlite3_value*);<br /> <span style="color: #0000FF; ">int</span> sqlite3_bind_zeroblob(sqlite3_stmt*, <span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">int</span> n);</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><br /> 棰勭紪璇慡QL璇?#37721;ヤ腑鍙?#28000;?#37718;?#37722;?#28641;?#28051;嬪嚑绉嶅舰?#32033;锛?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>?</li> <li>?NNN</li> <li>:VVV</li> <li>@VVV</li> <li>$VVV</li> </ul> </dd></dl> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">NNN浠?#29723;ㄦ暟瀛?#38171;孷VV浠?#29723;?#28699;楃涓?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">濡?#37835;?#37828;?鎴?#38000;?NNN锛?#38317;?#28052;?#37721;?#28000;?#37929;存帴sqlite3_bind_*()杩?#29723;屾?#23940;綔锛屽鏋?#37828;?#28699;楃涓?#38171;?#26473;?#38343;瑕侀?#26473;噑qlite3_bind_parameter_index()鑾?#37721;?#28725;瑰簲鐨刬ndex锛岀劧鍚庡?#23944;皟鐢╯qlite3_bind_*()鎿嶄綔銆?#26473;?#38315;?#29999;?#37922;?#27996;?#37835;?#38315;?#28051;?#28729;氭潯?#27426;鐨凷QL璇?#37721;?#38171;堝姩鎬丼QL璇?#37721;?#38171;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鏌?#29831;?#37823;嶄綔</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鍥?#29835;冨?#33445;?#25198;殑瑙?#38322;?#37721;?#38000;?#37832;涓?#38344;?#37928;勬弿杩?#37510;?棣?#37711;堝0鏄?#28051;涓?#37733;?#29835;冨?#33445;暟銆?/p> <pre style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin: 2px; border: 1px dashed; background-color: #f9f9f9; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; ">int print_record(void *,int,char **,char **); </pre> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><br /> 鏌?#29831;?#28000;g爜<br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #008000; ">//</span><span style="color: #008000; ">select data</span><span style="color: #008000; "><br /> </span>    ret = sqlite3_exec(db,"select * from t",print_record,NULL,&errmsg);<br />     <span style="color: #0000FF; ">if</span>(ret != SQLITE_OK){<br />         fprintf(stderr,"query SQL error: %s\n",errmsg);<br />     }</div> <p> </p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鐜?#37734;?#28729;?#28052;?#37733;?#29835;冨?#33445;暟锛屽彧鏄畝鍗?#37928;勮?#25779;嚭瀛楁?#38747;?#37510;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> print_record(<span style="color: #0000FF; ">void</span> *<span style="color: #0000FF; ">params</span>,<span style="color: #0000FF; ">int</span> n_column,<span style="color: #0000FF; ">char</span> **column_value,<span style="color: #0000FF; ">char</span> **column_name){<br />     <span style="color: #0000FF; ">int</span> i;<br />     <span style="color: #0000FF; ">for</span>(i=0;i<n_column;i++){<br />         printf("\t%s",column_value[i]);<br />     }<br />     printf("\n");<br />     <span style="color: #0000FF; ">return</span> 0;<br /> }</div> <p> </p> <h2>涓?#28003;?#37922;?#37733;?#29835;?#37928;勬煡璇?#37823;嶄綔</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">瀹?#28052;?#28003;?#37922;?#37928;?#37721;橀噺</p> <pre style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin: 2px; border: 1px dashed; background-color: #f9f9f9; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; "> char **dbresult; int j,nrow,ncolumn,index; </pre> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鏌?#29831;?#37823;嶄綔<br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #008000; ">//</span><span style="color: #008000; ">select table</span><span style="color: #008000; "><br /> </span>    ret = sqlite3_get_table(db,"select * from t",&dbresult,&nrow,&ncolumn,&errmsg);<br />     <span style="color: #0000FF; ">if</span>(ret == SQLITE_OK){<br />         printf("query %i records.\n",nrow);<br />         index=ncolumn;<br />         <span style="color: #0000FF; ">for</span>(i=0;i<nrow;i++){<br />             printf("[%2i]",i);<br />             <span style="color: #0000FF; ">for</span>(j=0;j<ncolumn;j++){<br />                 printf(" %s",dbresult[index]);<br />                 index++;<br />             }<br />             printf("\n");<br />         }<br />     }<br />     sqlite3_free_table(dbresult);</div> <p> </p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">sqlite3_get_table鐨凙PI璇硶锛?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">int</span> sqlite3_get_table(<br />   sqlite3 *db,          <span style="color: #008000; ">/*</span><span style="color: #008000; "> An open database </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">const</span> <span style="color: #0000FF; ">char</span> *zSql,     <span style="color: #008000; ">/*</span><span style="color: #008000; "> SQL to be evaluated </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">char</span> ***pazResult,    <span style="color: #008000; ">/*</span><span style="color: #008000; "> Results of the query </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">int</span> *pnRow,           <span style="color: #008000; ">/*</span><span style="color: #008000; "> Number of result rows written here </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">int</span> *pnColumn,        <span style="color: #008000; ">/*</span><span style="color: #008000; "> Number of result columns written here </span><span style="color: #008000; ">*/</span><br />   <span style="color: #0000FF; ">char</span> **pzErrmsg       <span style="color: #008000; ">/*</span><span style="color: #008000; "> Error msg written here </span><span style="color: #008000; ">*/</span><br /> );<br /> <span style="color: #0000FF; ">void</span> sqlite3_free_table(<span style="color: #0000FF; ">char</span> **result);</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鍏朵腑锛?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>db鏄痵qlite3鐨?#37721;?#37836;?/li> <li>zSql鏄?#29781;佹墽琛岀殑sql璇?#37721;?/li> <li>pazResult鏄?#37813;?#29723;屾煡璇?#37823;嶄綔鐨?#26473;?#37733;?#32513;?#37835;滈泦</li> <li>pnRow鏄?#29825;板綍鐨?#29723;屾暟</li> <li>pnColumn鏄?#29825;板綍鐨勫?#26945;涓暟</li> <li>pzErrmsg鏄?#38335;?#29831;?#28103;℃伅</li> </ul> </dd></dl> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鐢?#27996;巗qlite3_get_table鏄痵qlite3_exec鐨?#37718;呰锛屽?#29363;杩?#37733;?#37928;勭粨鏋?#37724;宻qlite3_exec?#34987;浼?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">pazResult鏄?#28051;涓?pnRow+1)*pnColumn缁?#37835;滈泦鐨勫?#26947;涓叉?#25198;粍锛?#37711;朵腑?#22688;pnColumn涓?#32513;?#37835;?#37828;?#28699;楁鐨?#37722;?#32457;?#38171;?#37722;巔nRow琛?#29825;板綍鏄?#37930;?#28729;?#37928;勫?#26945;?#38747;?#38171;屽鏋?#37836;?#28051;?#28699;楁涓虹┖锛屽垯瀵瑰簲鍊?#28051;篘ULL銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鏈鍚?#38343;瑕侀?#26473;噑qlite3_free_table()閲?#37824;惧?#23678;暣鐨勭粨鏋滈泦銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鏇存柊鎿嶄綔</h2> <pre style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin: 2px; border: 1px dashed; background-color: #f9f9f9; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; "> sqlite3_exec(db,"update t set msg='MESSAGE#10' where id=10",NULL,NULL,&errmsg); </pre> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">?#32139;鐒?#27996;?#38171;?#37812;?#28000;?#28052;?#37721;?#28000;?#28003;?#37922;?#26864;勭紪璇戞?#35268;硶杩?#29723;?#37831;存柊鎿嶄綔銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鍙?#35120;?#37725;?#37928;?#29825;板綍?#26271;</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鎴?#28000;?#37721;?#28000;?#28003;?#37922;╯qlite3_change(sqlite3 *)鐨凙PI鏉?#32513;?#29825;?#28051;?#28051;娆?#37823;嶄綔鍙?#35120;?#37725;?#37928;?#29825;板綍?#26271;銆?/p> <pre style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin: 2px; border: 1px dashed; background-color: #f9f9f9; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; "> ret = sqlite3_exec(db,"delete from t",NULL,NULL,&errmsg); <br /> if(ret == SQLITE_OK){<br /> printf("delete records: %i\n",sqlite3_changes(db));<br /> } </pre> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "></div> <h2>鎬?#32513;?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">杩?#38322;?#37812;?#28000;?#37818;?#29785;?#27996;哠QLITE3鐨?3涓狝PI锛?/p> <dl style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "><dd> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; "> <li>sqlite3_open()</li> <li>sqlite3_exec()</li> <li>sqlite3_close()</li> <li>sqlite3_prepare_v2</li> <li>sqlite3_bind_*()</li> <li>sqlite3_bind_parameter_index()</li> <li>sqlite3_step()</li> <li>sqlite3_reset()</li> <li>sqlite3_finalize()</li> <li>sqlite3_get_table</li> <li>sqlite3_change()</li> <li>sqlite3_free()</li> <li>sqlite3_free_table()</li> </ul> </dd></dl> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">浜嬪疄涓?#37812;?#23005;?#37714;癝QLITE3.7.14(2012/09/03) 涓鍏辨彁渚?#27996;?04涓狝PI鍑芥暟锛?a href="http://www.sqlite.org/c3ref/funclist.html%ef%bc%89%e3%80%82" rel="nofollow" style="text-decoration: none; ">http://www.sqlite.org/c3ref/funclist.html锛?#37510;?/a></p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">浣?#37832;绮剧畝鐨凙PI鍑芥暟澶?#22994;?#37832;?涓?#38171;?/p> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "> <li>sqlite3_open()</li> <li>sqlite3_prepare()</li> <li>sqlite3_step()</li> <li>sqlite3_column()</li> <li>sqlite3_finalize()</li> <li>sqlite3_close()</li> </ul> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鏍?#36423;傾PI涔?#28751;?0涓?#38171;堝湪绮剧畝API?#29056;纭涓?#28583;?#37716;?涓?#38171;?#38171;?/p> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; "> <li>sqlite3_exec()</li> <li>sqlite3_get_table()</li> <li>sqlite3_reset()</li> <li>sqlite3_bind()</li> </ul> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; background-color: #ffffff; ">鍥犳鎺屾彙璧?#37833;?#26473;?#37828;?#23011;旇?#20904;鏄?#37928;?#37510;?br /> <br /> 瀹屾暣鐨勬簮鐮佸?#26495;潃锛?<a href="https://gist.github.com/3780669" target="_blank">https://gist.github.com/3780669 </a><br /> </p><img src ="http://www.5432034.com/xylz/aggbug/388519.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-09-25 16:34 <a href="http://www.5432034.com/xylz/archive/2012/09/25/388519.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>?#22414;甯冨紡娑堟伅?#37108;缁烰afka 鍙?#29999;?.2.0鐗?#37832;?/title><link>http://www.5432034.com/xylz/archive/2012/06/26/381490.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Tue, 26 Jun 2012 02:51:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/06/26/381490.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/381490.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/06/26/381490.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/381490.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/381490.html</trackback:ping><description><![CDATA[<span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; ">Jafka 鏄?#28051;涓?#26946;?#37804;ц兘鐨勫垎甯冨紡娑堟伅?#37108;缁?#37510;侸afka宸茬粡寮?#31790;锛屼娇鐢╣ithub鎵樼锛?#28051;?#26916;?#37734;板潃锛?/span><a target="_blank" href="https://github.com/adyliu/jafka" style="color: navy; text-decoration: none; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; ">https://github.com/adyliu/jafka</a><br style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; " /> <br style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; " /> <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; ">Jafka 鍙?#29999;?.2.0鐗?#37832;?#38171;?/span><a target="_blank" href="https://github.com/adyliu/jafka/wiki/history.zh_CN" style="color: navy; text-decoration: none; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; ">鏇存柊璁板綍</a><span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; background-color: #ffffff; ">锛?/span> <br /> <ul style="margin: 15px 0px; padding: 0px 0px 0px 30px; border: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; line-height: 22px; background-color: #ffffff; "> <li style="margin: 0px; padding: 0px; border: 0px; ">澧?#37716;?#37714;?#23524;篢opic鐨勫懡浠?nbsp;<a href="https://github.com/adyliu/jafka/issues/4" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 4</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">澧?#37716;?#37929;戞帶Topic?#31223;璐规儏鍐?#37928;?#23480;?#37711;?nbsp;<a href="https://github.com/adyliu/jafka/issues/5" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 5</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">娣诲姞鍒犻櫎Topic鐨勫懡浠?nbsp;<a href="https://github.com/adyliu/jafka/issues/7" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 7</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">蹇界暐IntelliJ IDEA宸?#32459;?#37826;囦欢 <a href="https://github.com/adyliu/jafka/issues/6" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 6</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">鏀?#37816;佸?#21977;?#20352;獙璇佹煇浜?#37823;嶄綔 <a href="https://github.com/adyliu/jafka/issues/8" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 8</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">鎵嬪姩閰嶇疆broker鏃舵敮鎸侀粯璁ゅ垎鍖烘暟閰嶇疆 <a href="https://github.com/adyliu/jafka/issues/9" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 9</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">閲?#37835;?#37721;?#38315;佹?#22559;伅鐨勬帴鍙?nbsp;<a href="https://github.com/adyliu/jafka/issues/10" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 10</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">娣诲姞涓涓?#27035;?#29825;?#37721;?#38315;佸?#26947;涓?#37928;勬?#22559;伅鍙?#38315;佽?nbsp;<a href="https://github.com/adyliu/jafka/issues/11" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 11</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">娣诲姞鐢?#37812;?#28729;屾暣瀹屾暣鍖?#37928;勮剼鏈?nbsp;<a href="https://github.com/adyliu/jafka/issues/12" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 12</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">娣诲姞涓涓?#28725;煎嚭瀛楃涓叉?#22559;伅鐨勮剼鏈?#23480;?#37711;?nbsp;<a href="https://github.com/adyliu/jafka/issues/13" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 13</a></li> <li style="margin: 0px; padding: 0px; border: 0px; ">淇?#28598;嶆秷璐硅嚜?#23017;?#22414;閰?#38171;?#29840;?#26462;藉潎琛?#38171;?#28598;?#29840;?#37928;?#38338;?#26864;?nbsp;<a href="https://github.com/adyliu/jafka/issues/14" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Issues 14</a></li> </ul><strong> 涓?#26462;?#37734;板潃</strong>锛?a href="https://github.com/adyliu/jafka/downloads">https://github.com/adyliu/jafka/downloads</a> <br /><strong>瀹夎?#21614;寚鍗?/strong>锛?a href="https://github.com/adyliu/jafka/wiki/install.zh_CN ">https://github.com/adyliu/jafka/wiki/install.zh_CN </a><br /><strong>鏇?#28598;?#37826;囨。</strong>锛?a href="https://github.com/adyliu/jafka/wiki">https://github.com/adyliu/jafka/wiki</a><img src ="http://www.5432034.com/xylz/aggbug/381490.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-06-26 10:51 <a href="http://www.5432034.com/xylz/archive/2012/06/26/381490.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Fedora 17 闄嶇骇涓鎶?#26440;?#38320;告唱http://www.5432034.com/xylz/archive/2012/06/07/380210.htmlimxylzimxylzThu, 07 Jun 2012 04:13:00 GMThttp://www.5432034.com/xylz/archive/2012/06/07/380210.htmlhttp://www.5432034.com/xylz/comments/380210.htmlhttp://www.5432034.com/xylz/archive/2012/06/07/380210.html#Feedback9http://www.5432034.com/xylz/comments/commentRss/380210.htmlhttp://www.5432034.com/xylz/services/trackbacks/380210.html

    Fedora 17鍙?#29999;?#38171;岀浜屽ぉ绔嬮┈鏇存柊浜?#37510;?棣?#37711;?#37711;?#37828;?#37831;存柊灏?#37814;樿吘浜嗗?#22556;箙锛?#37804;?#32480;?#23534;勫ソ浜?#37510;?#32513;?#37835;?#37721;戠幇涓涓?#23480;?#28598;?#37928;?#38338;?#26864;?#37510;俫tk2涓巈clipse涓?#37711;?#28729;?#37510;?/p>

    涓?#37711;?#28729;?#37928;?#37722;?#37835;?#37828;?#37804;?#37828;?#37814;?#26473;欐牱鐨勯敊璇?#38171;堝懡浠?#29723;?#37722;姩eclipse锛?nbsp;eclipse -debug -consolelog锛?#38171;?/p>

    (Eclipse:21798): GLib-GIO-CRITICAL **: g_dbus_proxy_new_for_bus_sync: assertion `g_dbus_is_name (name)' failed

    (Eclipse:21798): GLib-GIO-CRITICAL **: g_dbus_proxy_new_for_bus_sync: assertion `g_dbus_is_name (name)' failed

    (Eclipse:21798): GLib-GIO-CRITICAL **: g_dbus_proxy_new_for_bus_sync: assertion `g_dbus_is_name (name)' failed

    琛?#37916;?#28051;烘墦寮?#32042;杈戝櫒鍚?#37804;?#37828;?#37832;?#23536;堝?#27692;唴瀹规?#29363;硶鏄剧ず锛?#37828;剧ず涓虹?#34425;櫧锛屽?#21620;』閲嶆柊閫?#28729;?#37812;?#38000;?#37815;栧姩婊氬姩?#28527;?#22688;?#20824;鏄剧ず銆?/p>

    杩?#28000;?#27996;哄穿婧冨晩锛?#38171;?#38171;?/strong>

    杩?#28051;嬫偛鍓?#27996;?#38171;?#29781;佺煡?#20158;鎴戠殑寮鍙?#23480;ヤ綔灏?#37828;?#37734;╡cilpse涓嬭繘琛岀殑銆?/p>

    濂?#37722;?#38171;?#28051;婄綉?#22744;?#22744;銆?#37721;戠幇鏈?#27996;?#27996;轰篃?#20131;鍒?#28051;?#37711;?#28729;?#38338;?#26864;?#37510;?#28003;?#37828;病鏈?#28051;涓?#29785;?#37712;?#37716;炴硶銆?/p>

    鎴戠殑瑙?#37712;?#26473;?#32459;?#37828;?#26473;欐牱锛?/p>

    • 鏇存柊鏁翠釜fedora鐜?#28583;?#38171;?#37721;?#29999;?#37722;?#28729;?#37826;?#37721;?#29999;?#27996;?#28051;浜?#32497;?#37804;?#28103;?#23005;?#37718;?#38171;?#38171;?#37832;?#37835;?/li>
    • 閲嶆柊涓?#26462;?#37832;?#26570;鍙?#29723;岀増鐨別clipse锛?#37832;?#37835;?/li>
    • 閲嶆柊涓?#26462;?#37832;?#26570;鐨勬?#23341;瘯鐗?#37832;琫clipse锛?#37832;?#37835;?/li>
    • 涓?#26462;絝edora18鐨刧tk2銆乬libc绛?#23534;哄埗瀹夎锛?#37832;?#37835;?/li>
    • 闄嶇骇gtk2銆乬libc绛?#37714;癴edora 16锛?#37832;?#37835;?/li>
    • 缁?#32513;璯oogle锛屽?#32472;壘瑙?#37712;虫?#35268;硶锛?#28186;?#37906;舵湭鏋?/li>
    • 鏇?#37817;?#37832;?#26570;鍙?#29999;?#37928;?#27996;?#26473;涘埗swt搴?#38171;?#37832;?#37835;?/li>
    • 灏濊瘯鎵嬪姩?#32042;璇憇wt?#31790;?#29212;锛?#37832;?#37812;?#37716;?/li>

    杩欐牱锛?#37814;樿吘浜嗗嚑澶?#38171;屽揩瑕?#37824;?#23534;?#27996;?#37510;?/p>

    鏄?#28598;?#37828;?#37734;?#37820;?#28051;?#28729;?#38171;屽?#28618;瘯涓?#26462;絀dea鐨勭ぞ鍖?#37911;?#38171;屼娇鐢?#27996;?#28051;嬭繕鏄?#37808;熻涓嶄?#29363;儻锛?#37824;?#23534;?#37510;?/p>

    浠?#28598;?#37827;?#28051;婄獊鐒舵兂鍒?#38171;?#37711;?#37721;?#38320;?#37928;?#38317;?#37721;扮瑪璁?#37832;?#26473;?#37828;疐edora 16鏈?#37719;囩骇銆?#27996;?#37828;兂寮哄埗闄嶇骇鍒皊wt鎵鏈?#28186;?#29863;栧簱鍒癋edora 16鐪嬭兘鍚?#29785;?#37712;?#38338;?#26864;?#37510;?/p>

    浣?#37922;?#27996;?#28051;嬮潰鍛?#28000;?#37812;?#37716;?#28729;?#37812;?#27996;?#38318;ㄥ垎渚?#29863;栧簱鐨勯?#23943;骇锛?#26473;?#38322;岄潰鏇存槸涓?#37826;?#37928;?#28751;濊瘯锛屽湪澶?#29840;ヤ腑鎴?#38336;?#37510;傚摥~~~

    yum list

    yum install

    yum erase

    yum --releasever=16 downgrade

    rpm -qa

    rpm -qf

    ldd

    lsof

    濂?#37734;?#37721;?#37828;?#37922;?#27996;唌irrors.sohu.com闀滃儚锛岀?#25117;畾浜嗗?#21615;綉鍦板潃锛?#28051;?#26462;絩pm鍖呴潪甯?#36423;?#37510;?#26473;?#37828;?#37828;?#32513;?#37812;?#37832;澶?#37928;?#28729;夋叞銆?/p>

    杩?#28051;?#26473;?#32459;嬬粡杩?#27996;?#38336;?#26440;?#28051;?#28051;?#28751;?#37827;?#37928;勬?#27199;吘鍜?#28000;?#28003;?#37510;?#37832;缁?#32513;?#27996;?#37812;?#37716;?#28729;?#37812;?#27996;?#28000;?#28051;?#28186;?#29863;栫殑闄嶇骇銆?/p>

    [adyliu@adyliu-pc jafka]$ rpm -qa|grep fc16|sort
    cscope-15.7a-9.fc16.x86_64
    dconf-0.10.0-1.fc16.x86_64
    fcitx-4.2.3-1.fc16.x86_64
    fcitx-data-4.2.3-1.fc16.noarch
    fcitx-gtk2-4.2.3-1.fc16.x86_64
    fcitx-gtk3-4.2.3-1.fc16.x86_64
    fcitx-libs-4.2.3-1.fc16.x86_64
    gdk-pixbuf2-2.24.1-1.fc16.x86_64
    gedit-3.2.6-1.fc16.x86_64
    glib2-2.30.3-1.fc16.x86_64
    glibc-2.14.90-24.fc16.7.x86_64
    glibc-common-2.14.90-24.fc16.7.x86_64
    glibc-devel-2.14.90-24.fc16.7.x86_64
    glibc-headers-2.14.90-24.fc16.7.x86_64
    glib-networking-2.30.1-2.fc16.x86_64
    gnome-disk-utility-libs-3.0.2-3.fc16.x86_64
    gnutls-2.12.14-2.fc16.x86_64
    gsettings-desktop-schemas-3.2.0-1.fc16.noarch
    gtk2-2.24.8-3.fc16.x86_64
    gtk2-immodule-xim-2.24.8-3.fc16.x86_64
    gvfs-1.10.1-3.fc16.x86_64
    libarchive-2.8.5-1.fc16.x86_64
    libbluray-0.2-0.5.20110710git51d7d60a96d06.fc16.x86_64
    libcdio-0.82-6.fc16.x86_64
    libsoup-2.36.1-2.fc16.x86_64
    mdadm-3.2.3-7.fc16.x86_64
    nautilus-3.2.1-2.fc16.x86_64
    nautilus-extensions-3.2.1-2.fc16.x86_64
    PackageKit-0.6.22-2.fc16.x86_64
    PackageKit-glib-0.6.22-2.fc16.x86_64
    PackageKit-gtk-module-0.6.22-2.fc16.x86_64
    PackageKit-yum-0.6.22-2.fc16.x86_64
    pango-1.29.4-1.fc16.x86_64
    yum-3.4.3-24.fc16.noarch

    鍙?#28000;?#37930;嬪埌浠?#28000;?#37831;存柊gtk2/glibc鏄?#28051;嶅鐨?#37510;?/p>

    鎬?#32513;?#28051;?#38171;?/p>

    • 鍧?#37816;?#37828;?#37812;?#37716;?#37928;?#37711;?#38335;?#38171;堜腑闂?#26473;?#32459;?#38171;屾鍝?#37827;犳唱锛?#37832;鍚?#37812;戦兘鎵?#32480;?#38322;嶆柊瀹夎?#21276;edora 16浜?#38171;?br />
    • 鎴?#26473;?#37828;?#23536;堝己鐨?#38171;堝洤锛?br />

    鏈鍚庤鍛?#38171;?鍙兘?#32048;鏈?#37722;庨?#26947;棁锛?#29831;峰嬁妯?#28000;?#38171;?#29831;峰嬁灏濊瘯銆?img src ="http://www.5432034.com/xylz/aggbug/380210.html" width = "1" height = "1" />

    imxylz 2012-06-07 12:13 鍙?#29723;?#29831;?#29825;?/a>
    ]]>?#22414;甯冨紡娑堟伅?#37108;缁烰afka 鍙?#29999;?.1.0鐗?#37832;?/title><link>http://www.5432034.com/xylz/archive/2012/05/27/379308.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Sun, 27 May 2012 02:53:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/05/27/379308.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/379308.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/05/27/379308.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/379308.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/379308.html</trackback:ping><description><![CDATA[Jafka 鏄?#28051;涓?#26946;?#37804;ц兘鐨勫垎甯冨紡娑堟伅?#37108;缁?#37510;侸afka宸茬粡寮?#31790;锛屼娇鐢╣ithub鎵樼锛?#28051;?#26916;?#37734;板潃锛?a target="_blank" href="https://github.com/adyliu/jafka">https://github.com/adyliu/jafka</a><br /> <br /> Jafka 鍙?#29999;?.1.0鐗?#37832;?#38171;?a target="_blank" href="https://github.com/adyliu/jafka/wiki/history.zh_CN">鏇存柊璁板綍</a>锛?br /> <div> <p style="margin: 15px 0px; padding: 0px; border: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; "><strong>鏈?#37716;?#32468;?/strong>锛?/p> <ul style="margin: 15px 0px; padding: 0px 0px 0px 30px; border: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; "> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澧?#37716;?nbsp;<a href="http://wrapper.tanukisoftware.com/doc/english/download.jsp" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">Java Service Wrapper</a> 鏀?#37816;?/li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">榛?#29825;?#37928;勭紪?#29212;/瑙?#37934;佽皟鏁翠?#21700;瓧鑺傛?#25198;粍 <a href="https://github.com/adyliu/jafka/commit/2dbc332139dc7a5385e5d7362b58188df7c29ec6" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">2dbc332</a></li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澧?#37716;?#37832;?#37716;?#32468;?#37928;刴bean ServerInfo锛屾弿杩扮増鏈?#28103;℃伅锛?#37722;姩鏃?#38338;?#37510;佽繍琛屾椂闂?#32475;?/li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澧?#37716;爂etoffset-console.sh?#21116;鏈?#38171;?#38014;?#37721;朾roker鐨勫亸绉婚噺</li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澧?#37716;燿umper宸?#37711;?#38171;岀敤浜?#28725;煎嚭瀛楃涓叉?#22559;伅</li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">榛?#29825;ookeeper 璐?#26462;藉潎琛?#38322;嶈瘯鏃?#38338;磋皟鏁翠负10s</li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">灏唋og4j.properties鏂囦欢鍔?#37711;?#37832;?#37716;?#32468;疌LASSPATH</li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澧?#37716;犵畝鍗?#28729;夎?#21614;枃妗?nbsp;<a href="https://github.com/adyliu/jafka/blob/master/INSTALL" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">INSTALL</a></li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">榛?#29825;?#37832;?#37716;?#32468;?#38320;嶇疆涓?#37722;?#37922;▃ookeeper</li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">瑙?#37712;?#28051;浜汳Bean閲嶅?#23942;敞鍐?#38338;?#26864;?/li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澶?#38318;ㄥ垎IO鍏?#38338;?#37818;?#37721;?#38318;界户鎵胯嚜java.io.Closeable,骞舵彁渚汣losers宸?#37711;风被浣?#37922;?/li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澶ч噺鐨勬敞閲?#37831;存柊浠?#37721;?#37827;?#36423;?#37721;嬪ソ鍖?/li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">澧?#37716;犵涓?#37826;?#28186;?#29863;栫殑<a href="https://github.com/adyliu/jafka/blob/master/LICENSE" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">LICENSE</a></li> </ul> <p style="margin: 15px 0px; padding: 0px; border: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; "><strong>瀹?#37812;?#32468;?/strong>锛?/p> <ul style="margin: 15px 0px; padding: 0px 0px 0px 30px; border: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; "> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">鏃犳?#22559;伅?#31223;璐规椂涓?#37831;存柊offset <a href="https://github.com/adyliu/jafka/commit/f7d344f3637fbb912f2c918db1e4ac6d135d2afb" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">f7d344f3</a></li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">淇?#28598;?#37721;?#38315;佽呮?#29363;硶鏀跺埌?#26570;澧?#37716;?#37928;則opic?#22414;鐗囦俊?#20229;闂?#26864;?a href="https://github.com/adyliu/jafka/issues/2" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">https://github.com/adyliu/jafka/issues/2</a></li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">?#31223;璐规?#22559;伅鏃舵墦寮TCP NODELAY鐗?#37804;?nbsp;<a href="https://github.com/adyliu/jafka/commit/a8b93d6b214e656556444d3c658c1652a65e54d7" style="margin: 0px; padding: 0px; border: 0px; color: #4183c4; text-decoration: none; ">a8b93d6b</a></li> <li style="margin: 15px 0px; padding: 0px; border: 0px; ">鍗囩骇zookeeper瀹?#37812;?#32468;?#28051;?.3.5鐗?#37832;?#38171;屼慨澶峼ookeeper bug(961,1091)</li> </ul> </div> <strong><br /> 涓?#26462;?#37734;板潃</strong>锛? <div><a href="https://github.com/downloads/adyliu/jafka/jafka-1.1.0.tgz" target="_blank">https://github.com/downloads/adyliu/jafka/jafka-1.1.0.tgz</a></div><img src ="http://www.5432034.com/xylz/aggbug/379308.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-05-27 10:53 <a href="http://www.5432034.com/xylz/archive/2012/05/27/379308.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>ICE Mini Gridhttp://www.5432034.com/xylz/archive/2012/05/22/378862.htmlimxylzimxylzTue, 22 May 2012 11:47:00 GMThttp://www.5432034.com/xylz/archive/2012/05/22/378862.htmlhttp://www.5432034.com/xylz/comments/378862.htmlhttp://www.5432034.com/xylz/archive/2012/05/22/378862.html#Feedback0http://www.5432034.com/xylz/comments/commentRss/378862.htmlhttp://www.5432034.com/xylz/services/trackbacks/378862.htmlICE Grid 鍏?#38338;?#32481;?/h3>
    杩欑瘒鏄疘CE Grid鍏?#38338;?#37928;勬渶?#30045;鍗?#37911;?#37832;?涓嶆秹鍙?#37714;癐ceGride Node)銆?#26473;?#38322;岄潰璁?#29825;?#37714;?#26473;?#28598;?#37928;勬?#20634;康鍜岀煡璇?#38171;屾殏涓?#28051;?#29723;?#37510;?br />

    鍒?#23524;簊lice鏂囦欢

    Printer.ice
     1 // **********************************************************************
     2 //
     3 // Copyright (c) 2012 Ady Liu. All rights reserved.
     4 //
     5 // Email: imxylz@gmail.com
     6 //
     7 // **********************************************************************
     8 
     9 module Demo{
    10     interface Printer {
    11         void printString(string s);
    12     };
    13 };

    杞?#37817;lice

    slice2cpp Printer.ice 

    閰嶇疆IceGrid Registry
    registry.cfg
    IceGrid.InstanceName=DemoGrid

    Ice.Default.Locator=DemoGrid/Locator:default -p 4061  

    IceGrid.Registry.Client.Endpoints=tcp -p 4061
    IceGrid.Registry.Server.Endpoints=tcp
    IceGrid.Registry.Internal.Endpoints=tcp
    IceGrid.Registry.PermissionsVerifier=DemoGrid/NullPermissionsVerifier
    IceGrid.Registry.AdminPermissionsVerifier=DemoGrid/NullPermissionsVerifier
    IceGrid.Registry.SSLPermissionsVerifier=DemoGrid/NullSSLPermissionsVerifier
    IceGrid.Registry.AdminSSLPermissionsVerifier=DemoGrid/NullSSLPermissionsVerifier
    IceGrid.Registry.Data=./data
    IceGrid.Registry.DynamicRegistration=1

    鍚姩Registry
    icegridregistry --Ice.Config=./registry.cfg &
    鍚姩?#22688;鏈濂?#37714;?#23524;烘暟鎹?#37929;綍./data
    mkdir ./data

    鏈?#37716;?#32468;?/h2> PrinterI.h
     1 //**********************************************************************
     2 //
     3 // Copyright (c) 2012 Ady Liu. All rights reserved.
     4 //
     5 // Email: imxylz@gmail.com
     6 //
     7 //**********************************************************************
     8 
     9 #ifndef PRINTER_I_H
    10 #define PRINTER_I_H
    11 
    12 #include <Printer.h>
    13 
    14 using namespace Demo;
    15 using namespace std;
    16 
    17 class PrinterI : public Printer {
    18 public:
    19     virtual void printString(const string& s,const Ice::Current&);
    20 };
    21 
    22 #endif
    23 

    PrinterI.cpp
     1 //**********************************************************************
     2 //
     3 // Copyright (c) 2012 Ady Liu. All rights reserved.
     4 //
     5 // Email: imxylz@gmail.com
     6 //
     7 //**********************************************************************
     8 
     9 #include <Ice/Ice.h>
    10 #include <PrinterI.h>
    11 
    12 using namespace std;
    13 
    14 void PrinterI :: printString(const string& s,const Ice::Current&){
    15     cout << s << endl;
    16 }
    17 

    Server.cpp
     1 #include <Ice/Ice.h>
     2 #include <PrinterI.h>
     3 
     4 using namespace std;
     5 
     6 class Server : public Ice::Application {
     7 
     8     public:
     9         virtual int run(int argc,char* argv[]);
    10 };
    11 
    12 int main(int argc,char* argv[]){
    13 
    14     Server app;
    15     int status = app.main(argc,argv,"server.cfg");
    16     return status;
    17 }
    18 
    19 int Server::run(int argc,char* argv[]){
    20     if(argc>1){
    21         cerr<<appName()<<": too many arguments"<<endl;
    22         return EXIT_FAILURE;
    23     }
    24 
    25     Ice::PropertiesPtr properties = communicator()->getProperties();
    26     Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("PrinterAdapter");
    27     Ice::Identity id = communicator()->stringToIdentity("printer");
    28     Demo::PrinterPtr printer = new PrinterI();
    29     adapter->add(printer,id);
    30     adapter->activate();
    31     communicator()->waitForShutdown();
    32     return EXIT_SUCCESS;
    33 }
    34 

    ?#32042;璇?br />
    c++ -I. -I$ICE_HOME/include -c PrinterI.cpp Printer.cpp Server.cpp

    杩?#37818;?br />
    c++ -o server Printer.o Server.o PrinterI.o -L$ICE_HOME/lib -lIce -lIceUtil -lpthread

    鏈?#37716;?#32468;?#38320;嶇疆
    server.cfg
    PrinterAdapter.AdapterId=PrinterAdapter
    PrinterAdapter.Endpoints=default
    Ice.Default.Locator=DemoGrid/Locator:tcp -p 4061
    ?#32333;琛?#37832;?#37716;?#32468;?br />
    ./server

    瀹?#37812;?#32468;?/h2> Client.cpp
     1 //**********************************************************************
     2 //
     3 // Copyright (c) 2012 Ady Liu. All rights reserved.
     4 //
     5 // Email: imxylz@gmail.com
     6 //
     7 //**********************************************************************
     8 
     9 #include <Ice/Ice.h>
    10 #include <IceGrid/IceGrid.h>
    11 #include <Printer.h>
    12 
    13 using namespace std;
    14 using namespace Demo;
    15 
    16 int main(int argc,char* argv[]){
    17     int status = 0;
    18     Ice::CommunicatorPtr ic;
    19     PrinterPrx printer;
    20     try{
    21         ic = Ice::initialize(argc,argv);
    22         cout<<"Printer Proxy=>"<<ic->stringToProxy("printer@PrinterAdapter")<<endl;
    23 
    24         try{
    25            printer = PrinterPrx::checkedCast(ic->stringToProxy("printer@PrinterAdapter"));
    26         }catch(const Ice::NotRegisteredException&){
    27             IceGrid::QueryPrx query = IceGrid::QueryPrx::checkedCast(ic->stringToProxy("DemoGrid/Query"));
    28             printer = PrinterPrx::checkedCast(query->findObjectByType("::Demo::Printer"));
    29         }
    30         if(!printer){
    31             cerr<<": could't find a `::Demo::Printer` object."<<endl;
    32             if(ic){
    33                 ic->destroy();
    34             }
    35             return EXIT_FAILURE;
    36         }
    37         printer->printString("Hello world!");
    38     }catch(const Ice::Exception& ex){
    39         cerr << ex << endl;
    40         status = 1;
    41     }catch(const char* msg){
    42         cerr << msg << endl;
    43         status = 2;
    44     }
    45     if(ic){
    46         ic->destroy();
    47     }
    48     return status;
    49 }
    50 

    ?#32042;璇?br />
    c++ -I. -I$ICE_HOME/include -c Printer.cpp Client.cpp

    杩?#37818;?br />
    c++ -o client Printer.o Client.o -L$ICE_HOME/lib -lIce -lIceUtil -lIceGrid -lGlacier2 -lpthread

    瀹?#37812;?#32468;?#38320;嶇疆
    client.cfg
    Ice.Default.Locator=DemoGrid/Locator:default -p 4061

    ?#32333;琛屽鎴?#32468;?br />
    ./client --Ice.Config=./client.cfg


    鎵鏈?#37826;囦欢

    grid
    ├── client.cfg
    ├── Client.cpp
    ├── Printer.cpp
    ├── Printer.h
    ├── PrinterI.cpp
    ├── PrinterI.h
    ├── registry.cfg
    ├── server.cfg
    └── Server.cpp


    鎵鏈?#37826;囦欢涓?#26462;? 
    Ice Mini Guide

    imxylz 2012-05-22 19:47 鍙?#29723;?#29831;?#29825;?/a>
    ]]>?#22414;甯冨紡娑堟伅?#37108;缁焜afka蹇?#38315;?#29863;?#23005;?/title><link>http://www.5432034.com/xylz/archive/2012/05/11/377938.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Fri, 11 May 2012 10:48:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/05/11/377938.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/377938.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/05/11/377938.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/377938.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/377938.html</trackback:ping><description><![CDATA[     鎽?#29781;? Jafka 鏄?#28051;涓?#23534;?#31790;鐨?鎬ц兘鑹?#28610;?#37928;勫垎甯冨紡娑堟伅?#37108;缁?#37510;?#37734;?#28051;?#28051;绡?#37826;?#32468;犱腑鏈?#37813;?#30045;鍗?#28000;?#32513;?#37510;?涓嬮潰鏄?#28051;绡囩畝鍗?#37928;?#37711;?#38338;?#37826;囨。銆?#37831;?#28598;?#29831;?#32513;?#37928;勬枃妗?#37721;?#38000;僿iki銆? Step 1: 涓?#26462;?#37832;?#26570;鐨?#28729;夎鍖?瀹屾暣鐨?#28729;夎?#21614;寚鍗?#37734;?#26473;?#38322;?#37510;?鏈?#26570;鐨?#37721;?#29723;岀?#22557;?#26495;潃鍦?#38171;歨ttps://github.com/adyliu/jafka/downloads $wget https://github.com/downloads/adyliu/j...  <a href='http://www.5432034.com/xylz/archive/2012/05/11/377938.html'>闃?#29831;?#37711;?#37826;?/a><img src ="http://www.5432034.com/xylz/aggbug/377938.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-05-11 18:48 <a href="http://www.5432034.com/xylz/archive/2012/05/11/377938.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Jafka - 涓涓?#26946;?#37804;ц兘鐨勬?#22559;伅?#37108;缁?/title><link>http://www.5432034.com/xylz/archive/2012/05/10/377759.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Thu, 10 May 2012 02:08:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/05/10/377759.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/377759.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/05/10/377759.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/377759.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/377759.html</trackback:ping><description><![CDATA[<p>Jafka 鏄?#28051;涓?#26946;?#37804;ц兘鐨勫垎甯冨紡娑堟伅?#37108;缁?#37510;侸afka宸茬粡寮?#31790;锛屼娇鐢╣ithub鎵樼锛?#28051;?#26916;?#37734;板潃锛?a href="https://github.com/adyliu/jafka" target="_blank">https://github.com/adyliu/jafka<br /> </a><br /> Jafka 1.0鐗?#37832;?#23480;茬粡鍙?#29999;?#38171;?#37722;屾鍒癕aven?#33105;澶?#28000;?#25652;?#37510;?br /> <br /> Jafka鏄?#37922;盇pache瀛?#37718;栫殑Kafka(鐢盠inkedIn?#23832;鍔?#32513;橝pache锛?#37711;嬮殕鑰屾潵銆侸afka 1.0瀹屾暣閬靛惊Kafka 0.7鐨勮?#21230;寖锛屽嚑涔?#37828;疜afka鐨?#37711;嬮殕鐗?#38171;?#37832;?#28051;浜?#37824;?#26473;?#37724;岃皟鏁?#38171;?#37510;?br /> Jafka鏈夊嚑涓?#37722;?#23534;?#27996;?#37928;勭壒鎬?#38171;?br /> <br /> <ul> <li>娑堟伅鎸佷箙鍖栭潪甯?#36423;?#38171;?#37832;?#37716;?#32468;?#28699;樺偍娑堟伅鐨?#23534;閿涓篛(1)锛屽苟涓斿熀浜?#37826;囦欢?#37108;缁?#38171;岃兘澶熸?#20343;箙鍖朤B?#39559;鐨勬?#22559;伅鑰?#28051;嶆崯澶?#37804;ц兘</li> <li>鍚?#37722;愰噺寰堝ぇ锛屽湪鎴戠殑鍗?#37832;篋ELL E6220锛?#37916;?#23480;茬粡鍋滀骇锛?#37510;丗edora 16 x86_64涓嬪崟CPU鍐呮牳?#32333;琛?#38171;屼娇鐢↗afka鍐?#32515;?#37928;刾ython瀹?#37812;?#32468;?#38171;?#37722;?#37722;愰噺?#20824;澶熻?#24807;埌300k/s</li> <li>瀹?#37711;?#37928;勫垎甯冨紡?#37108;缁?#38171;宐roker銆乸roducer銆乧onsumer?#20824;鍘?#37922;熻嚜?#23017;鏀?#37816;佸垎甯冨紡銆傝嚜?#23017;瀹?#37916;?#28598;?#37833;傚潎琛?#37510;?/li> <li>鍐呮?#25601;潪甯?#28751;?#38171;屾?#32736;釜?#37108;缁?#38171;?#37718;?#37815;?#37832;?#37716;?#32468;?#37724;屽鎴?#32468;?#38171;?#37721;?#37832;?#28051;涓?72KB鐨刯ar鍖?#38171;屽?#21620;儴鏈哄埗涔?#28051;嶅鏉?#38171;岄?#37722;?#26473;?#29723;屽?#21613;祵鎴?#38000;?#27996;屾寮鍙? 銆傛?#32736;釜鏈?#37716;?#32468;?#37716;?#28051;?#28186;?#29863;栫?#21226;欢鍏?.5MB銆?/li> <li>娑堟伅鏍煎紡浠?#37721;?#38315;?#28103;?#37832;哄埗?#28522;甯哥畝鍗?#38171;岄?#37722;?#26473;?#29723;?#29882;?#29831;?#29815;寮鍙?#37510;?#37929;墠?#22172;甯?#37928;凱ython 3.x鐨?#28729;?#37812;?#32468;?#37824;?#37816;佸彂閫佹?#22559;伅鍜屾帴鏀舵?#22559;伅銆?/li> </ul> 鍙?#28598;?#38171;?#26473;?#38322;?#37832;?#28051;涓垎浜?#37928;凱PT璧勬簮銆?br /> </p> <div style="width: 510px" id="__ss_12795614"><strong style="margin: 12px 0px 4px; display: block"><a title="Jafka guide" href="http://www.slideshare.net/xylz/jafka-guide-pubilc" target="_blank">Jafka guide</a></strong> <iframe height="426" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/12795614" frameborder="0" width="510" marginwidth="0" scrolling="no"></iframe> <div style="padding-bottom: 12px; padding-left: 0px; padding-right: 0px; padding-top: 5px">View more <a href="http://www.slideshare.net/thecroaker/death-by-powerpoint" target="_blank">PowerPoint</a> from <a href="http://www.slideshare.net/xylz" target="_blank">Ady Liu</a> </div> </div> 濡?#37835;?#37808;?#37711;磋叮锛宖ork鍦╣ithub涓?#37928;勬簮?#29212;锛?#26473;?#29723;?#27996;屾寮鍙?#37812;?#38000;呮?#22796;収?#22172;?#32321;鍠?#23046;?#37928;勬?#29808;紡杩?#29723;?#37824;?#26473;?#37510;傚鏋?#37832;?#28610;?#37928;勭壒鎬?#37812;?#38000;?#37721;戠幇bug璇?#37721;嬫?#21614;彁閱?#37812;?#37510;?鍙?#28598;?#38171;屽?#23339;儏鏀?#37816;佹窐瀹濆?#21620;儴浣?#37922;?#37928;凨afka鍏嬮殕鐗?a href="https://github.com/killme2008/Metamorphosis" target="_blank">metaq</a>,鍐呴儴?#20187;浜嗗ぇ?#22138;鐨勬敼杩?#37724;岄檮鍔?#32513;勪欢銆傚鏋滀綘闇瑕佷竴涓?#37711;?#37716;熻兘鐨?#8220;澶?#37833;?#8221;?#37108;缁?#38171;屽彲浠ヨ瘯?#30255;metaq.<img src ="http://www.5432034.com/xylz/aggbug/377759.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-05-10 10:08 <a href="http://www.5432034.com/xylz/archive/2012/05/10/377759.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>[?#32321;鍏?#23092;呭嚭Jetty 05] Jetty 妯?#37735;?#37718;?/title><link>http://www.5432034.com/xylz/archive/2012/04/12/372999.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Thu, 12 Apr 2012 01:39:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/04/12/372999.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/372999.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/04/12/372999.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/372999.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/372999.html</trackback:ping><description><![CDATA[<!--PageText--> <div id="wikitext"> <h1><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a> 8.x 妯?#37735;?#37718;?/h1> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a> 8.x甯?#37832;?#28051;涓?#27035;?#29825;?#37928;則est鐜?#28583;?#37510;?#37812;?#28000;?#28000;?#26473;?#28051;?#27035;?#29825;?#37928;勭幆澧?#37711;?#37813;?#37510;? </p> <p class="vspace">棣?#37711;?#38171;屾潵?#22414;鏋?#28051;媠tart.ini閲岄潰鐨勯?#23943;疆锛?#26473;?#28051;?#38320;嶇疆鍐?#28729;?#37722;姩浜嗗摢浜?#22959;?#37735;?#37510;? </p> <div class="vspace"></div><pre class="escaped">$ grep -v "#" start.ini|grep -v "^$" OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations etc/jetty.xml etc/jetty-annotations.xml etc/jetty-deploy.xml etc/jetty-webapps.xml etc/jetty-contexts.xml etc/jetty-testrealm.xml </pre> <p class="vspace">鍒?#37922;?#28051;?#38010;傚鍒扮殑鍙?#37828;?#38171;?#37812;?#28000;?#37711;堟潵?#22414;鏋?#28051;?#37922;?#37714;?#27996;?#38317;?#27996;?#22959;?#37735;?#37510;? </p><pre class="escaped">java -jar start.jar --list-options </pre> <p class="vspace">鏌ユ壘Server,jsp,jmx,resources,websocket,ext,plus,annotations杩?#27996;?#28725;瑰簲鐨勬ā鍧?#37832;?#38171;? </p><pre class="escaped">GLOBAL option (Appended Entries) (*) ------------------------------------------------------------- 0: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-util-8.1.2.v20120308.jar 1: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-io-8.1.2.v20120308.jar </pre> <pre class="escaped">Option [Server] (Aggregate) ------------------------------------------------------------- 0: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-xml-8.1.2.v20120308.jar 1: 3.0.0.v201112011016 | ${jetty.home}/lib/servlet-api-3.0.jar 2: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-http-8.1.2.v20120308.jar 3: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-continuation-8.1.2.v20120308.jar 4: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-server-8.1.2.v20120308.jar 5: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-security-8.1.2.v20120308.jar 6: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-servlet-8.1.2.v20120308.jar 7: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-webapp-8.1.2.v20120308.jar 8: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-deploy-8.1.2.v20120308.jar 9: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-servlets-8.1.2.v20120308.jar </pre> <pre class="escaped">Option [jsp] ------------------------------------------------------------- 0: 2.2.0.v201108011116 | ${jetty.home}/lib/jsp/com.sun.el-2.2.0.v201108011116.jar 1: 2.2.0.v201108011116 | ${jetty.home}/lib/jsp/javax.el-2.2.0.v201108011116.jar 2: 1.2.0.v201105211821 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar 3: 2.2.0.v201112011158 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar 4: 2.2.2.v201112011158 | ${jetty.home}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar 5: 1.2.0.v201112081803 | ${jetty.home}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar 6: 3.7.0.M20110909-1335 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.7.1.jar </pre> <pre class="escaped">Option [jmx] ------------------------------------------------------------- 0: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-jmx-8.1.2.v20120308.jar </pre> <pre class="escaped">Option [resources] ------------------------------------------------------------- 0: (dir) | ${jetty.home}/resources </pre> <pre class="escaped">Option [websocket] ------------------------------------------------------------- 0: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-websocket-8.1.2.v20120308.jar </pre> <pre class="escaped">Option [ext] ------------------------------------------------------------- Empty option, no classpath entries active. </pre> <pre class="escaped">Option [plus] ------------------------------------------------------------- 0: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-jndi-8.1.2.v20120308.jar 1: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-plus-8.1.2.v20120308.jar 2: 1.1.0.v201105071233 | ${jetty.home}/lib/jndi/javax.activation-1.1.0.v201105071233.jar 3: 1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar </pre> <pre class="escaped">Option [annotations] ------------------------------------------------------------- 0: 8.1.2.v20120308 | ${jetty.home}/lib/jetty-annotations-8.1.2.v20120308.jar 1: 1.1.0.v201108011116 | ${jetty.home}/lib/annotations/javax.annotation-1.1.0.v201108011116.jar 2: 3.1.0.v200803061910 | ${jetty.home}/lib/annotations/org.objectweb.asm-3.1.0.v200803061910.jar </pre> <p class="vspace">浠?#28051;?#28051;?#22957;?#33105;鎴?#28000;煡?#20158;锛?#26473;?#27996;?#22959;?#37735;?#37929;稿綋浜?#28751;?#38317;?#27996;?#32513;勪欢鍔?#37711;lasspath?#33105;锛宩etty鍦?#37722;姩鏃?#28052;熶細瑁?#26462;?#26473;?#27996;?#22959;?#37735;?#37510;? </p><pre class="escaped">$java -jar start.jar --dry-run|awk '{print $4}'|sed 's/:/\n/g' /opt/apps/jetty8/lib/jetty-xml-8.1.2.v20120308.jar /opt/apps/jetty8/lib/servlet-api-3.0.jar /opt/apps/jetty8/lib/jetty-http-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-continuation-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-server-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-security-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-servlet-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-webapp-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-deploy-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-servlets-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-annotations-8.1.2.v20120308.jar /opt/apps/jetty8/lib/annotations/javax.annotation-1.1.0.v201108011116.jar /opt/apps/jetty8/lib/annotations/org.objectweb.asm-3.1.0.v200803061910.jar /opt/apps/jetty8/lib/jetty-jmx-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jsp/com.sun.el-2.2.0.v201108011116.jar /opt/apps/jetty8/lib/jsp/javax.el-2.2.0.v201108011116.jar /opt/apps/jetty8/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar /opt/apps/jetty8/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar /opt/apps/jetty8/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar /opt/apps/jetty8/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar /opt/apps/jetty8/lib/jsp/org.eclipse.jdt.core-3.7.1.jar /opt/apps/jetty8/lib/jetty-jndi-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-plus-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jndi/javax.activation-1.1.0.v201105071233.jar /opt/apps/jetty8/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar /opt/apps/jetty8/resources /opt/apps/jetty8/lib/jetty-websocket-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-util-8.1.2.v20120308.jar /opt/apps/jetty8/lib/jetty-io-8.1.2.v20120308.jar </pre> <p class="vspace">鍦?#37804;?#32513;?#28051;?#38171;?#28051;?#37722;岀殑OPTION鍐?#28729;?#27996;?#37722;姩涓?#37722;岀?#21228;ā鍧?#38171;堜篃灏?#37828;?#28051;?#37722;岀?#21229;?#21226;欢鍜宑lasspath锛?#37510;?#37721;?#28598;?#38171;屽浜巗tart.config閲岄潰鐨?#28051;?#37722;岀殑OPTION鍙兘鏈?#37929;?#37722;岀?#21228;ā鍧椾緷璧?#37510;? </p> <p class="vspace">榛?#29825;?#37928;則est.war鍚姩浜嗗涓嬫ā鍧?#38171;? </p><ul><li>Server: 涓涓爣?#22127;鐨剆ervlet瀹瑰櫒 </li><li>jsp: jsp妯?#37735;? </li><li>jmx: jmx鏀?#37816;? </li><li>resources: 鍏佽浠?{jetty.home}/resources?#33105;璇?#37721;栫被璧勬簮锛堝疄闄?#28051;?#37828;?#38320;嶇疆log4j.properties) </li><li>websocket: 鏀?#37816;亀ebsocket鐨?#28186;嬪瓙 </li><li>ext: 鐢?#27996;?{jetty.home}/lib/ext鐩綍涓虹┖锛屽疄闄?#28051;?#28000;涔堥兘?#20187;銆?#37711;?#28729;?#23005;?#37911;?#37804;?#37828;?#28051;?#27996;?#29761;?#26462;借嚜瀹?#28052;?#37928;勭?#21226;欢渚?#29863;?#37510;? </li><li>plus: 涓浜?#37813;╁睍鏀?#37816;?#38171;?#28000;?#28051;?#38344;lasspath?#33105;鐚?#23092;?#38171;屽簲璇?#37828;痡ndi銆乯ava璁?#29831;佷互鍙妀ava mail鐨勭?#21226;欢銆? </li><li>annotations: java?#25950;瑙?#28000;?#37721;?#28699;楄妭?#29212;鐨勬敮鎸?#37510;? </li></ul><div class="vspace"></div><h2>test.war閰嶇疆</h2> <p>鍐?#37833;?#37930;?#37930;嬪姞杞絡etty閰嶇疆銆? test.war妯?#37735;?#27035;?#29825;?#37716;?#26462;?#27996;?涓?#38320;嶇疆缁勪欢銆? </p><pre class="escaped">etc/jetty.xml etc/jetty-annotations.xml etc/jetty-deploy.xml etc/jetty-webapps.xml etc/jetty-contexts.xml etc/jetty-testrealm.xml </pre> <div class="vspace"></div><h3><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.xml</h3> <p>榛?#29825;?#37928;刯etty.xml璐?#29840;?#38320;嶇疆璁?#32515;?#37832;?#37716;?#37731;?#37928;?#37721;傛暟锛屽寘鎷?#32513;戝畾鐨?#37734;板潃銆?#32510;?#32459;?#23033;?#28598;?#28751;?#28000;?#37721;?#28051;浜?#27035;?#29825;?#37928;?#28598;勭?#21975;櫒(Handler锛?#32475;?#37510;? </p><pre class="escaped"><Configure id="Server" class="org.eclipse.jetty.server.Server"> <Set name="ThreadPool"> <New class="org.eclipse.jetty.util.thread.QueuedThreadPool"> <Set name="minThreads">10</Set> <Set name="maxThreads">200</Set> <Set name="detailedDump">false</Set> </New> </Set> <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="host"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.host" /></Set> <Set name="port"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.port" default="8080"/></Set> <Set name="maxIdleTime">300000</Set> <Set name="Acceptors">2</Set> <Set name="statsOn">false</Set> <Set name="confidentialPort">8443</Set> <Set name="lowResourcesConnections">20000</Set> <Set name="lowResourcesMaxIdleTime">5000</Set> </New> </Arg> </Call> <Set name="handler"> <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"> <Set name="handlers"> <Array type="org.eclipse.jetty.server.Handler"> <Item> <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/> </Item> <Item> <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/> </Item> </Array> </Set> </New> </Set> <Set name="stopAtShutdown">true</Set> <Set name="sendServerVersion">true</Set> <Set name="sendDateHeader">true</Set> <Set name="gracefulShutdown">1000</Set> <Set name="dumpAfterStart">false</Set> <Set name="dumpBeforeStop">false</Set> </Configure> </pre> <p class="vspace">鍙?#28000;?#37930;嬪嚭榛?#29825;?#37928;勭嚎绋?#23033;?#28598;?#28751;?#37828;?#37832;灏忕嚎绋?0涓?#38171;?#37832;澶?#32510;?#32459;?00涓?#37510;?#32513;戝畾鍦?#37813;鏈夌綉鍗?#37928;?080绔?#37721;?#37510;?#37711;?#28729;冮?#23943;疆浠?#37722;庡?#23941;垎鏋?#37510;? </p> <div class="vspace"></div><h3><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-annotation.xml</h3> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-annotation.xml閰嶇疆搴?#29831;?#37828;?#37819;?#26473;?#37824;?#37816;佸摢浜涙敞瑙?#38320;嶇疆鏂瑰紡銆? </p><pre class="escaped"> <Call name="setAttribute"> <Arg>org.eclipse.jetty.webapp.configuration</Arg> <Arg> <Array type="java.lang.String"> <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item> <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item> <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item> <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item> <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item> <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item> </Array> </Arg> </Call> </pre> <div class="vspace"></div><h3><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-deploy.xml</h3> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-deploy.xml閰嶇疆web鍙?#29999;?#37826;瑰紡銆? </p><pre class="escaped"> <Call name="addBean"> <Arg> <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager"> <Set name="contexts"> <Ref id="Contexts" /> </Set> <Call name="setContextAttribute"> <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> <Arg>.*/servlet-api-[^/]*\.jar$</Arg> </Call> </New> </Arg> </Call> </pre> <p>浜嬪疄涓?#26473;?#38322;屾病鏈?#28729;?#28052;夎?#20344;彂甯?#37928;?#37929;綍鎴?#38000;?#25652;?#37922;ㄤ綅缃?#38171;屽?#29363;jetty-deploy渚?#29863;?#27996;巎etty-contexts.xml鎴?#38000;卝etty-webapps.xml銆? </p> <div class="vspace"></div><h3><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-webapps.xml</h3> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-webapps.xml瀹?#28052;夎?#20344;彂甯?#37928;勫唴瀹?#38171;岄?#29999;?#37828;?#29781;佸彂甯冨簲鐢?#37812;?#38000;?#25652;?#37922;?#37928;?#28729;?#28052;?#37510;?#27035;?#29825;?#37828;?#28699;?#37824;?#27996;?{jetty.home}/webapps涓?#37928;?#25652;?#37922;?#28000;?#37721;?{jetty.home}/contexts涓?#37928;剎ml瀹?#28052;?#37510;? </p><pre class="escaped"> <Ref id="DeploymentManager"> <Call id="webappprovider" name="addAppProvider"> <Arg> <New class="org.eclipse.jetty.deploy.providers.WebAppProvider"> <Set name="monitoredDirName"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="." />/webapps</Set> <Set name="defaultsDescriptor"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="."/>/etc/webdefault.xml</Set> <Set name="scanInterval">1</Set> <Set name="contextXmlDir"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="." />/contexts</Set> <Set name="extractWars">true</Set> </New> </Arg> </Call> </Ref> </pre> <div class="vspace"></div><h3><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-contexts.xml</h3> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-contexts.xml瀹?#28052;?#28051;浜?#26864;勭疆瑙?#37714;?#37510;傜被浼?#27996;?#28051;浜?#37815;?#37812;?#37731;?#37510;?#28186;嬪鍙?#28000;?#29825;叉煇浜沀RI rewrite鎴?#38000;呴潤鎬?#29863;勬簮cache閰嶇疆绛?#37510;? </p> <p class="vspace">杩欎細?#22172;?#23017;鎵?#37819;?{jetty.home}/contexts涓嬮潰鐨剎ml閰嶇疆銆? </p><pre class="escaped"> <Ref id="DeploymentManager"> <Call name="addAppProvider"> <Arg> <New class="org.eclipse.jetty.deploy.providers.ContextProvider"> <Set name="monitoredDirName"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="." />/contexts</Set> <Set name="scanInterval">1</Set> </New> </Arg> </Call> </Ref> </pre> <div class="vspace"></div><h3><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-testrealm.xml</h3> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-testrealm.xml鐢?#27996;巘est.war鐨勭壒瀹氶?#23943;疆锛岀敤浜庨?#23943;疆涓浜涜璇佷俊?#20229;銆? </p><pre class="escaped"> <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.security.HashLoginService"> <Set name="name">Test Realm</Set> <Set name="config"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="."/>/etc/realm.properties</Set> <Set name="refreshInterval">0</Set> </New> </Arg> </Call> </pre> <div class="vspace"></div><h2>test.xml</h2> <p>浜嬪疄涓?#26473;欎?#22559;ā鍧?#37928;勯?#23943;疆?#20824;鏄?#37734;?lt;Configure id="Server" class="org.eclipse.jetty.server.Server">?#22957;?#20579;閰嶇疆涓?#37510;? 鍥犳鍙?#28000;?#37722;堝?#33333;垚涓涓?#28598;?#37928;剎ml銆?#26473;欐?#23792;仛鐨勫ソ澶勬槸鍦?#28051;涓獂ml鍖?#37722;?#37813;鏈?#38320;嶇疆锛屾柟渚跨伒娲诲畾涔?#37510;傚綋鐒?#38171;屽潖澶?#28751;?#37828;?#28598;?#37922;?#37916;?#28003;?#37510;? </p><pre class="escaped"><?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Set name="ThreadPool"> <!-- Default queued blocking threadpool --> <New class="org.eclipse.jetty.util.thread.QueuedThreadPool"> <Set name="minThreads">10</Set> <Set name="maxThreads">200</Set> <Set name="detailedDump">false</Set> </New> </Set> <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="host"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.host" /></Set> <Set name="port"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.port" default="8080"/></Set> <Set name="maxIdleTime">300000</Set> <Set name="Acceptors">2</Set> <Set name="statsOn">false</Set> <Set name="confidentialPort">8443</Set> <Set name="lowResourcesConnections">20000</Set> <Set name="lowResourcesMaxIdleTime">5000</Set> </New> </Arg> </Call> <Set name="handler"> <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"> <Set name="handlers"> <Array type="org.eclipse.jetty.server.Handler"> <Item> <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/> </Item> <Item> <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/> </Item> </Array> </Set> </New> </Set> <Set name="stopAtShutdown">true</Set> <Set name="sendServerVersion">true</Set> <Set name="sendDateHeader">true</Set> <Set name="gracefulShutdown">1000</Set> <Set name="dumpAfterStart">false</Set> <Set name="dumpBeforeStop">false</Set> <Call name="setAttribute"> <Arg>org.eclipse.jetty.webapp.configuration</Arg> <Arg> <Array type="java.lang.String"> <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item> <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item> <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item> <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item> <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item> <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item> </Array> </Arg> </Call> <Call name="addBean"> <Arg> <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager"> <Set name="contexts"> <Ref id="Contexts" /> </Set> <Call name="setContextAttribute"> <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> <Arg>.*/servlet-api-[^/]*\.jar$</Arg> </Call> </New> </Arg> </Call> <Ref id="DeploymentManager"> <Call id="webappprovider" name="addAppProvider"> <Arg> <New class="org.eclipse.jetty.deploy.providers.WebAppProvider"> <Set name="monitoredDirName"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="." />/webapps</Set> <Set name="defaultsDescriptor"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="."/>/etc/webdefault.xml</Set> <Set name="scanInterval">1</Set> <Set name="contextXmlDir"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="." />/contexts</Set> <Set name="extractWars">true</Set> </New> </Arg> </Call> </Ref> <Ref id="DeploymentManager"> <Call name="addAppProvider"> <Arg> <New class="org.eclipse.jetty.deploy.providers.ContextProvider"> <Set name="monitoredDirName"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="." />/contexts</Set> <Set name="scanInterval">1</Set> </New> </Arg> </Call> </Ref> <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.security.HashLoginService"> <Set name="name">Test Realm</Set> <Set name="config"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.home" default="."/>/etc/realm.properties</Set> <Set name="refreshInterval">0</Set> </New> </Arg> </Call> </Configure> </pre> <p class="vspace">鎴?#28000;?#28751;唗est.xml鏀?#37711;tc鐩綍涓嬮潰銆?#26473;?#37828;?#28103;?#37816;乻tart.ini鏂囦欢涓嶅瓨鍦?#38171;屼篃灏?#37828;?#28051;?#28003;?#37922;╯tart.ini閲岄潰鐨勯?#23943;疆銆? </p> <p class="vspace">鎵嬪姩?#32333;琛屽畠銆? </p><pre class="escaped">java -jar start.jar OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations etc/test.xml </pre> <p class="vspace">杩?#37827;跺?#37928;?#37722;姩灏?#37724;岄粯璁?#37722;姩鏄?#28051;鏍?#37928;?#27996;?#37510;? </p> <p class="vspace">杩?#37827;跺?#28751;?#37721;?#28000;?#29825;?#38338;?#27996;?#37510;? </p> <div class="vspace"></div><h2><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a> Statistics</h2> <p>杩?#28051;閮ㄥ垎锛?#37812;?#28000;?#37714;?#37922;?#28699;?#28052;?#37714;扮殑鍙?#37828;?#37833;?#38318;?#32515;?#28051;涓狫etty缁?#29825;?#22959;?#37735;?#37510;? </p> <div class="vspace"></div><h3>淇?#37824;?#29825;?#32515;?/h3> <p>灏?#26473;?#37818;?#29825;℃暟鍙傛暟鎵?#23534;锛? </p><pre class="escaped"> <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="host"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.host" /></Set> <Set name="port"><Property name="<a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>.port" default="8080"/></Set> <Set name="maxIdleTime">300000</Set> <Set name="Acceptors">2</Set> <Set name="statsOn">true</Set><!-- modify this --> </New> </Arg> </Call> </pre> <div class="vspace"></div><h3>璁?#32515;畇ervlet</h3> <p>涓?#27996;?#28051;嶅奖鍝?#27035;?#29825;?#37928;則est.war鐜?#28583;?#38171;?#37812;?#28000;?#28583;?#37716;?#28051;涓?#37832;?#30045;鍗?#37928;刉AR鐜?#28583;?#37510;? </p> <p class="vspace">鏍规嵁?#22688;闈?#28699;?#37714;扮?#21229;煡璇?#38171;屽彧闇瑕佸皢war鐜?#28583;?#37824;惧埌webapps鐩綍涓嬪嵆鍙?#37510;?#37721;?#28000;?#37828;?#28051;涓獁ar鍖?#38171;屼篃鍙?#28000;?#37828;?#28051;涓?#28000;?war缁?#28751;?#37928;?#37929;綍銆? </p><pre class="escaped">$tree webapps/demo.war/ webapps/demo.war/ `-- WEB-INF |-- <a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a>-web.xml `-- web.xml 1 directory, 2 files </pre> <div class="vspace"></div><pre class="escaped">$cat webapps/demo.war/WEB-INF/jetty-web.xml </pre> <pre class="escaped"><?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/demo</Set> </Configure> </pre> <div class="vspace"></div><pre class="escaped">$cat webapps/demo.war/WEB-INF/web.xml </pre> <pre class="escaped"><?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="false" version="3.0"> <display-name>static demo</display-name> <servlet> <servlet-name>statistic</servlet-name> <servlet-class>org.eclipse.jetty.servlet.StatisticsServlet</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <param-name>restrictToLocalhost</param-name><param-value>false</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>statistic</servlet-name> <url-pattern>/statistic/*</url-pattern> </servlet-mapping> </web-app> </pre> <p class="vspace">璇存槑?#22161;?#20579;锛? </p><ul><li>涓?#27996;?#28051;?#37724;宼est.war鐨刢ontextPath娣锋穯锛?#26473;?#38322;屽?#21700;埗淇?#37824;?#28051;?demo銆? </li><li>澧?#37716;?#28051;涓猨etty鍐?#32515;?#37928;勭粺璁ervlet(org.eclipse.jetty.servlet.StatisticsServlet) </li><li>灏唖ervlet鐨?#37721;傛暟restrictToLocalhost淇?#37824;?#28051;篺alse锛?#37722;?#37714;?#27035;?#29825;ゆ儏鍐?#28051;?#37721;兘閫?#26473;?#37832;?#37832;?#29825;?#38338;?#38171;?#28051;嶈兘杩?#32459;嬭闂? </li></ul><div class="vspace"></div><h3>?#32333;琛宒emo</h3> <p>淇?#37816;乼est.war涓?#37721;?#28583;?#37716;?#28051;涓?#32513;?#29825;?#38320;嶇疆銆? </p><pre class="escaped">$java -jar start.jar etc/jetty-stats.xml </pre> <div class="vspace"></div><h3>鎵?#29723;屾晥鏋?/h3> <p>浣?#37922;?#23092;?#29785;堝櫒璁?#38338;? </p><pre class="escaped">http://127.0.0.1:8080/demo/statistic/ </pre> <p class="vspace">?#26213;鏋滃涓?#38171;? </p><div><img src="http://dev.imxylz.info/wiki/./wiki/upload/Jetty/statistic1.png" alt="" title="" /></div> <div><img src="http://dev.imxylz.info/wiki/./wiki/upload/Jetty/statistic2.png" alt="" title="" /></div> <p class="vspace">缁?#29825;?#32513;?#37835;?#37718;?#37722;?涓?#38318;ㄥ垎锛? </p><ol><li>缁?#29825;?#32513;?#37835;?#37824;堕泦鏃?#38338;? </li><li>璇?#23033;傛暟璇︽儏锛堝綋?#22688;璇?#23033;傛暟銆?#37832;澶?#29831;?#23033;傛暟銆?#37804;?#37711;?#29831;?#23033;傛暟銆佽姹?#37827;?#38338;?#32475;?#38171;? </li><li>璇?#23033;傚垎鍙?#29831;︽儏锛?#37724;?#29831;?#23033;傛暟涓?#37722;岀?#21228;槸锛?#26473;?#37828;痡etty鍐呴儴?#22414;鍙?#29831;?#23033;?#37928;勬暟?#22138;锛屽寘鎷琭orward/include绛?#38171;? </li><li>鍝嶅?#26050;?#33333;佽?#20751;锛?xx/2xx/3xx/4xx/5xx浠?#37721;?#37804;?#37711;?#37721;?#38315;?#37928;勫瓧鑺傛暟锛? </li><li>杩?#37818;ユ暟璇︽儏 锛堝綋?#22688;杩?#37818;ユ暟銆?#37832;澶?#26473;?#37818;ユ暟銆佽繛鎺?#37816;?#32513;?#37827;?#38338;?#32475;?#38171;? </li><li>鍐?#28699;樼?#36346;喌锛堝?#21975;唴瀛?#37724;岄潪鍫嗗唴瀛?#28003;?#37922;?#37912;跺喌,?#28522;鍫嗗唴瀛?#38315;?#29999;?#28052;?#32457;版案涔?#28000;?#37712;?#28699;?#38171;? </li></ol><div class="vspace"></div><h2>灏?#32513;?/h2> <p><a title="" href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">Inside in Jetty</a> 8.x宸茬粡灏?#37722;?#28051;?#22959;?#37735;?#37815;嗗垎?#28522;甯?#29831;?#32513;?#27996;?#37510;?#23011;?#28051;涓?#22959;?#37735;?#37928;勫懡鍚嶉兘?#28522;甯?#37832;夎寰?#37510;?#38315;?#29999;?#28000;?#37722;?#32457;?#28051;?#28751;辫兘澶?#37914;?#23092;嬪嚭妯?#37735;?#37928;勪綔鐢?#37510;? </p> <p class="vspace">閮ㄥ垎妯?#37735;?#37721;兘杩?#38343;瑕佸?#29808;簲鐨勯?#23943;疆銆?{jetty.home}/etc涓嬮潰鏈?#28598;ч噺鐨勯?#23943;疆锛?#26473;?#27996;?#38342;舵暎鐨勯?#23943;疆鎷嗗垎鏄?#28051;?#27996;?#37721;?#28598;?#37922;?#37510;? 濡?#37835;?#28051;涓猨etty瑕佹兂鍚姩澶?#28051;猨ava杩?#32459;?#38171;?#38317;?#28052;?#37721;?#38343;瑕佹寚瀹?#28051;?#37722;岀殑閰嶇疆鍗?#37721;?#37510;?#37922;?#38007;?#28051;?#27996;?#37826;?#28186;?#28729;氬埗鍖?#38171;屽彲?#20824;涓?#23011;?#28051;涓猨ava杩?#32459;嬪垱寤?#28051;涓?#28729;屾暣鐨刯etty.xml閰嶇疆锛?#38000;?#28051;?#38343;瑕?{jetty.home}/etc涓嬮潰鐨勯?#23943;疆銆? </p> </div><img src ="http://www.5432034.com/xylz/aggbug/372999.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-04-12 09:39 <a href="http://www.5432034.com/xylz/archive/2012/04/12/372999.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>[?#32321;鍏?#23092;呭嚭Jetty] 鏂?#32468;?#32497;?#23534;?/title><link>http://www.5432034.com/xylz/archive/2012/04/12/371612.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Thu, 12 Apr 2012 01:38:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/04/12/371612.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/371612.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/04/12/371612.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/371612.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/371612.html</trackback:ping><description><![CDATA[鏁?#37918;咼etty鐨勬枃绔?#32497;?#23534;?br /> <ol> <li><a href="http://www.5432034.com/xylz/archive/2012/01/29/368969.html" target="_blank">[?#32321;鍏?#23092;呭嚭Jetty 01] Jetty 8.x 瀹夎</a></li> <li><a href="http://www.5432034.com/xylz/archive/2012/01/29/368970.html" target="_blank">[?#32321;鍏?#23092;呭嚭Jetty 02] Jetty 8.x ?#30045;鍗曡瘯鐢?/a></li> <li><a href="http://www.5432034.com/xylz/archive/2012/03/09/371598.html" target="_blank">[?#32321;鍏?#23092;呭嚭Jetty 03] ?#30045;鍗?#37928;凴ESTful鍏?#38338;?/a></li> <li><a href="http://www.5432034.com/xylz/archive/2012/03/28/372923.html" target="_blank">[?#32321;鍏?#23092;呭嚭Jetty 04] Jetty鐨?#37722;姩鏂瑰紡</a></li> <li><a href="http://www.5432034.com/xylz/archive/2012/04/12/372999.html" target="_blank">[?#32321;鍏?#23092;呭嚭Jetty 05] Jetty 妯?#37735;?#37718;?/a></li> </ol><img src ="http://www.5432034.com/xylz/aggbug/371612.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-04-12 09:38 <a href="http://www.5432034.com/xylz/archive/2012/04/12/371612.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>[?#32321;鍏?#23092;呭嚭Jetty 04]Jetty鐨?#37722;姩鏂瑰紡http://www.5432034.com/xylz/archive/2012/03/28/372923.htmlimxylzimxylzWed, 28 Mar 2012 11:02:00 GMThttp://www.5432034.com/xylz/archive/2012/03/28/372923.htmlhttp://www.5432034.com/xylz/comments/372923.htmlhttp://www.5432034.com/xylz/archive/2012/03/28/372923.html#Feedback2http://www.5432034.com/xylz/comments/commentRss/372923.htmlhttp://www.5432034.com/xylz/services/trackbacks/372923.html
    ?#27342;浜?#37835;佸ぇ鏂?#28186;垮祵鍏ュ紡鍚姩涔嬪锛?#28000;庣?#23338;簭澶?#38318;?#28052;熼潪甯稿ソ瀹?#37828;?#37722;姩jetty銆?br />
    [鍘熸枃锛歨ttp://www.5432034.com/xylz/archive/2012/03/28/372923.html]

    ?#32333;琛屾?#29808;紡

    ?#32333;琛屾?#35268;硶1

    棣?#37711;?#37812;?#28000;?#28000;?#28051;涓爣?#22127;鐨刯ar绋嬪簭鍚姩鏉?#37930;嬪緟杩?#28051;?#38338;?#26864;?
    [adyliu@adyliu-pc jetty8]$ cat run.sh 
    #!/bin/bash


    JETTY_CLASSPATH="./start.jar"
    for f in `find ./lib -name "*.jar"`
    do
        JETTY_CLASSPATH=$JETTY_CLASSPATH:$f
    done

    #echo $JETTY_CLASSPATH
    java -cp $JETTY_CLASSPATH $*

    鐒?#37722;庤繍琛屾煡鐪?#28051;?/div>
    [adyliu@adyliu-pc jetty8]$ sh run.sh org.eclipse.jetty.start.Main
    2012-03-28 16:00:57.532:INFO:oejs.Server:jetty-8.1.2.v20120308
    2012-03-28 16:00:57.578:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080

    鐢?#27996;庢病鏈?#28000;?#28003;晈eb鐜?#28583;?#38171;屽?#29363;姝?#37827;?#29825;?#38338;?#28000;?#28003;?#37734;板潃搴?#29831;ラ兘鏄?04銆?#23092;嬭瘯涓涓?#38171;?/div>
    [adyliu@adyliu-pc jetty8]$ curl -v http://127.0.0.1:8080
    * About to connect() to 127.0.0.1 port 8080
    *   Trying 127.0.0.1 connected
    * Connected to 127.0.0.1 (127.0.0.1) port 8080
    > GET / HTTP/1.1
    > User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    > Host: 127.0.0.1:8080
    Accept: */*

    < HTTP/1.1 404 Not Found
    < Date: Wed, 28 Mar 2012 08:15:27 GMT
    < Content-Type: text/html
    < Content-Length618
    < Server: Jetty(8.1.2.v20120308)
    <HTML>
    <HEAD>
    <TITLE>Error 404 - Not Found</TITLE>
    <BODY>
    <H2>Error 404 - Not Found.</H2>

    ?#32333;琛屾?#35268;硶2

    鍙?#28598;?#28051;?#26473;拌繍琛岀瓑浠?#27996;?#38171;?/div>
    [adyliu@adyliu-pc jetty8]$ sh run.sh org.eclipse.jetty.xml.XmlConfiguration etc/jetty.xml
    2012-03-28 16:31:16.481:INFO:oejs.Server:jetty-8.1.2.v20120308
    2012-03-28 16:31:16.518:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080

    ?#32333;琛屾?#35268;硶3

    绗?#28051;?#32457;?#37826;规硶灏?#37828;?#28003;?#37922;?#28751;佽濂?#37928;剆tart.jar锛?#26473;?#28051;猨ar鍖?#28751;佽浜?#28051;浜?#29999;?#29785;?#37928;勯?#23943;疆銆?/div>

    鍦?#23534;濮?#28052;嬪墠锛?#37812;?#28000;?#37711;?#38322;嶅懡鍚?#28051;嬮粯璁?#37928;剆tart.ini锛屽洜涓?#27035;?#29825;?#37928;勯?#23943;疆鏂囦欢?#32048;鍚姩涓涓猼est.war鐜?#28583;?#37510;?/div>
    mv start.ini start.ini.default
    [adyliu@adyliu-pc jetty8]$ java -jar start.jar
    2012-03-28 16:35:21.941:INFO:oejs.Server:jetty-8.1.2.v20120308
    2012-03-28 16:35:21.992:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080

    鍙?#28000;?#37930;嬪嚭杩?#28051;?#37826;瑰紡鍜岀涓绉?#37510;?#32471;?#27996;岀瀹?#37711;?#37929;?#37722;?#37510;?/div>
    鍙?#28598;杝tart.jar?#24385;渚?#27996;?#28051;绉?#37721;?#28000;?#37836;?#37930;嬪綋?#22688;?#32333;琛屽?#20635;?#25198;殑鍛?#28000;?#38171;?/div>
    java -jar start.jar --dry-run

    鍙兘杈撳嚭:
    /opt/apps/jdk/bin/java -Djetty.home=/opt/apps/jetty8 -cp /opt/apps/jetty8/resources:\
    /opt/apps/jetty8/lib/jetty-xml-8.1.2.v20120308.jar:/opt/apps/jetty8/lib/servlet-api-3.0.jar:\
    /opt/apps/jetty8/lib/jetty-http-8.1.2.v20120308.jar:/opt/apps/jetty8/lib/jetty-continuation-8.1.2.v20120308.jar:\
    /opt/apps/jetty8/lib/jetty-server-8.1.2.v20120308.jar:/opt/apps/jetty8/lib/jetty-security-8.1.2.v20120308.jar:\
    /opt/apps/jetty8/lib/jetty-servlet-8.1.2.v20120308.jar:/opt/apps/jetty8/lib/jetty-webapp-8.1.2.v20120308.jar:\
    /opt/apps/jetty8/lib/jetty-deploy-8.1.2.v20120308.jar:/opt/apps/jetty8/lib/jetty-servlets-8.1.2.v20120308.jar:\
    /opt/apps/jetty8/lib/jetty-util-8.1.2.v20120308.jar:/opt/apps/jetty8/lib/jetty-io-8.1.2.v20120308.jar \
    org.eclipse.jetty.xml.XmlConfiguration /tmp/start1059041541723976621.properties /opt/apps/jetty8/etc/jetty.xml

    鏈夋剰鎬?#37928;勬槸杩?#38322;?#37832;?#28051;涓?#28051;存?#33333;?#22246;欢锛?tmp/start1059041541723976621.properties锛岄?#23684;潰璁板綍浜?#37813;鏈夌郴缁熷睘鎬?#38171;屼篃灏?#37828;被浼糞ystem.getProperties()銆?/div>
    ?#27342;?#28522;鏄祵鍏ュ紡寮鍙?#38171;?#37722;?#37714;?#37812;?#28000;兘鏄?#37922;╯tart.jar鏉?#37722;姩jetty銆?/div>

    鍛?#28000;?#37721;傛暟

    start.jar?#24385;渚?#27996;嗗ぇ?#22138;鐨?#37721;傛暟鏉?#29840;?#29840;?#37722;姩JVM銆?/div>
    涓嬮潰鍛?#28000;?#37714;楀嚭鎵鏈?#37928;勫懡浠?#29723;屽?#20635;暟锛?/div>
    java -jar start.jar --help

    鐜?#37734;?#38338;?#26864;?#37833;?#27996;?#38171;?#26473;?#27996;?#27035;?#29825;?#37928;?#37721;傛暟?#20824;鏄?#37725;?#37833;?#37928;?#38171;?#28186;嬪锛屽鏋?#37807;虫敼鍙?em>${jetty.home}鍙?#37804;?#37837;?#38171;?/div>
    jetty鍐呴儴榛?#29825;ゆ彁渚?#27996;?#28051;涓?#27035;?#29825;?#37928;勯?#23943;疆鏂囦欢start.config鏉?#29785;?#37712;虫闂?#26864;?#37510;?/div>
    榛?#29825;ゆ儏鍐?#28051;媠tart.jar閲岄潰甯?#37832;?#28051;涓?#27035;?#29825;?#37928;剆tart.config鏂囦欢锛?#26473;?#28051;?#37826;?#28000;舵湁涓浜?#26864;勭疆鐨?#28729;?#28052;?#37510;?/div>
    [adyliu@adyliu-pc jetty8]$ jar tvf start.jar | grep start.config
      8669 Fri Mar 09 00:13:12 CST 2012 org/eclipse/jetty/start/start.config

    start.config
     鏂囦欢鍐?#28729;归潪甯?#28598;?#38171;?#37711;朵腑澶?#38318;ㄥ垎鏄敞閲?#37510;?br />

    start.config鐨勪綔鐢?#37832;?#28000;?#28051;嬪嚑涓?#38171;?/p>

    • 瀹?#28052;塲etty.home灞?#37804;?/li>
    • 瀹?#28052;塲etty鍚姩?#34987;
    • 瀹?#28052;塲etty鍚姩鐨?#27035;?#29825;?#38320;嶇疆鏂囦欢
    • 瀹?#28052;塐PTIONS
    • 鏍规嵁OPTIONS鏉?#28729;?#28052;塩lasspath

    涓?#38344;?#37911;瑰埆?#24385;鍒癘PTIONS銆?#28000;涔?#37828;疧PTIONS锛?/p>

    OPTIONS

    鐢?#27996;巎etty鏄?#26946;?#25652;?#37721;?#28729;氬埗鐨?#38171;屽?#29363;jetty灏?#37722;?#28051;?#22959;?#37735;?#37815;嗗垎鎴?#37722;?#28051;潪甯?#32513;嗗皬鐨勬ā鍧?#37510;?#23011;?#28051;涓?#22959;?#37735;?#38171;堝疄闄?#28051;?#37828;?#28051;涓?#28051;?#37928;刯ar鍖?#38171;?#38171;?#37812;?#28000;?#37721;?#28000;ョ畝鍗?#37928;勭?#23338;嚭鏄?#28051;涓狾PTION銆?#38000;?#23011;?#28051;涓狾PTION?#20824;浼氬?#29808;簲浜?#28729;?#38340;?#37928;刯ar锛?#26473;?#28751;卞喅瀹?#27996;?#26473;?#27996;沯ar鍖?#37828;?#37722;?#38343;瑕佸姞鍏lasspath锛屽苟涓?#37734;╦etty鍚姩鐨勬?#36346;?#37828;?#37722;?#38343;瑕佸仛涓浜?#26864;?#28598;栫殑浜嬫儏銆?/p>

    start.config鏂囦欢鐨?#29831;硶涔熸尯鏈夋剰鎬?#37928;?#37510;?#37824;?#37816;佷竴浜涚畝鍗?#37928;?#38315;?#26440;戝垽鏂?#38171;?#28186;嬪?#20635;枃浠舵槸鍚?#28699;?#37734;?#37510;佸懡浠?#29723;屽?#20635;暟鏄?#37722;?#28699;?#37734;?#32475;?#37510;?/p>

    榛?#29825;ゆ儏鍐?#28051;?#37832;?#28641;?#28051;嬮?#23943;疆锛?/p>

    • path鍙傛?#25198;殑鍊?#37716;?#37711;lasspath
    • lib鍙傛?#25198;殑鍊间綔涓?#37929;綍鎼?#32497;ar鍖?#38171;?#37711;朵腑鐨刯ar/zip鍖?#37716;?#37711;lasspath
    • 榛?#29825;?#37928;?#37722;姩?#34987;鏄痮rg.eclipse.jetty.xml.XmlConfiguration.class锛岄櫎?#28522;瀹?#28052;?#27996;唖tart.class灞?#37804;?/li>
    • 榛?#29825;?#37928;刯etty閰嶇疆鏂?#28000;舵槸$(jetty.home)/etc/jetty.xml锛岄櫎?#28522;浼?#37711;?#37928;?#37721;傛暟涓?#28051;虹┖
    • 榛?#29825;?{jetty.home}鐩綍鏄綋?#22688;鐩綍锛?#28051;?#28051;瀹?#37828;痵tart.jar鎵鍦?#29882;?#23536;?#38171;?#37510;?{jetty.home}灞?#37804;?#37820;?#32497;?#26916;哄簭鏈?#38171;?
      • $(jetty.home) 鍙傛暟鎴?#38000;呯郴缁熷睘鎬?#38171;?#37718;?#37815;?#37916;?#28583;冨?#27200;噺锛?/li>
      • . ?#32139;?#22688;璺?#23536;?/li>
      • .. ?#32139;?#22688;璺?#23536;?#37928;勭埗璺?#23536;?/li>
      • jetty-distribution/src/main/resources ?#32139;?#22688;璺?#23536;?#37928;?#37721;?#29723;岀?#22557;瓙璺?#23536;?/li>
      • ../jetty-distribution/src/main/resources ?#32139;?#22688;璺?#23536;?#37928;勭埗璺?#23536;?#37928;?#37721;?#29723;岀?#22557;瓙璺?#23536;?/li>
    • 榛?#29825;?#37928;刢lasspath鏈?#38171;?
      • resources
      • lib/jetty-xml-8.1.2.v20120308.jar
      • lib/servlet-api-3.0.jar
      • lib/jetty-http-8.1.2.v20120308.jar
      • lib/jetty-continuation-8.1.2.v20120308.jar
      • lib/jetty-server-8.1.2.v20120308.jar
      • lib/jetty-security-8.1.2.v20120308.jar
      • lib/jetty-servlet-8.1.2.v20120308.jar
      • lib/jetty-webapp-8.1.2.v20120308.jar
      • lib/jetty-deploy-8.1.2.v20120308.jar
      • lib/jetty-servlets-8.1.2.v20120308.jar
      • lib/jetty-util-8.1.2.v20120308.jar
      • lib/jetty-io-8.1.2.v20120308.jar

    start.jar鍙傛暟

    鎴?#28000;?#37712;?#37833;?#37930;媠tart.jar鏀?#37816;?#37928;?#37721;傛暟锛?/p>

    [adyliu@adyliu-pc jetty8]# java -jar start.jar --help
    Usage: java -jar start.jar [options] [properties] [configs]

    options

    鍏朵腑options鍒?#29723;?#38171;?#26473;?#37816;?#37928;勬槸鍛?#28000;?#29723;屽?#20635;暟锛?#28051;?#37828;?#22959;?#37735;?#38171;岀?#36776;鍙?#29785;乯etty灏嗗唴缃?#37928;凮PTIONS瀹?#28052;?#28051;烘ā鍧?#28598;氬ソ锛?#37832;?#38171;?/p>

    • --version 鍒楀嚭鐗?#37832;?#37721;?/li>
    • --list-options 鍒楀嚭?#32139;?#22688;start.config鏀?#37816;?#37928;勬墍鏈塐PTIONS
    • --list-config 鍒楀嚭?#32139;?#22688;start.config鍐?#28729;?#38171;?#37826;?#37832;?#37712;?#28729;?#38171;?/li>
    • --dry-run 鍒楀嚭?#32139;?#22688;閰嶇疆瑕?#37722;姩鐨刯ava杩?#32459;嬪?#23678;暣鍙傛暟锛?#28051;?#37722;姩jetty鏈?#37716;?#38171;?/li>
    • --exec 鍚姩?#29913;杩?#32459;?#38171;?#37721;?#37832;?#37722;姩?#29913;杩?#32459;嬫墠?#20824;淇?#37824;?X锛?D绛?#37721;傛暟锛屽洜涓簊tart.jar鏈韩灏?#37828;?#28186;?#38344;爅ava杩?#32459;?#37722;姩鐨?#38171;?#28051;嶈兘鍦ㄨ繍琛屾?#33333;敼鍙?#38171;?/li>
    • --stop 鍋?#23005;㈣繍琛岀殑jetty瀹?#28186;?/li>
    • --daemon 鍚?#37721;拌繍琛宩etty锛?#37722;姩灏唖tdout/stderr璁板綍鍒?{jetty.log}/start.log?#33105;锛堝ソ浜?#38171;?#26473;?#28051;?#37721;橀噺jetty.log?#30149;鏈?#27035;?#29825;?#38320;嶇疆璇存槑锛屼及璁?#37828;?{jetty.home}/logs鐩綍锛?/li>
    • --config=<file> 鎸?#28729;?#37911;瑰埆鐨剆tart.config锛?#28000;?#28186;?#29781;?#37929;栧唴缃?#37928;剆tart.config.(?#31905;杩?#23092;嬭瘯锛屽鏋?#37816;?#28729;?#23005;?#37826;囦欢锛?#38317;?#28052;堝唴缃?#37928;勯?#23943;疆灏?#28051;嶅啀璇?#37721;?#38171;?#26473;?#28725;?#38007;?#36423;呴?#35826;皢鎵鏈?#38320;嶇疆?#21843;鍏?#38171;屽寘鎷琺ainclass/jetty config/OPTIONS绛?#38171;?/li>
    • --ini=<file> 浠庨?#23943;疆鏂囦欢?#33105;瑁?#26462;藉懡浠?#29723;屽?#20635;暟銆?#28051;?#38344;?#37721;傛暟浠?#37721;?#28051;嬮潰?#24385;鍒扮殑鍙傛暟鏄?#37734;?#28598;?#28598;?#38171;屽彲浠?#28000;庨?#23943;疆鏂囦欢?#33105;涓娆?#37804;?#37716;?#26462;?#38171;岄粯璁?#37928;勯?#23943;疆鏂?#28000;舵槸${jetty.home}/start.ini銆?/li>
    • --pre=<file> 鎸?#28729;?#37911;瑰埆鐨刯etty?#32333;琛岄?#23943;疆鏂囦欢锛?#26473;?#28051;?#38320;嶇疆鏂囦欢鍦?#37722;?#38344;㈡彁楂樼殑閰嶇疆鏂囦欢?#22688;闈㈣繍琛?#38171;岀?#31295;綋浜?#37824;?#37721;?#27035;?#29825;?#37928;勮杞?#37832;哄埗銆?/li>

    properties

    灞?#37804;у垎鎴?#28051;?#32457;?#38171;?#28051;绉?#37828;細浼?#38315;掔?#27409;郴缁熷睘鎬?#38171;坖ava.lang.System#getProperty(String)),涓绉?#37721;?#37828;綔涓簀etty鐨?#37722;姩鍙傛暟銆?/p>

    濡?#37835;?#29781;佷紶閫掔?#27409;郴缁熷睘鎬?#38171;屽?#27408;?#29006;紡鏄?#38171;?-Dname=value锛?#37724;宩ava杩?#32459;嬬郴缁熷睘鎬х被浼?#37510;?/p>

    jetty涔?#37832;?#28051;浜?#27035;?#29825;?#37928;勭郴缁熷睘鎬?#38171;?/p>
    灞?#37804;?/th>绫诲瀷鎻?#26473;?/th>
    org.eclipse.jetty.util.log.class class jetty鏃?#36423;?#29825;板綍锛岄粯璁?#28051;?#38171;歰rg.eclipse.jetty.util.log.Slf4jLog
    org.eclipse.jetty.util.log.DEBUG boolean 璋冭瘯鏃?#36423;?#26440;撳嚭鍦?#37826;?#38171;岄粯璁?#28051;簊tderr鍜宩ava鍐?#32515;?#37928;凩ogger锛屽鏋?#37828;?#37711;?#28000;?#37827;?#36423;?#37714;?#38343;瑕佽缃?#28051;簍rue锛岄粯璁?#28051;篺alse
    org.eclipse.jetty.util.log.IGNORED boolean 鏄?#37722;?#29825;板綍涓浜?#36423;界暐鐨勯敊璇?#37827;?#36423;?#38171;岄粯璁?#28051;篺alse
    org.eclipse.jetty.util.log.SOURCE boolean 璁板?#26338;敊璇?#37827;?#36423;?#29723;屽彿锛熶綅缃?#38171;熼粯璁?#28051;篺alse
    com.sun.management.jmxremote   鍚姩jmx绠?#37918;?/td>

    jetty鐨?#37722;姩鍙傛暟灞?#37804;?#38171;屾?#29006;紡鏄?#38171;?name=value锛屾敞?#21104;杩?#38322;屾病鏈?D浜?#37510;?#26473;?#27996;?#37721;傛暟涓嶄細浼?#38315;掔?#27409;郴缁熷睘鎬?#37510;?/p>

    鎵鏈?#37721;傛暟鍒?#29723;?#38171;?/p>

    • path=[directory]: 浼?#38315;?#26864;?#28598;栫殑classpath锛屽弬鑰?#28051;?#38344;?#27035;?#29825;?#37928;剆tart.config閰嶇疆
    • lib=[directory]: 浼?#38315;?#26864;?#28598;朿lasspath鎼?#32497;ar/zip鐨?#37929;綍
    • STOP.PORT=[number]: 鍋?#23005;etty鐨?#32468;?#37721;?#38171;?#26473;?#32459;?#32480;?#37918;?#38171;?/li>
    • STOP.KEY=[alphanumeric]: 鍋?#23005;etty鐨?#28725;嗙爜锛?#26473;?#32459;?#32480;?#37918;?#38171;?/li>
    • DEBUG=true: 鏄?#37722;?#37722;姩璋冭瘯妯″紡锛?#37722;屾椂?#32048;璁?#32515;畂rg.eclipse.jetty.util.log.DEBUG灞?#37804;?#28051;簍rue锛岄粯璁?#28051;篺alse
    • OPTIONS=[option,option...]: OPTION鍒?#29723;?#38171;屼篃灏?#37828;?#29781;?#37722;姩鐨勬ā鍧?#37714;?#29723;?#37510;?/li>

    鍦?#37712;?#32515;?#37928;剆tart.config?#33105;榛?#29825;?#37928;凮PTIONS鍒?#29723;?#37832;?#38171;?/p>

    • All
    • Client
    • Server
    • ajp
    • annotations
    • client
    • default
    • deploy
    • ext
    • jmx
    • jndi
    • jsp
    • jta
    • monitor
    • overlay
    • overlays
    • plus
    • policy
    • resources
    • rewrite
    • security
    • server
    • servlet
    • servlets
    • setuid
    • webapp
    • websocket
    • xml

    configs

    jetty?#32333;琛岄渶瑕佷竴浜?#38320;嶇疆鏂囦欢锛?#26473;?#27996;?#38320;嶇疆鏂囦欢瀵瑰簲浜?#28051;?#37722;岀殑OPTION鎵闇瑕?#37928;勯?#23943;疆銆?/p>

    榛?#29825;?#37928;刯etty閰嶇疆瀛?#37734;ㄩ兘瀛?#37734;?#27996;?{jetty.home}/etc?#33105;锛屾墍鏈?#38320;嶇疆鏂囦欢鍒?#29723;?#37832;?#38171;?/p>

    • etc/jetty-ajp.xml
    • etc/jetty-annotations.xml
    • etc/jetty-bio-ssl.xml
    • etc/jetty-bio.xml
    • etc/jetty-contexts.xml
    • etc/jetty-debug.xml
    • etc/jetty-deploy.xml
    • etc/jetty-fileserver.xml
    • etc/jetty-ipaccess.xml
    • etc/jetty-jmx.xml
    • etc/jetty-logging.xml
    • etc/jetty-monitor.xml
    • etc/jetty-overlay.xml
    • etc/jetty-plus.xml
    • etc/jetty-policy.xml
    • etc/jetty-proxy.xml
    • etc/jetty-requestlog.xml
    • etc/jetty-rewrite.xml
    • etc/jetty-ssl.xml
    • etc/jetty-stats.xml
    • etc/jetty-testrealm.xml
    • etc/jetty-webapps.xml
    • etc/jetty-xinetd.xml
    • etc/jetty.xml

    杩欎?#22557;?#27702;?#23943;疆锛屽浣?#29825;?#23536;椾綇锛?#29831;?#28003;?#37922;?#37725;?#27996;?#38320;嶇疆锛?/p>

    涓?#28051;涓?#32468;犺妭?#33105;浠?#32513;嶉?#23943;疆鏂囦欢銆?br />


    鍙?#38000;?#29863;勬簮锛?br />

    ]]>涓娆$畝鍗曞嵈鑷村懡鐨勯敊璇?/title><link>http://www.5432034.com/xylz/archive/2012/03/15/371966.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Thu, 15 Mar 2012 10:30:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/03/15/371966.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/371966.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/03/15/371966.html#Feedback</comments><slash:comments>16</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/371966.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/371966.html</trackback:ping><description><![CDATA[绾?#28051;?#37832;?#37716;?#37731;?#29840;?#26462;?#26473;?#26946;?#37721;戠敓浜?#37814;ヨ锛?#37722;?#27996;嬫壘鎴戞?#20635;晳銆?br />鎴戠?#23338;埌鏈哄櫒鐨?#29840;?#26462;介兘瓒?#26473;?0浜?#38171;屾煡鐪媕ava杩?#32459;?#32510;?#32459;嬫爤锛屾?#24807;埌浜嗗嚭闂?#26864;樼殑浠g爜銆?br /> <br /> 涓嬮潰鏄?#37711;?#28000;g爜鐗囨锛屽疄闄呮儏鍐?#38335;?#29831;?#28598;勭悊姣?#26473;?#37831;村潖銆?br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">package</span> demo;<br /> <span style="color: #008080; "> 2</span> <br /> <span style="color: #008080; "> 3</span> <span style="color: #0000FF; ">import</span> java.io.BufferedReader;<br /> <span style="color: #008080; "> 4</span> <span style="color: #0000FF; ">import</span> java.io.InputStream;<br /> <span style="color: #008080; "> 5</span> <span style="color: #0000FF; ">import</span> java.io.InputStreamReader;<br /> <span style="color: #008080; "> 6</span> <span style="color: #0000FF; ">import</span> java.net.HttpURLConnection;<br /> <span style="color: #008080; "> 7</span> <span style="color: #0000FF; ">import</span> java.net.URL;<br /> <span style="color: #008080; "> 8</span> <span style="color: #0000FF; ">import</span> java.net.URLConnection;<br /> <span style="color: #008080; "> 9</span> <span style="color: #0000FF; ">import</span> org.apache.commons.lang.StringUtils;<br /> <span style="color: #008080; ">10</span> <br /> <span style="color: #008080; ">11</span> <span style="color: #008000; ">/**</span><span style="color: #008000; "><br /> </span><span style="color: #008080; ">12</span> <span style="color: #008000; "> * </span><span style="color: #808080; ">@author</span><span style="color: #008000; "> adyliu (imxylz#gmail.com)<br /> </span><span style="color: #008080; ">13</span> <span style="color: #008000; "> * </span><span style="color: #808080; ">@since</span><span style="color: #008000; "> 2012-3-15<br /> </span><span style="color: #008080; ">14</span> <span style="color: #008000; "> </span><span style="color: #008000; ">*/</span><br /> <span style="color: #008080; ">15</span> <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> FaultDemo {<br /> <span style="color: #008080; ">16</span> <br /> <span style="color: #008080; ">17</span>     <span style="color: #008000; ">/**</span><span style="color: #008000; "><br /> </span><span style="color: #008080; ">18</span> <span style="color: #008000; ">     * </span><span style="color: #808080; ">@param</span><span style="color: #008000; "> args<br /> </span><span style="color: #008080; ">19</span> <span style="color: #008000; ">     </span><span style="color: #008000; ">*/</span><br /> <span style="color: #008080; ">20</span>     <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">void</span> main(String[] args) <span style="color: #0000FF; ">throws</span> Exception {<br /> <span style="color: #008080; ">21</span>         <span style="color: #0000FF; ">final</span> String tudou = "http://v.youku.com/v_playlist/f17170661o1p9.html";<br /> <span style="color: #008080; ">22</span> <br /> <span style="color: #008080; ">23</span>         URL url = <span style="color: #0000FF; ">new</span> URL(tudou);<br /> <span style="color: #008080; ">24</span>         HttpURLConnection conn = (HttpURLConnection) url.openConnection();<br /> <span style="color: #008080; ">25</span>         conn.connect();<br /> <span style="color: #008080; ">26</span>         <span style="color: #0000FF; ">try</span> {<br /> <span style="color: #008080; ">27</span>             InputStream in = conn.getInputStream();<br /> <span style="color: #008080; ">28</span>             BufferedReader br = <span style="color: #0000FF; ">new</span> BufferedReader(<span style="color: #0000FF; ">new</span> InputStreamReader(in, "utf-8"));<br /> <span style="color: #008080; ">29</span>             StringBuilder buf = <span style="color: #0000FF; ">new</span> StringBuilder();<br /> <span style="color: #008080; ">30</span>             String line = <span style="color: #0000FF; ">null</span>;<br /> <span style="color: #008080; ">31</span>             <span style="color: #0000FF; ">while</span> ((line = br.readLine()) != <span style="color: #0000FF; ">null</span>) {<br /> <span style="color: #008080; ">32</span>                 <span style="color: #0000FF; ">if</span> (StringUtils.isNotEmpty(buf.toString())) {<br /> <span style="color: #008080; ">33</span>                     buf.append("\r\n");<br /> <span style="color: #008080; ">34</span>                 }<br /> <span style="color: #008080; ">35</span>                 buf.append(line);<br /> <span style="color: #008080; ">36</span>             }<br /> <span style="color: #008080; ">37</span>             <span style="color: #008000; ">//</span><span style="color: #008000; ">do something with 'buf'</span><span style="color: #008000; "><br /> </span><span style="color: #008080; ">38</span> <span style="color: #008000; "></span><br /> <span style="color: #008080; ">39</span>         } <span style="color: #0000FF; ">finally</span> {<br /> <span style="color: #008080; ">40</span>             conn.disconnect();<br /> <span style="color: #008080; ">41</span>         }<br /> <span style="color: #008080; ">42</span> <br /> <span style="color: #008080; ">43</span>     }<br /> <span style="color: #008080; ">44</span> <br /> <span style="color: #008080; ">45</span> }<br /> <span style="color: #008080; ">46</span> </div> <br /> 鎬?#38000;?#28051;?#38171;?#26473;欐浠g爜鏈?#28000;涔?strong style="background-color: yellow; ">鑷村懡</strong>闂?#26864;?#28052;?#38171;?#38171;?#26473;?#38322;?#28051;嶈?#30028;┒涓氬姟閫?#26440;戝?#21229;悊鐨勬纭?#37804;?#28000;?#37721;?#32513;嗗皬鐨勭?#26336;柕锛?br /> .<br /> ..<br /> ...<br /> 鐜?#37734;?#37733;?#37833;?#37510;?br /> 鎴?#37721;戠?#25198;嚎绋嬫爤閲岄潰鐨勭嚎绋嬮兘RUNNABLE鍦?2琛?#37510;?br /> 杩?#28051;琛岀湅璧?#37833;?#37832;?#28000;涔?#38338;?#26864;?#37723;?#38171;烻tringBuilder.toString()涓?#37828;?#26462;?#37817;?#37812;怱tring涔?#38171;烝pache commons-lang閲岄潰鐨凷tringUtils.isNotEmpty浣?#37922;?#28052;熸病闂?#26864;?#37727;?#38171;?br /> 鐪?#28000;g爜锛?#27996;哄鐨?#38315;?#26440;?#37711;?#28729;?#37828;?#37714;?#37826;?#37828;?#37722;?#37828;?#32471;?#28051;琛?#38171;屽鏋?#28051;?#37828;?#32471;?#28051;琛?#38317;?#28052;堝氨澧?#37716;?#28051;涓?#37817;?#29723;岀銆?br /> <br /> 鏃?#37906;禖PU鍦?#26473;?#38322;岃繍琛?#38171;?#38317;?#28052;堝氨璇存槑杩?#28051;?#37734;?#37826;?#28051;瀹氬瓨鍦ㄩ潪甯?#38000;?#29840;笴PU鐨勬?#23940;綔锛屽鑷碈PU?#28522;甯哥?#20344;繖锛?#28000;?#38000;岀郴缁?#29840;?#26462;?#26473;?#26946;?#37510;?br /> 鐪嬭缁嗗爢鏍?#38171;?#37711;?#28729;濩PU鍦?#26473;?#29723;屽唴瀛樼殑鎷?#29840;濆姩?#32148;銆?br /> 鐪?#28051;嬮潰鐨勬簮?#29212;銆?br /> <em style="color: #0000ff; ">java.lang.StringBuilder.toString()</em><br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #0000FF; ">public</span> String toString() {<br />         <span style="color: #008000; ">//</span><span style="color: #008000; "> Create a copy, don't share the array</span><span style="color: #008000; "><br /> </span>    <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">new</span> String(value, 0, count);<br />     }</div> 鎺ョ潃鐪媕ava.lang.String鐨?#37835;?#38315;犲?#33445;暟锛?br /> <div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; border-image: initial; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #0000FF; ">public</span> String(<span style="color: #0000FF; ">char</span> value[], <span style="color: #0000FF; ">int</span> offset, <span style="color: #0000FF; ">int</span> count) {<br />         <span style="color: #0000FF; ">if</span> (offset < 0) {<br />             <span style="color: #0000FF; ">throw</span> <span style="color: #0000FF; ">new</span> StringIndexOutOfBoundsException(offset);<br />         }<br />         <span style="color: #0000FF; ">if</span> (count < 0) {<br />             <span style="color: #0000FF; ">throw</span> <span style="color: #0000FF; ">new</span> StringIndexOutOfBoundsException(count);<br />         }<br />         <span style="color: #008000; ">//</span><span style="color: #008000; "> Note: offset or count might be near -1>>>1.</span><span style="color: #008000; "><br /> </span>        <span style="color: #0000FF; ">if</span> (offset > value.length - count) {<br />             <span style="color: #0000FF; ">throw</span> <span style="color: #0000FF; ">new</span> StringIndexOutOfBoundsException(offset + count);<br />         }<br />         <span style="color: #0000FF; ">this</span>.offset = 0;<br />         <span style="color: #0000FF; ">this</span>.count = count;<br />         <span style="color: #0000FF; ">this</span>.value = Arrays.copyOfRange(value, offset, offset+count);<br />     }</div> <br /> 鐪嬪嚭鏉?#27996;嗕箞锛?br /> 闂?#26864;樼殑鍏?#38335;?#37734;?#27996;嶴tring鏋?#38315;犲?#33445;?#25198;?#21228;渶鍚?#28051;琛?#38171;寁alue?#33503;涓?#37828;?#37929;存帴鎸?#37722;戠殑锛?#38000;?#37828;?#38322;嶆柊鐢?#37812;?#27996;?#28051;涓柊鐨勫?#26947;涓?#38171;屼娇鐢ㄧ郴缁?#37815;?#29840;濆?#33445;暟杩?#29723;屽唴瀛?#28598;嶅埗銆?br /> <div><em style="color: #0000ff; ">java.util.Arrays.copyOfRange(char[], int, int)</em></div> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">char</span>[] copyOfRange(<span style="color: #0000FF; ">char</span>[] original, <span style="color: #0000FF; ">int</span> from, <span style="color: #0000FF; ">int</span> to) {<br />         <span style="color: #0000FF; ">int</span> newLength = to - from;<br />         <span style="color: #0000FF; ">if</span> (newLength < 0)<br />             <span style="color: #0000FF; ">throw</span> <span style="color: #0000FF; ">new</span> IllegalArgumentException(from + " > " + to);<br />         <span style="color: #0000FF; ">char</span>[] copy = <span style="color: #0000FF; ">new</span> <span style="color: #0000FF; ">char</span>[newLength];<br />         System.arraycopy(original, from, copy, 0,<br />                          Math.min(original.length - from, newLength));<br />         <span style="color: #0000FF; ">return</span> copy;<br />     }</div> <br /> 濂?#27996;?#38171;屽?#23941;洖澶?#37930;嬮?#26440;?#28000;g爜32琛?#37510;?br /> <div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; border-image: initial; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">if</span> (StringUtils.isNotEmpty(buf.toString())) {<br />     buf.append("\r\n");<br /> }</div> 杩?#38322;?#37832;?#38338;?#26864;樼殑鍦?#37826;?#37734;?#27996;?#23011;?#23046;?#23536;?#37916;?#28051;琛岀?#21228;?#36346;欓兘鐢?#37812;?#28051;涓柊鐨勫?#26947;涓?#37510;?#28052;?#28751;?#37828;?#29831;村鏋淗TTP杩?#37733;?#37928;勭粨鏋滆緭鍏?#23092;佷腑鏈?000琛岀殑璇?#38171;屽皢棰?#28598;栫敓鎴?000涓?#28699;楃涓?#38171;?#28051;嶇畻StringBuilder鎵?#28729;?#37922;?#37812;?#37928;?#28051;暟锛?#37510;?#23011;?#28051;涓?#28699;楃涓?#26473;?#23011;斿墠涓涓?#28699;楃涓?#28598;?#37510;?br /> <br /> <br /> 鎴?#28000;?#37833;ュ仛涓涓畝鍗?#37928;勬?#23341;瘯锛?#37812;?#28000;?#37734;?#37720;熸潵鐨?#28000;?#37934;佷笂澧?#37716;犲嚑琛?#29825;℃暟浠g爜銆?br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #0000FF; ">int</span> lines =0;<br />     <span style="color: #0000FF; ">int</span> count = 0;<br />     <span style="color: #0000FF; ">int</span> malloc = 0;<br />     <span style="color: #0000FF; ">while</span> ((line = br.readLine()) != <span style="color: #0000FF; ">null</span>) {<br />         lines++;<br />         count+=line.length();<br />         malloc += count;<br />         <span style="color: #0000FF; ">if</span> (StringUtils.isNotEmpty(buf.toString())) {<br />             buf.append("\r\n");<br />         }<br />         buf.append(line);<br />     }<br />     System.out.println(lines+" -> "+count+" -> "+malloc);</div> 鎴?#28000;?#29825;板綍涓?#29723;屾暟lines浠?#37721;?#26864;?#28598;?#37721;戠敓鐨勫?#26947;涓?#37815;?#29840;?#28598;?#28751;弇alloc銆?br /> 杩?#37828;?#28051;娆?#26440;撳嚭鐨勭粨鏋?#37510;?br /> <div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; border-image: initial; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->1169 -> 66958 -> 39356387</div> 涔?#28751;?#37828;?169琛岀?#21229;綉椤?#38171;?#28051;鍏?#37828;?6958瀛楄妭锛?5KB锛?#38171;岀粨鏋滈澶栫敓鎴?#37928;勫唴瀛?#28598;?#28751;?#38171;?#28051;嶇畻StringBuilder鎵?#28729;瑰崰鐢?#37928;勫唴瀛?#28598;?#28751;?#38171;?#28051;?9356387瀛楄妭锛?7.5MB)!!!<br /> ?#30255;?#20802;涓涓?#38171;孋PU涓鐩?#26864;戠?#20343;簬杩?#29723;屽唴瀛樺垎閰?#38171;?#37832;哄櫒鐨?#29840;?#26462;借兘涓?#26946;?#28052;?#38171;?#37812;?#28000;?#32510;?#28051;?#37832;?#37716;?#37731;?#37828;?涓狢PU 16鏍?#38171;屽唴瀛?4G鐨凴edhat Enterprise Linux 5.5锛?#29840;?#26462;藉眳鐒惰?#24807;埌?#22161;鍗?#37510;?#26473;?#26473;?#37828;?#37721;?#37832;?#29825;?#38338;噺寰堜?#24227;?#21228;?#36346;?#37510;?#26473;?#28751;?#38341;?#37804;?#37832;?#37716;?#26864;戠?#20344;畷鏈?#27996;?#37510;?br /> <br /> 浜嬪疄涓?#37812;?#28000;?#37832;夐潪甯?#28729;屽杽鍜?#28051;?#28725;岀殑?#29056;浜嶢pache commons-httpclient鐨?#28751;佽锛屾?#23940;綔璧?#37833;?#28052;熼潪甯哥畝鍗?#37510;傚浜?#26473;?#32457;嶇畝鍗?#37928;?#29831;?#23033;?#38171;屽彧闇瑕佷竴?#28527;鍛?#28000;?#28751;?#29785;?#37712;?#27996;?#37510;?br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->String platform.utils.HttpClientUtils.getResponse(String)<br /> String platform.utils.HttpClientUtils.postResponse(String, Map<String, String>)</div> <br /> 鍗充娇?#28522;瑕佽嚜閫?#26462;瓙锛屽?#21229;悊杩?#32457;嶇畝鍗?#37928;勮緭鍏?#23092;佸彲浠?#28003;?#37922;?#28051;嬮潰鐨?#28000;g爜锛屽氨鍙?#28000;?#23536;堝ソ鐨勮В鍐?#38338;?#26864;?#37510;?br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    InputStream in = <img src="http://www.5432034.com/Images/dot.gif" alt="" /><br />     ByteArrayOutputStream baos = <span style="color: #0000FF; ">new</span> ByteArrayOutputStream(8192);<br />     <span style="color: #0000FF; ">int</span> len = -1;<br />     <span style="color: #0000FF; ">byte</span>[] b = <span style="color: #0000FF; ">new</span> <span style="color: #0000FF; ">byte</span>[8192];<span style="color: #008000; ">//</span><span style="color: #008000; ">8k</span><span style="color: #008000; "><br /> </span>    <span style="color: #0000FF; ">while</span> ((len = in.read(b)) > 0) {<br />         baos.write(b, 0, len);<br />     }<br />     baos.close();<span style="color: #008000; ">//</span><span style="color: #008000; ">ignore is ok</span><span style="color: #008000; "><br /> </span>    String response =  <span style="color: #0000FF; ">new</span> String(baos.toByteArray(), encoding);</div> <br /> ?#32139;鐒?#27996;?#38171;?#37832;鍚庣揣鎬?#28598;勭悊绾?#28051;?#38338;?#26864;?#37832;蹇?#37928;勬?#29808;紡灏?#37828;?#28751;?#37832;?#38338;?#26864;樼殑浠g爜绋嶅井鍙?#38315;?#28051;嬪嵆鍙?#37510;?br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->    <span style="color: #0000FF; ">if</span> (<strong style="background-color: yellow; ">buf.length() > 0</strong>) {<br />         buf.append("\r\n");<br />     }</div> <br /> <br /> 杩?#28051;?#38338;?#26864;橀潪甯哥畝鍗?#38171;屽彧鏄兂琛?#26440;惧嚑涓?#29785;傜偣锛?br /> <ul> <li>鍥?#38339;?#37831;?#38343;瑕?#37722;堜綔锛屾?#22796;収瑙勮寖鏉?#26473;?#29723;?#37510;傝嚜閫?#26462;瓙涓?#37828;?#28051;?#37721;?#28000;?#38171;屼絾鏄?#37922;熶骇鐜?#28583;冭繕鏄?#29781;侀檺浜庤嚜?#32321;鐔熸倝鐨勬?#29808;紡銆?/li> <li>鍗充娇?#28522;甯哥畝鍗?#37928;?#28000;g爜锛屼篃鏈?#37721;兘鏈?#38007;村懡鐨勯櫡闃?#37734;?#38322;岄潰銆傚杽浜?#37804;?#38000;冩墠鏄?#37916;嬮亾銆?/li> <li>瀛?#28052;?#23534;?#31790;鐨?#28000;?#37934;佸拰甯?#29785;勬?#29882;?#38171;屽涔?#29785;?#37712;?#38338;?#26864;樼殑甯?#29785;勫?#27693;硶銆?#26473;?#28051;?#38338;?#26864;?#37711;?#28729;為潪甯哥畝鍗?#38171;岀?#29112;?#22798;緭鍏?#26440;撳嚭娴?#37928;?#27996;洪潪甯?#37908;?#32513;冨氨?#20824;瑙?#37712;?#38338;?#26864;?#37510;?/li> </ul><img src ="http://www.5432034.com/xylz/aggbug/371966.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-03-15 18:30 <a href="http://www.5432034.com/xylz/archive/2012/03/15/371966.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>[?#32321;鍏?#23092;呭嚭Jetty 03]?#30045;鍗?#37928;凴ESTful鍏?#38338;?/title><link>http://www.5432034.com/xylz/archive/2012/03/09/371598.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Fri, 09 Mar 2012 09:52:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/03/09/371598.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/371598.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/03/09/371598.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/371598.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/371598.html</trackback:ping><description><![CDATA[鑰佸疄璇存湰鏉?#26473;?#37828;?#28051;绡囩畝鍗?#37928;凴ESTful鐨?#37711;?#38338;╠emo锛?#37724;宩etty鏃?#37711;?#38171;屼絾鏄?#28051;?#27996;?#37826;?#28186;?#38171;岀敤鍒?#27996;唈etty鐨刴aven鎻掍欢銆傚?#22794;媺寮?#23534;?#32480;?#37828;?#37724;宩etty鏈?#37711;?#37722;?#37510;?br /> <br /> 椤?#37929;?#37734;板潃锛?a href="https://github.com/adyliu/jetty-rest-demo">https://github.com/adyliu/jetty-rest-demo</a> <br /> <br /> <h2>鏂囦欢鍒?#29723;?/h2> <br /> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; ">鍖?#37722;?#28641;?#28051;?#37826;囦欢锛?/p> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; "> <li>git蹇界暐鏂囦欢</li> <li>README鏂囦欢</li> <li>pom鏂囦欢</li> <li>涓涓畝鍗?#37928;凜ontroller鏂囦欢</li> <li>涓涓猯og4j鐨勯?#23943;疆鏂囦欢</li> <li>涓涓畝鍗?#37928;剆pring mvc閰嶇疆</li> <li>涓涓畝鍗?#37928;剋eb.xml</li> </ul> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; "></div> <h2>Maven閰嶇疆</h2>涓?#27996;嗚兘澶熸柟渚?#28000;巎etty:run鏉?#37722;姩web瀹瑰櫒锛屼娇鐢╦etty鐨刴aven鎻掍欢銆?br />闇瑕?#37911;瑰埆?#25950;?#21104;鐨勬槸锛?#28000;巎etty7.5.3寮濮嬪氨蹇呴』鐢╩aven 3浜?#38171;?#28000;ュ墠浣?#37922;?#37928;刴aven 2涓嶈兘浣?#37922;?#27996;?#38171;屽氨涓?#27996;?#26473;?#38338;?#26864;?#38171;?#37812;戣?#29115;釜浜嗗?#22556;箙锛屽ぇ鍥?#37510;?br />杩?#38322;屼娇鐢╦etty鏈?#26570;鐨刴aven鎻掍欢锛?#37722;屾牱?#32048;鍚姩鏈?#26570;鐨刯etty8.1.1 鏉?#23092;嬭瘯銆?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><build><br />     <plugins><br />         <plugin><br />             <groupId>org.mortbay.jetty</groupId><br />             <artifactId>jetty-maven-plugin</artifactId><br />             <version>8.1.1.v20120215</version><br />         </plugin><br />     </plugins><br /> </build></div> <h2>web.xml</h2>杩?#37828;?#28051;涓畝鍗?#37928;剋eb.xml閰嶇疆锛?#28051;?#29781;侀?#23943;疆spring servlet銆傚綋鐒惰繖閲屼?#29115;緟鍔?#38320;嶇疆浜?#28051;涓猯og4j锛屾柟渚?#37836;?#37930;?#37827;?#36423;?#26440;撳嚭锛?#28051;嶉?#23943;疆涔熸病鍏崇郴銆?br />鍙?#28598;?#28052;熸病鏈?#28003;?#37922;╯ervlet 3.0鐨勯?#23943;疆銆?br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><?</span><span style="color: #FF00FF; ">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000FF; ">?></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">web-app </span><span style="color: #FF0000; ">xmlns</span><span style="color: #0000FF; ">="http://java.sun.com/xml/ns/j2ee"</span><span style="color: #FF0000; "> xmlns:xsi</span><span style="color: #0000FF; ">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #FF0000; "><br />    xsi:schemaLocation</span><span style="color: #0000FF; ">="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"</span><span style="color: #FF0000; "><br />    version</span><span style="color: #0000FF; ">="2.4"</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">display-name</span><span style="color: #0000FF; ">></span>jetty-rest-demo<span style="color: #0000FF; "></</span><span style="color: #800000; ">display-name</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">context-param</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">param-name</span><span style="color: #0000FF; ">></span>log4jConfigLocation<span style="color: #0000FF; "></</span><span style="color: #800000; ">param-name</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">param-value</span><span style="color: #0000FF; ">></span>classpath:log4j.properties<span style="color: #0000FF; "></</span><span style="color: #800000; ">param-value</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">context-param</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">listener</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">listener-class</span><span style="color: #0000FF; ">></span>org.springframework.web.util.Log4jConfigListener<span style="color: #0000FF; "></</span><span style="color: #800000; ">listener-class</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">listener</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">servlet</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">servlet-name</span><span style="color: #0000FF; ">></span>dispatcher<span style="color: #0000FF; "></</span><span style="color: #800000; ">servlet-name</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">servlet-class</span><span style="color: #0000FF; ">></span>org.springframework.web.servlet.DispatcherServlet<span style="color: #0000FF; "></</span><span style="color: #800000; ">servlet-class</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">load-on-startup</span><span style="color: #0000FF; ">></span>1<span style="color: #0000FF; "></</span><span style="color: #800000; ">load-on-startup</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">servlet</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">servlet-mapping</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">servlet-name</span><span style="color: #0000FF; ">></span>dispatcher<span style="color: #0000FF; "></</span><span style="color: #800000; ">servlet-name</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">url-pattern</span><span style="color: #0000FF; ">></span>/*<span style="color: #0000FF; "></</span><span style="color: #800000; ">url-pattern</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">servlet-mapping</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "></</span><span style="color: #800000; ">web-app</span><span style="color: #0000FF; ">></span></div><h2>dispatcher-servlet.xml</h2>鎺?#28051;?#37833;?#37828;痵pring mvc鐨勯?#23943;疆銆?br />鍖?#37722;?#28051;?#38318;ㄥ垎锛?#29781;佹壂鎻?#37928;?#28003;?#29785;?#37718;?#38171;宮vc?#25950;瑙?#26937;卞姩浠?#37721;妀sp鐨勬?#21449;煋鏄?#28751;?#38171;?#37711;?#28729;?#26473;?#28051;?#28186;嬪瓙?#33105;?#30149;鏈?#37922;?#37714;?#38171;?#37510;?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><?</span><span style="color: #FF00FF; ">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000FF; ">?></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">beans </span><span style="color: #FF0000; ">xmlns</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/beans"</span><span style="color: #FF0000; "> xmlns:xsi</span><span style="color: #0000FF; ">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #FF0000; "><br />    xmlns:context</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/context"</span><span style="color: #FF0000; "> xmlns:mvc</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/mvc"</span><span style="color: #FF0000; "><br />    xsi:schemaLocation</span><span style="color: #0000FF; ">="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd<br />            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd<br />            http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">context:component-scan </span><span style="color: #FF0000; ">base-package</span><span style="color: #0000FF; ">="info.imxylz.study.jetty.rest"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">mvc:annotation-driven </span><span style="color: #0000FF; ">/></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">bean </span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="org.springframework.web.servlet.view.InternalResourceViewResolver"</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="prefix"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="/WEB-INF/pages/"</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">property</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="suffix"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">=".jsp"</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">property</span><span style="color: #0000FF; ">></span><br />        <span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="viewClass"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="org.springframework.web.servlet.view.JstlView"</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">property</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">bean</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "></</span><span style="color: #800000; ">beans</span><span style="color: #0000FF; ">></span></div><br /><h2>Controller</h2>涓?#26462;?#23534;濮嬪啓绗?#28051;涓狢ontroller锛屽綋鐒惰繖涓狢ontroller绋嶅井鏈?#28051;?#20579;?#20579;?#22470;鎵?#37510;?br />鐩存帴杩?#37733;?#28699;楃涓?#38171;屽彟澶?#28751;?#32497;?#23534;曢〉鏄?#28751;?#37714;?#28051;涓?#28699;楃涓?#28051;?#37510;?#38171;堜篃涓嶅?#36891;腑鏂?#26473;?#29723;屽?#21229;悊锛?br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">package</span> info.imxylz.study.jetty.rest.controller;<br /><br /><span style="color: #0000FF; ">import</span> org.springframework.stereotype.Controller;<br /><span style="color: #0000FF; ">import</span> org.springframework.web.bind.annotation.PathVariable;<br /><span style="color: #0000FF; ">import</span> org.springframework.web.bind.annotation.RequestMapping;<br /><span style="color: #0000FF; ">import</span> org.springframework.web.bind.annotation.ResponseBody;<br /><br /><span style="color: #008000; ">/**</span><span style="color: #008000; "><br /> * a rest demo (spring 3.x)<br /> * <br /> * </span><span style="color: #808080; ">@author</span><span style="color: #008000; "> adyliu (imxylz@gmail.com)<br /> * </span><span style="color: #808080; ">@since</span><span style="color: #008000; "> 2012-3-9<br /> </span><span style="color: #008000; ">*/</span><br />@Controller<br /><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> DemoController {<br /><br />    @ResponseBody<br />    @RequestMapping("/index/{name}/")<br />    <span style="color: #0000FF; ">public</span> String index(@PathVariable("name") String name) {<br />        <span style="color: #0000FF; ">return</span> "Welcome, " + name;<br />    }<br />    @ResponseBody<br />    @RequestMapping("")<br />    <span style="color: #0000FF; ">public</span> String index() {<br />        <span style="color: #0000FF; ">return</span> "This is a rest demo";<br />    }<br />}</div><br /><h2>Access</h2>鐜?#37734;?#29831;?#37828;?#37813;?#23534;娴?#29785;堝櫒鏄剧ず涓?#27996;?#37510;?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->http://localhost:8080/index/Ady/<br />http://localhost:8080/index/Ady%20Liu/<br />http://localhost:8080/</div><br />濂?#27996;?#38171;?#26473;?#32480;?#37828;?#28051;涓?#37832;?#30045;鍗?#37928;?#37711;?#38338;?#28186;嬪瓙浜?#37510;?br />涓嬮潰鐨?#37721;?#38000;?#29863;勬簮?#33105;鏈塯it鐨勬簮?#29212;銆?br /><div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; "></div> <h2>Resources</h2> <ul style="margin-top: 0px; margin-bottom: 0px; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; "> <li>Source code: git@github.com:adyliu/jetty-rest-demo.git (branch: v1.0-helloworld)</li> <li>Jetty Maven Plugin: <a href="http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin" rel="nofollow" style="text-decoration: none; ">http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin</a></li> <li>Spring MVC: <a href="http://static.springsource.org/spring/docs/3.1.1.RELEASE/spring-framework-reference/html/mvc.html" rel="nofollow" style="text-decoration: none; ">http://static.springsource.org/spring/docs/3.1.1.RELEASE/spring-framework-reference/html/mvc.html</a></li> </ul><img src ="http://www.5432034.com/xylz/aggbug/371598.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-03-09 17:52 <a href="http://www.5432034.com/xylz/archive/2012/03/09/371598.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>ICE Mini Guidehttp://www.5432034.com/xylz/archive/2012/02/29/370971.htmlimxylzimxylzWed, 29 Feb 2012 02:44:00 GMThttp://www.5432034.com/xylz/archive/2012/02/29/370971.htmlhttp://www.5432034.com/xylz/comments/370971.htmlhttp://www.5432034.com/xylz/archive/2012/02/29/370971.html#Feedback0http://www.5432034.com/xylz/comments/commentRss/370971.htmlhttp://www.5432034.com/xylz/services/trackbacks/370971.htmlICE?#33105;闂翠欢銆?br />
    ICE?#32148;涓?#28051;涓?#23534;?#37835;勫钩鍙?#38171;屾彁渚?#27996;?#26946;?#37804;ц兘鐨凴PC瑙?#37712;虫?#35268;銆?#37711;?#39582;存寚瀹?#37928;?#37835;?#37835;?#29825;?#37714;掍腑灏?#37828;?#28751;?#37916;?#37832;?#37928;勫?#21620;儴閫?#29825;?#37826;瑰紡杩?#32457;诲埌ICE+Protocol Buffers鐨勭粍鍚?#37826;规?#22556;腑銆?br /> 鎴?#28000;?#28751;?#37721;兘鐨?#37714;?#37922;?a href="http://zookeeper.apache.org/" target="_blank">Zookeeper鐨勯?#23943;疆绠?#37918;?#38171;屽垱寤?#37831;?#38315;?#37828;庣殑瀹?#37812;?#32468;?#28000;?#37918;?#38171;?#37722;屾椂涔?#37828;?#38340;?#28003;?#23534;鍙戠殑闅惧害銆?br /> 鎴?#28000;?#37809;?#37809;?#28751;濊瘯锛屽?#32472;壘鏇?#38315;?#37722;?#37812;?#28000;?#37928;勫垎甯冨紡閫?#29825;腑闂翠欢銆?br />
    涓嬮潰鐨凷lide鏄?#28051;绡囩畝鐭?#37928;?#37711;?#38338;?#28000;?#32513;?#37510;?#37929;墠涓烘锛?#37812;?#28000;?#37928;?#23534;鍙?#26473;?#37828;?#28000;呴檺浜嶫ava璇?#29815;鐨勬湇鍔?#32468;?#37510;?#28000;?#37722;?#29785;嗘儏鍐垫彁渚?#28051;浜?#37711;?#28729;冭瑷鐨勬湇鍔?#32468;?#37722;?#37510;?br /> 鍏?#38335;?#28699;?#38171;欼CE "The Internet Communications Engine" RPC "Protocol Buffers"

    ]]>鎼滅嫄鎶鏈?#38318;?#38336;?#37832;?#37815;涜仒Java宸?#32459;?#29999;?楂樼骇宸?#32459;?#29999;?鍒濈骇鏋?#37835;?#29999;?椤?#37929;粡鐞?鎶鏈?#28051;?#32480;?/title><link>http://www.5432034.com/xylz/archive/2012/02/16/366663.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Thu, 16 Feb 2012 03:10:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/02/16/366663.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/366663.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/02/16/366663.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/366663.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/366663.html</trackback:ping><description><![CDATA[<div><span style="font-size: 12pt; ">涓氬姟鍙戝?#26338;渶瑕?#38171;屽浜烘墠鐨勬?#23384;湜锛屽浜?#28051;?#37928;?#26473;?#23033;?#38171;屾?#28357;嫄鎶鏈?#38318;?#38343;瑕佷竴浜?#26946;樼骇浜烘墠銆?/span><br /> <span style="font-size: 12pt; "> 浠?#39582;寸ぞ鎷?#37716;?#37716;?#28051;嶅啀鎷?#27996;庡舰?#32033;锛屽彧瑕?#37828;?#27996;烘墠锛屽?#23678;柟鏈夋剰鎰?#37928;?#38171;?#37812;?#28000;兘鍔?#37716;?#37720;?#27996;?#37721;?#37510;?/span><br /> <br /> <span style="font-size: 12pt; ">鍖椾含鍦扮偣锛?#37718;椾含 浜旈亾鍙?/span><br /> <span style="font-size: 12pt; ">宸ヤ綔?#31905;楠?#38171;?#28051;嶉檺锛屽簲灞?#37922;熼兘鍙?#28000;?#38171;?#37812;?#28000;?#37832;?#23480;ヤ綔鍗佸?#32736;互涓?#37928;?#27996;烘墠锛屼篃闇瑕佽繖绉?#27996;烘墠銆?/span><br /> <span style="font-size: 12pt; "> 寰呴亣鏂?#38344;?#38171;氬姫鍔涜窡涓?#37911;?#28000;?#37928;勬?#26449;钩銆?#29999;?#29785;?#37734;?0K~30K銆?/span><br /> <span style="font-size: 12pt; "> 鎶鏈?#29781;佹眰锛?#28000;ava璇?#29815;涓?#28051;?#38171;?#29781;佹?#20634;?#29808;熀鏈?#37928;勬妧鏈?#37510;佹?#20634;康銆?#37918;?#29825;?#37510;佹鏋堕兘闇瑕?#37832;?#28051;瀹?#37928;勬繁搴?#37510;傛?#35268;嵁?#31905;楠?#38171;?#28000;?#28000;?#37828;?#38344;?#36423;芥偁鍜岄」鐩暟?#22138;鏄?#28051;?#29723;岀殑銆?/span><br /> <span style="font-size: 12pt; "> ?#39559;鍝佽?#20345;眰锛?#29781;佹?#20634;涓?#23092;?#37928;?#27996;?#38001;旂綉?#39559;鍝侀兘鏈?#29825;?#29831;?#38171;屽鐢?#37812;?#28003;撻獙鏈?#28051;瀹?#37928;勭悊瑙?#37510;傚浜庨潪搴?#28766;?#37922;?#38171;?#37812;?#28000;?#37831;村亸閲?#27996;庣敤浜?#38001;旂綉鎶鏈粡楠?#38171;?#28051;?#37828;?#28028;佷笟WEB?#37108;缁熸柟闈?#38171;?#37510;?/span><br /> <span style="font-size: 12pt; "> 鎵╁睍瑕佹眰锛?#29781;佹眰鏈塯mail/twitter/stackoverflow/github甯?#37721;?#37510;?#37832;?#23534;?#31790;璐?#37914;?#37928;勭?#29808;埆鑰冭檻銆?/span><br /> <span style="font-size: 12pt; "> 鍒涙柊瑕佹眰锛氳兘澶熸?#23678;彙python/ruby/perl/Erlang绛?#28051;涓?#32457;嶈剼鏈?#29831;?#29815;涓?#28003;?#37510;?/span><br /> <span style="font-size: 12pt; "> 宸ヤ綔棰嗗煙锛?#37812;?#28000;?#37832;夋寫鎴樼殑棰嗗煙鏈?#28598;?#29785;勬ā?#26271;鎹?#38342;嗙兢銆?#26946;?#37804;ц兘寮傛閫?#29825;?#37510;?#23092;烽噺?#26271;鎹?#28598;勭悊銆佸垎甯冨紡瀛樺偍涓庣紦瀛?#37510;佸苟琛?#29825;?#32480;?#37510;?#26946;樺苟鍙戝?#21229;悊绛?#37510;?/span><br /> <br /> <br /> <span style="font-size: 12pt; ">鎴?#28000;?#23046;?#26473;?#37832;?#36423;?#37722;?#27996;?#27996;?#38001;旂?#25120;殑鍚屽鍔?#37711;?#37510;?#37814;鏈?#29781;佹眰涓?#26946;?#38171;屼絾瑕?#37832;?#37804;濇兂銆?#37832;夋繁搴?#37510;佺儹鐖?#27996;?#38001;旂綉銆?/span><br /> <span style="font-size: 12pt; ">鏈?#37711;磋叮鍙?#38315;佺畝鍘嗗埌锛?/span><span style="font-size: 12pt; color: #ff0000; "><strong>宸?#26473;?#37832;?/strong></span><br /> <br /> <br /> <span style="font-size: 12pt; ">鎴?#28000;?#38336;?#37832;?#37815;涜仒杩欑被浜烘墠锛屽彧瑕?#37828;?#27996;烘墠锛?#37812;?#28000;兘鎰挎剰?#24385;渚?#37929;?#38315;傚簲鐨勭幆澧?#37510;?br /><strong>鍙?#28598;?#38171;屼篃?#28522;甯?#38343;瑕佷竴涓墠绔?#28051;?#32480;?#38171;?#29840;?#29840;?#32480;?#37918;?#37825;翠釜鍥?#38339;?#37928;勫墠绔?#37814;鏈?#27996;烘墠鍜屽熀纭鏋?#37835;?#37510;?/strong><br /><strike>銆?#37832;鍚?#37831;存柊鏃?#38338;?#38171;?012/11/01銆?br /></strike><br /></span></div><img src ="http://www.5432034.com/xylz/aggbug/366663.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-02-16 11:10 <a href="http://www.5432034.com/xylz/archive/2012/02/16/366663.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Spring Framework 3.1 Reference CHMhttp://www.5432034.com/xylz/archive/2012/02/08/369608.htmlimxylzimxylzWed, 08 Feb 2012 08:41:00 GMThttp://www.5432034.com/xylz/archive/2012/02/08/369608.htmlhttp://www.5432034.com/xylz/comments/369608.htmlhttp://www.5432034.com/xylz/archive/2012/02/08/369608.html#Feedback1http://www.5432034.com/xylz/comments/commentRss/369608.htmlhttp://www.5432034.com/xylz/services/trackbacks/369608.html
    鍘绘帀浜?#37721;戠?#29116;敊璇?#37928;刯avascript锛堢?#25120;粶鍘熷洜锛屼?#29363;噦鐨?#38171;?#38171;岀储寮?#37818;?#25652;?#38322;嶅懡鍚?#38171;?#32459;嶅井鎺?#37911;?#27996;?#28051;?#37510;?br />
    ?#30149;鏈?#37824;瑰姩浠?#28003;曞唴瀹?#37510;?strong style="font-family: 'Comic Sans MS'; font-size: 14pt; color: #0000ff; ">姣?#37827;犵枒闂?#38171;?#26473;?#37828;?#38011;?#37826;?#37911;?#37928;?#38171;屽洜涓烘病鏈?#27996;?#32520;?#29831;?#37510;?/strong>

    鎴?#37733;惧涓?#37510;?br />

    Spring Framework 3.1 Reference CHM
    SpringFramework3.1-Reference_en.chm

    ]]>[?#32321;鍏?#23092;呭嚭Jetty 02] Jetty 8.x ?#30045;鍗曡瘯鐢?/title><link>http://www.5432034.com/xylz/archive/2012/01/29/368970.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Sun, 29 Jan 2012 08:41:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2012/01/29/368970.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/368970.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2012/01/29/368970.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/368970.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/368970.html</trackback:ping><description><![CDATA[<h1>Jetty 8.x ?#30045;鍗曡瘯鐢?/h1><h2>?#32333;琛?/h2><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">瀹夎濂?#27996;?#28000;?#37722;?#38171;屽湪jetty鐨?#28051;?#37929;綍涓?#38171;岃繍琛?#29863;?#37833;?#37510;?/p><pre style="font-size: 1.2em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin-top: 2px; margin-bottom: 2px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-color: initial; border-image: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f9f9f9; overflow-x: auto; overflow-y: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-right: 2px; margin-left: 2px; ">java -jar start.jar </pre><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">濡?#37835;?#28000;旂粏鐪?#37928;?#29831;?#26473;?#37832;?#28051;涓猻tart.ini锛?#26473;?#37828;?#37711;?#37736;?#37928;別clipse鍚姩鏂瑰紡銆?#27996;嬪疄涓妀etty8鏄?#37816;夌収eclipse鐨凮SGI鍚姩妯?#37736;?#37833;ヨ繍琛岀殑銆?/p><div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div><h2>杩?#32459;嬭闂?/h2><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">榛?#29825;ゆ儏鍐?#28051;媕etty浣?#37922;?080绔?#37721;?#38171;?#29825;?#38338;?#28051;?#37930;?#37930;?#37510;?/p><pre style="font-size: 1.2em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin-top: 2px; margin-bottom: 2px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-color: initial; border-image: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f9f9f9; overflow-x: auto; overflow-y: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; margin-right: 2px; margin-left: 2px; ">http://adyliu-pc:8080 </pre><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#22189;鐜?#27996;嗙偣闂?#26864;?#37510;?#37722;姩鍚庡眳鐒舵槸jetty7鍚庣?#21228;弿杩?#28103;℃伅銆?#37930;?#37833;etty8鍙?#29999;?#37928;勬?#36346;?#23011;旇緝绮楃硻锛?#26473;?#27996;?#32513;嗚妭?#20824;?#30149;鏈?#28598;勭?#21975;ソ銆?#27996;嬪疄涓?#38171;屽畼鏂?#32468;欑偣涓?#37928;勬枃绔犻兘鏄?#37724;宩etty7.x鏈?#37711;?#37928;?#38171;屾病鏈?#37831;存柊鍒?.x鐗?#37832;?#37510;?br /><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty01.png" width="949" height="391" alt="" /><br /></p><p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">濂?#37734;?#37832;?#28051;琛屾彁绀?#29831;?#38171;屽鏋?#29781;佽繙绋嬭闂?#37928;?#29831;?#38171;岄渶瑕佸紑鍚?#28051;涓?#29825;?#32515;?#37510;傚ソ鍚?#38171;屾?#22796;収璇存槑锛屽皢榛?#29825;est.war鐨?#26473;?#32459;嬭闂?#22959;″紡鎵?#23534;銆?淇?#37824;规?#22246;欢$JETTY_HOME/contexts/test.d/override-web.xml?#33105;鐨勫涓嬮儴?#22414;<br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->  <span style="color: #0000FF; "><</span><span style="color: #800000; ">filter</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">filter-name</span><span style="color: #0000FF; ">></span>TestFilter<span style="color: #0000FF; "></</span><span style="color: #800000; ">filter-name</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">filter-class</span><span style="color: #0000FF; ">></span>com.acme.TestFilter<span style="color: #0000FF; "></</span><span style="color: #800000; ">filter-class</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "><</span><span style="color: #800000; ">init-param</span><span style="color: #0000FF; ">></span><br />      <span style="color: #0000FF; "><</span><span style="color: #800000; ">param-name</span><span style="color: #0000FF; ">></span>remote<span style="color: #0000FF; "></</span><span style="color: #800000; ">param-name</span><span style="color: #0000FF; ">></span><br />      <span style="color: #0000FF; "><</span><span style="color: #800000; ">param-value</span><span style="color: #0000FF; ">></span>true<span style="color: #0000FF; "></</span><span style="color: #800000; ">param-value</span><span style="color: #0000FF; ">></span><br />    <span style="color: #0000FF; "></</span><span style="color: #800000; ">init-param</span><span style="color: #0000FF; ">></span><br />  <span style="color: #0000FF; "></</span><span style="color: #800000; ">filter</span><span style="color: #0000FF; ">></span></div><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br />杩?#38322;屽?#33580;粡灏?#27035;?#29825;emote鐨勫睘鎬?#37706;糵alse鏀?#28051;?#27996;唗rue銆?#37906;?#37722;庡?#23944;瘯?#30255;銆?/p><div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div><div style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty02.png" width="959" height="485" alt="" /></div><p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鏄?#37906;?#38171;?#26473;欐牱灏?#23480;茬粡鏀?#37816;佽繙绋嬭闂?#27996;?#37510;?/p><div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div><h2>Servlet璁?#38338;?/h2><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">test.war妯?#37735;?#38322;岄潰鏈?#28051;涓猟ump鐨凷ervlet锛屽?#20904;彲浠?#37836;?#37930;嬪綋?#22688;璇?#23033;?#37928;凴equest/Session/Cookie淇℃伅銆?#37812;?#28000;畝鍗?#37930;?#28051;涓婻equest璇?#23033;?#37510;?br /><br /></p><div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div><div style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty03.png" width="900" height="609" alt="" /></div><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">杩?#38322;岄潰鐨勪俊?#20229;?#28522;甯?#28051;?#28725;?#38171;?#26473;?#28051;?#28000;?#37722;庤?#20909;瘯?#32139;?#22688;璇?#23033;?#28103;℃伅?#24385;渚?#27996;嗗緢鏂?#28186;?#37928;勬牱渚?#37510;?/p><div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div><h2>Comet妯?#37736;?/h2><p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">Jetty8.x閲岄潰鏈?#28051;?#32457;峜omet妯?#37736;?#38171;?#28051;绉?#37828;?#29999;?#29785;?#37928;?#38336;?#26473;?#37818;?Long Polling), 鍙?#28051;绉嶅氨鏄疕TML5鏀?#37816;?#37928;刉ebSocket妯?#37736;?#37510;?/p><p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鎴?#28000;?#37711;堟潵?#30045;鍗?#37930;?#28051;涓婰ong Polling妯?#37736;?#37510;?#37734;?#26473;?#32457;?#37826;瑰紡涓?#38171;?#23092;?#29785;堝櫒瀹?#37827;?#37721;?#29863;?#28051;涓?#38336;?#26473;?#37818;?#38171;岀瓑寰?#37832;?#37716;?#37731;?#26473;?#37733;?#37510;?#28051;娆?#29831;?#23033;?#28729;?#27996;?#28000;?#37722;?#28000;嶇?#26421;細鍙?#29863;?#28051;涓柊鐨?#29831;?#23033;?#38171;?#37804;?#37828;?#37832;?#28051;涓?#26473;?#37818;?#28103;?#37816;佸?#23678;柟鐨?#38315;?#29825;?#37510;?涓嬪浘鎻?#26473;?#27996;?#23005;ゆ晥鏋?#37510;?br /><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty-long-polling.png" width="717" height="505" alt="" /><br /></p><p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鑰學ebSocket妯?#37736;?#37828;?#37906;?#28051;?#37828;?#37813;鏈?#23092;?#29785;堝櫒?#20824;鏀?#37816;?#37928;?#37510;?#26946;樼増鏈?#37928;凜hrome灏?#37824;?#37816;?#38171;?#23011;?#28641;?#37812;戠殑chrome 18.0鐨?#23534;鍙戠増鏈?#28751;辫兘寰堝ソ鐨勬敮鎸乄ebSocket銆?br /><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty-websocket.png" width="721" height="380" alt="" /><br /></p><p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鏈夋剰鎬?#37928;勬槸锛?#26473;?#38322;岀殑璇?#23033;傚ご鍜屽?#23941;簲澶存湁涓浜?#37911;规畩鐨勬爣璇?#37510;?#28000;?#37722;庢秹鍙?#37714;皐ebsocket鐨勬?#36346;欏啀鏉?#37934;旂┒銆?br /><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty-websocket-headers.png" width="622" height="341" alt="" /><br /></p><p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#31905;娴嬭瘯锛?#37812;?#37832;哄櫒涓?#37928;刢hrome 18.0,firefox 8.0?#20824;鏀?#37816;亀ebsocket鐨?#38171;?#38000;孖E9浠嶇劧涓?#37824;?#37816;?#37510;?br /><br /><img src="http://www.5432034.com/images/blogjava_net/xylz/jetty-firefox.png" alt="" /><br /></p><img src ="http://www.5432034.com/xylz/aggbug/368970.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2012-01-29 16:41 <a href="http://www.5432034.com/xylz/archive/2012/01/29/368970.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>[?#32321;鍏?#23092;呭嚭Jetty 01] Jetty 8.x 瀹夎http://www.5432034.com/xylz/archive/2012/01/29/368969.htmlimxylzimxylzSun, 29 Jan 2012 08:34:00 GMThttp://www.5432034.com/xylz/archive/2012/01/29/368969.htmlhttp://www.5432034.com/xylz/comments/368969.htmlhttp://www.5432034.com/xylz/archive/2012/01/29/368969.html#Feedback0http://www.5432034.com/xylz/comments/commentRss/368969.htmlhttp://www.5432034.com/xylz/services/trackbacks/368969.htmlJetty浠?.x宸茬粡杩?#32457;诲埌eclipse涓?#27996;?#38171;?#28000;巈clipse鐨?#28051;?#26462;?#37929;綍寮濮嬪?#22798;鍚?#37510;?/p>

    鏈?#26570;鐨?#37721;?#29999;?#37911;?#37832;?#37828;?.1.0.v20120127锛?#37812;?#28000;?#28000;?#26473;?#28051;?#37911;?#37832;?#23534;濮?#37510;?br />

    JETTY_VERSION=8.1.0.v20120127
    wget http://download.eclipse.org/jetty/$JETTY_VERSION/dist/jetty-distribution-$JETTY_VERSION.tar.gz
    tar xfz jetty-distribution-$JETTY_VERSION.tar.gz
    cd jetty-distribution-$JETTY_VERSION
    java -jar start.jar

    闄勫綍



    ]]>?#32321;鍏?#23092;呭嚭 Java Concurrency (40): ?#33503;鍙?#37804;?#32513;?part 4 鎬ц兘涓庝几缂?#37804;?/title><link>http://www.5432034.com/xylz/archive/2011/12/31/367641.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Sat, 31 Dec 2011 06:13:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2011/12/31/367641.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/367641.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2011/12/31/367641.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/367641.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/367641.html</trackback:ping><description><![CDATA[<h1>鎬ц兘涓庝几缂?#37804;?/h1> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">浣?#37922;?#32510;?#32459;?#37928;?#28051;绉?#29831;存硶鏄?#28051;?#27996;嗘彁楂?#37804;ц兘銆傚?#27697;嚎绋?#37721;?#28000;?#28003;?#32459;嬪簭鍏呭垎鍒?#37922;?#38338;茬疆鐨?#29863;勬簮锛屾彁楂?#29863;勬簮鐨?#37714;?#37922;?#37916;?#38171;?#37722;屾?#24816;兘澶熷苟琛屽?#21229;悊浠诲姟锛屾彁楂樼郴缁?#37928;?#37725;嶅簲鎬?#37510;?浣?#37828;?#23536;?#37828;?#37906;?#38171;屽紩鍏?#32510;?#32459;?#37928;?#37722;屾椂涔?#23534;?#37711;?#27996;嗙郴缁?#37928;?#28598;?#37833;?#37804;?#37510;?#37721;?#28598;栫郴缁?#37928;勬ц兘?#33503;涓?#37828;?#37804;?#37828;?#38341;忕潃绾?#32459;嬫?#25198;殑澧?#37716;?#38000;?#37804;?#37828;彁楂?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>鎬ц兘涓庝几缂?#37804;?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鎬ц兘鐨勬彁鍗?#38315;?#29999;告剰鍛崇潃鍙?#28000;?#37922;?#37831;?#28751;戠殑璧勬?#24876;仛鏇?#28598;?#37928;?#27996;嬫儏銆?#26473;?#38322;?#29863;勬簮鏄?#37718;?#37815;?#37812;?#28000;?#29999;?#29831;?#37928;凜PU鍛?#37832;?#37510;佸唴瀛?#37510;?#32515;戠粶甯?#28729;?#37510;佺鐩業O銆佹暟鎹?#25652;?#37510;乄EB鏈?#37716;?#32475;?#32475;?#37510;?寮?#37711;?#28598;氱嚎绋?#37721;?#28000;?#37711;呭垎鍒?#37922;?#28598;?#37837;?#37928;勪紭鍔?#38171;?#37711;呭垎鍒?#37922;↖O闃诲甯?#37833;?#37928;勫欢杩?#38171;屼篃鍙?#28000;?#38340;?#28003;庣?#25120;粶寮閿甯?#37833;?#37928;勫奖鍝?#38171;?#28000;?#38000;屾彁楂?#37719;曚綅鏃?#38338;村唴鐨?#37725;嶅簲?#26213;鐜?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涓?#27996;嗘彁楂?#37804;ц兘锛岄渶瑕?#37832;夋晥鐨?#37714;?#37922;?#37812;?#28000;?#37916;?#37832;?#37928;?#28598;勭悊璧勬簮锛?#37722;屾椂涔?#29781;佸紑鎷撴柊鐨?#37721;?#37922;?#29863;勬簮銆?#28186;嬪锛屽浜嶤PU鑰岃█锛岀悊?#20802;鐘跺喌涓?#29999;?#37832;汣PU?#20824;澶熸弧璐熻嵎宸ヤ綔銆傚綋鐒惰繖閲屾弧璐熻嵎宸ヤ綔鏄?#37816;囧仛鏈?#37922;?#37928;?#27996;嬫儏锛?#38000;?#28051;?#37828;?#37827;?#29835;?#37928;勬?#35826;惊鐜?#37812;?#38000;?#32475;?#23536;?#37510;?#37721;楅檺浜嶤PU鐨?#29825;?#32480;楄兘鍔?#38171;屽鏋淐PU杈惧埌浜?#37835;侀檺锛?#38317;?#28052;堝緢鏄?#37906;舵垜浠?#37711;呭垎鍒?#37922;?#27996;?#29825;?#32480;楄兘鍔?#37510;傚浜嶪O鑰岃█锛堝唴瀛?#37510;佺鐩?#37510;?#32515;戠粶绛?#38171;?#38171;屽鏋滆?#24807;埌浜?#37711;跺浜庣殑甯?#28729;?#38171;?#26473;?#27996;涜?#21228;簮鐨?#37714;?#37922;?#37916;?#28052;?#28751;?#28051;?#37720;?#27996;?#37510;?#37918;嗘兂鐘跺喌涓?#37813;鏈?#29863;勬簮鐨勮兘鍔涢兘琚?#37922;?#28729;?#27996;?#38171;?#38317;?#28052;?#26473;?#28051;郴缁?#37928;勬ц兘杈惧埌浜?#37832;澶?#37706;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涓?#27996;?#29723;¢噺?#37108;缁?#37928;勬ц兘锛?#37832;?#28051;浜?#37816;囨爣鐢?#27996;?#28729;?#37804;?#37510;佸畾?#22138;鐨勫垎鏋?#37510;?#28186;嬪鏈?#37716;?#37827;?#38338;?#37510;?#32475;?#23536;呮椂闂?#37510;?#37722;?#37722;愰噺銆佹晥鐜?#37510;佸彲浼?#32514;?#37804;?#37510;?#37922;?#37812;愰噺绛?#32475;?#37510;?#37832;?#37716;?#37827;?#38338;?#37510;?#32475;?#23536;呮椂闂?#32475;?#37922;?#27996;?#29723;¢噺?#37108;缁?#37928;勬晥鐜?#38171;屽嵆鍒?#25652;?#37832;?#28598;氬揩銆?#37722;?#37722;愰噺銆?#37922;?#37812;愰噺绛?#37922;?#27996;?#29723;¢噺?#37108;缁?#37928;?#28729;归噺锛屽嵆?#20824;澶?#28598;勭?#21975;?#27692;?#25118;暟鎹?#37510;傞櫎姝?#28052;嬪锛?#37832;夋晥鏈?#37716;?#37827;?#38338;?#37510;佷腑鏂?#37827;?#38338;?#32475;?#37922;?#27996;庤兘鍔涚郴缁?#37928;?#37721;?#38344;?#37804;?#37724;?#32459;?#28729;?#37804;?#32475;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍙?#28028;?#32514;?#37804;?#37928;勬剰鎬?#37828;?#37816;?#28583;?#37716;?#29825;?#32480;?#29863;勬簮锛?#37722;?#37722;愰噺鍜岀?#29110;骇?#22138;鐩?#25652;?#23536;?#37714;扮?#21228;敼杩?#37510;?浠庣畻?#30838;鐨勮搴?#29825;?#38171;岄?#29999;?#37922;?#28598;?#37833;傚害鏉?#29723;¢噺鍏跺?#29808;簲鐨勬ц兘銆?#28186;嬪鏃?#38338;?#28598;?#37833;傚害銆?#32460;?#38338;?#28598;?#37833;傚害绛?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>Amdahl瀹氬緥</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#33503;琛岀殑浠诲姟澧?#37716;?#29863;勬簮鏄?#37906;惰兘澶熸彁楂?#37804;ц兘锛屼絾鏄?#28641;?#37835;?#37828;?#28051;?#29723;岀殑浠诲姟锛屽鍔?#29863;勬?#24876;苟涓?#28051;瀹氳兘澶?#23536;?#37714;?#37722;堢悊鐨勬ц兘?#24385;鍗?#37510;?nbsp;<a href="http://en.wikipedia.org/wiki/Amdahl%27s_law" rel="nofollow" style="text-decoration: none; ">Amdahl瀹氬緥</a>鎻?#26473;扮殑鍦?#28051;涓郴缁熶腑锛屽鍔?#28598;勭?#21975;櫒璧勬?#24876;?#22317;郴缁?#29723;岀?#21228;彁鍗?#23011;旂巼銆??#20131;瀹?#37734;?#28051;涓郴缁熶腑锛孎鏄?#36423;呴』涓?#29723;屽寲鎵?#29723;岀?#21228;瘮閲?#38171;孨鏄?#28598;勭?#21975;櫒璧勬簮锛?#38317;?#28052;?#38341;忕潃N鐨?#28583;?#37716;?#37832;澶氬鍔?#37928;?#37716;?#38315;?#23011;?#38171;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <div style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><img src="http://www.5432034.com/images/blogjava_net/xylz/amdahl.png" width="200" height="71" alt="" /></div> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鐞?#29825;?#28051;?#38171;屽綋N瓒嬭繎浜?#37827;犵┓澶?#37827;?#38171;屽姞閫?#23011;?#37832;澶?#37706;?#37827;犻檺瓒嬭繎浜?/F銆?杩欐剰鍛崇潃濡?#37835;?#28051;涓?#32459;嬪簭鐨?#28051;?#29723;屽寲姣?#38322;?#28051;?0%锛?#38317;?#28052;堝苟琛屽寲鍚?#37832;澶?#37716;?#38315;?#23011;?#28051;?鍊?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍔?#38315;?#23011;旈櫎浜?#37721;?#28000;?#37922;?#27996;?#37716;?#38315;?#37928;勬?#26050;巼澶?#38171;屼篃鍙?#28000;?#37922;?#27996;?#29723;¢噺CPU璧勬簮鐨?#37714;?#37922;?#37916;?#37510;傚鏋?#23011;?#28051;涓狢PU鐨?#29863;勬?#24876;埄鐢?#37916;?#28051;?00%锛?#38317;?#28052;圕PU鐨?#29863;勬簮姣?#23046;?#32520;诲?#37827;?#38171;屽姞閫?#23011;?#28052;熷簲璇?#32520;诲?#37510;?浜嬪疄涓?#38171;屽湪鎷?#37832;?0涓?#28598;勭?#21975;櫒鐨勭郴缁熶腑锛?#32459;嬪?#24531;鏋?#37832;?0%鏄?#28051;?#29723;屽?#26667;殑锛?#38317;?#28052;?#37832;澶?#37721;?#28000;?#37716;?#38315;?/(0.1+(1-0.1)/10)=5.3鍊?#38171;屾崲鍙?#29831;?#29831;碈PU鐨?#37714;?#37922;?#37916;?#37721;?#37922;?.3/10=53%銆?#38000;屽鏋?#28598;勭?#21975;櫒澧?#37716;?#37714;?00鍊?#38171;?#38317;?#28052;堝姞閫?#23011;?#28051;?.2鍊?#38171;屼篃灏?#37828;?#29831;碈PU鐨?#37714;?#37922;?#37916;?#37721;?#37832;?#28051;?.3%銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鏄?#37906;?#28583;?#37716;燙PU鐨勬暟?#22138;?#33503;涓嶈兘?#24385;楂楥PU鐨?#37714;?#37922;?#37916;?#37510;?#28051;嬪浘鎻?#26473;扮?#21228;槸闅忕潃CPU鐨勬暟?#22138;澧?#37716;?#38171;?#28051;?#37722;?#28051;?#29723;屽寲姣?#38322;?#37928;勭郴缁?#37928;?#37716;?#38315;?#23011;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <div style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><img src="http://www.5432034.com/images/blogjava_net/xylz/utilization.png" width="495" height="306" alt="" /></div> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">寰?#37828;?#37906;?#38171;?#28051;?#29723;?#23011;?#38322;嶈秺澶?#38171;屽鍔燙PU璧勬簮鐨勬晥鏋?#29906;?#28051;?#37828;?#37828;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>鎬ц兘?#24385;鍗?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鎬ц兘鐨勬彁鍗?#37721;?#28000;?#28000;?#28000;?#28051;嬪嚑涓?#37826;?#38344;?#37711;?#37813;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>?#37108;缁熷钩鍙扮殑璧勬?#24876;埄鐢?#37916;?/h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涓涓?#32459;嬪簭瀵圭郴缁熷钩鍙扮殑璧勬?#24876;埄鐢?#37916;?#37828;?#37816;囨煇涓涓?#29825;惧?#22249;?#20344;繖涓?#37832;?#37716;?#27996;?#23005;?#32459;嬪簭鐨勬椂闂?#37719;犳墍鏈?#37827;?#38338;?#37928;勬?#26050;巼銆?#28000;庣墿鐞嗗鐨勮搴?#29825;茬被浼?#27996;?#37832;?#37922;?#37716;?#37928;勬?#26050;巼銆傜畝鍗?#37928;?#29831;?#28751;?#37828;?#38171;?#29863;勬?#24876;埄鐢?#37916;?鏈夋?#22562;?#20344;繖鏃?#38338;?鎬?#38000;?#29840;规椂闂?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涔?#28751;?#29831;?#28751;?#37721;兘鐨?#29825;?#29825;惧?#22247;仛鏈?#37922;?#37928;?#37716;?#38171;?#37722;屾?#33333;Θ鍙?#37711;舵渶澶?#37706;?#37510;?#37827;?#37922;?#37928;?#23536;?#37916;?#37721;兘浼氬鑷碈PU 100%鐨?#28003;?#37922;?#37916;?#38171;屼絾涓?#28051;瀹?#37828;?#37832;夋晥鐨?#23480;ヤ綔銆?#37832;夋晥鎬?#38315;?#29999;?#38341;?#28000;?#29723;¢噺锛岄?#29999;?#37721;兘浠?#28051;?#29785;傛潵璇勪及锛?#37812;?#38000;呴?#26473;囪浼?#37718;栫殑绋嬪簭鐨?#29723;?#28051;烘潵鍒?#37826;?#37828;?#37722;︽彁楂?#27996;?#37832;夋晥鎬?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>?#27426;杩?/h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#27426;杩熸弿杩扮?#21228;槸瀹?#37812;?#28000;诲姟鎵鑰?#29840;?#37928;勬椂闂?#37510;傚欢杩?#37832;?#37827;跺欎篃鎴?#28051;哄?#23941;簲鏃?#38338;?#37510;傚鏋?#37832;?#28598;?#28051;苟琛岀?#21228;?#23940;綔锛?#38317;?#28052;堝欢杩?#37721;栧喅浜?#38000;?#29840;规椂闂存渶澶?#37928;?#28000;诲姟銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>澶氬?#21229;悊</h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">澶氬?#21229;悊鏄?#37816;?#37734;?#37719;?#28051;?#37108;缁?#28051;?#37722;屾?#33333;墽琛屽涓?#26473;?#32459;?#37812;?#38000;?#28598;?#28051;?#32459;嬪簭鐨勮兘鍔?#37510;傚?#27692;?#21229;悊?#20824;鍔?#37928;勫ソ澶勬槸鍙?#28000;ユ彁楂?#37722;?#37722;愰噺銆傚?#27692;?#21229;悊鍙?#28000;?#37832;夋?#22557;埄鐢?#28598;?#37837;窩PU鐨?#29863;勬簮銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>澶氱嚎绋?/h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">澶氱嚎绋嬫弿杩扮?#21228;槸鍚?#28051;涓?#37734;板潃绌?#38338;村唴鍚屾?#33333;墽琛屽涓?#32510;?#32459;?#37928;?#26473;?#32459;?#37510;?#26473;?#27996;?#32510;?#32459;嬮兘鏈?#28051;?#37722;岀?#21228;墽琛?#29882;?#23536;?#37724;?#28051;?#37722;岀?#21228;爤缁?#37835;?#37510;?#37812;?#28000;?#29831;?#37928;勫苟鍙?#37804;?#37831;?#28598;?#37928;勬槸鎸?#38333;堝?#22317;嚎绋?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>?#33503;鍙?#37804;?/h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍚屾?#33333;墽琛屽涓?#32459;嬪簭鎴?#38000;?#28000;诲姟绉?#28052;?#28051;哄苟鍙?#37510;傚崟绋嬪?#24531;唴鐨?#28598;?#28000;诲姟澶勭悊鎴?#38000;?#28598;?#32459;嬪簭闂?#37928;?#28598;?#28000;诲姟澶勭悊?#20824;璁?#28051;?#37828;苟鍙?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>鍚?#37722;愰噺</h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍚?#37722;愰噺琛¢噺?#37108;缁?#37734;?#37719;曚綅涔?#38338;村唴鍙?#28000;?#28729;?#37812;?#37928;?#23480;ヤ綔鎬婚噺銆傚浜庣‖?#27426;?#37108;缁?#38000;岃█锛?#37722;?#37722;愰噺鏄?#37911;?#37918;?#28000;?#29840;?#37928;?#28051;婇檺銆?#37734;ㄦ病鏈夎?#24807;?#25198;墿鐞?#28000;?#29840;?#28052;嬪墠锛屾彁楂樼郴缁?#37928;?#37722;?#37722;愰噺涔?#37721;?#28000;?#28598;?#39582;?#25652;?#37824;?#26473;?#37804;ц兘銆?#37722;屾椂鍚?#37722;愰噺涔?#37828;?#29723;¢噺鎬ц兘鐨?#28051;涓?#37816;囨爣銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>鐡堕</h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">绋嬪?#24538;繍琛?#26473;?#32459;嬩腑鎬ц兘鏈宸?#37928;?#37734;?#37826;?#37510;?#38315;?#29999;?#38000;岃█锛?#28051;?#29723;岀殑IO銆佺鐩業O銆佸唴瀛?#37719;?#37711;冨垎閰?#37510;?#32515;戠?#28122;O绛夐兘鍙兘閫?#37812;愮?#22549;銆傛煇浜?#28003;?#37922;?#28598;?#26864;戠箒鐨勭畻?#30838;涔?#37832;?#37721;兘鎴?#28051;虹?#22549;銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>鍙?#37813;╁睍鎬?/h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">杩?#38322;岀殑鍙?#37813;╁睍鎬?#28051;?#29781;?#37828;?#37816;?#32459;嬪簭鎴栫郴缁?#38315;?#26473;?#28583;?#37716;?#37721;?#28003;?#37922;?#37928;?#29863;勬簮鑰屽鍔?#37804;ц兘鐨勮兘鍔?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>绾?#32459;嬪紑閿</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#20131;璁?#23534;?#37711;?#37928;?#28598;氱嚎绋嬮兘鐢?#27996;?#29825;?#32480;?#38171;?#38317;?#28052;?#37804;ц兘涓瀹氫細鏈?#23536;堝ぇ鐨勬彁鍗?#28052;?#38171;?鍏?#28729;?#23534;?#37711;?#28598;氱嚎绋?#28000;?#37722;庝篃?#32048;寮?#37711;?#37831;?#28598;?#37928;?#23534;閿銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>鍒?#37817;?#28051;?#28051;?#37826;?/h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">濡?#37835;?#37721;繍琛岀?#21229;嚎绋嬫暟澶?#27996;嶤PU鐨勫?#21614;?#21578;暟锛?#38317;?#28052;圤S?#32048;鏍规嵁涓瀹?#37928;勮?#20904;害绠楁硶锛屽己琛屽垏鎹?#23005;?#37734;ㄨ繍琛岀?#21229;嚎绋?#38171;?#28000;?#38000;屼娇鍏?#28729;冪嚎绋嬭兘澶?#28003;?#37922;–PU鍛?#37832;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍒?#37817;?#32510;?#32459;?#28028;氬鑷翠笂涓?#37826;?#37714;?#37817;?#37510;傜嚎绋?#37928;勮?#20904;害浼氬鑷碈PU闇瑕佸湪鎿嶄綔?#37108;缁?#37724;?#26473;?#32459;?#38338;磋姳璐?#37831;?#28598;?#37928;勬椂闂?#37911;囨锛?#26473;欐牱鐪熸鎵?#29723;屽簲鐢?#32459;嬪簭鐨勬椂闂?#28751;卞噺灏?#27996;?#37510;?#37721;?#28598;?#28051;?#28051;?#37826;?#37714;?#37817;?#28052;?#28028;氬鑷?#32514;?#28699;樼殑棰戠?#20349;?#28056;嚭锛屽浜?#28051;涓?#37714;氳鍒?#37817;?#37928;勭嚎绋?#37833;?#29831;?#38171;屽彲?#20824;鐢?#27996;?#26946;?#38315;?#32514;?#37712;蹭腑?#30149;鏈夋暟鎹?#38000;屽彉寰?#37831;存參锛?#28000;?#38000;屽鑷?#37831;?#28598;?#37928;処O寮閿銆?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>鍐?#28699;?#37722;屾</h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涓?#37722;岀嚎绋?#38338;?#29781;佽繘琛屾暟鎹?#37722;屾锛宻ynchronized浠?#37721;妚olatile?#24385;渚?#37928;?#37721;?#29785;?#37804;ч兘浼氬鑷?#32514;?#28699;?#28598;辨晥銆傜嚎绋嬫?#22556;箣闂?#37928;勬暟鎹?#29781;佸拰涓诲瓨杩?#29723;?#37722;屾锛?#26473;?#27996;?#37722;屾鏈?#28051;浜?#28751;?#28751;?#37928;?#23534;閿銆傚鏋?#32510;?#32459;?#38338;?#37722;屾?#24816;?#20349;繘琛屾暟鎹?#37722;屾锛?#38317;?#28052;?#26473;?#27996;?#37722;屾鐨勭嚎绋?#37721;兘?#20824;?#32048;鍙?#38339;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h3>闃诲</h3> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#32139;鍙戠?#29116;攣绔?#27996;?#37827;?#38171;屽け璐?#37928;勭嚎绋?#28028;氬鑷?#38339;诲銆?#38315;?#29999;?#38339;诲鐨勭嚎绋?#37721;兘鍦↗VM鍐呴儴杩?#29723;岃嚜鏃?#32475;?#23536;?#38171;?#37812;?#38000;呰鎿嶄綔?#37108;缁熸寕璧?#37510;傝嚜鏃?#32475;?#23536;?#37721;兘浼氬鑷?#37831;?#28598;?#37928;凜PU鍒?#37911;?#23092;?#29840;?#38171;?#38000;屾?#23940;綔?#37108;缁熸寕璧?#37714;欎?#27692;鑷?#37831;?#28598;?#37928;?#28051;?#28051;?#37826;?#37714;?#37817;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">浜?#29785;?#27996;?#37804;ц兘鐨勬彁鍗?#37928;勫嚑涓?#37826;?#38344;?#38171;屼篃浜?#29785;?#37804;ц兘鐨?#23534;閿鍚?#38171;屽簲鐢?#32459;嬪簭灏?#29781;佹?#35268;嵁瀹?#38340;?#37928;?#37734;烘櫙杩?#29723;屽彇鑸?#37724;?#29831;勪及銆傛病鏈?#28051;鍔虫案閫?#37928;勪紭鍖?#37826;规锛?#28051;?#37826;?#37928;?#26473;?#29723;屽?#24538;?#20904;?#23384;敼杩?#37724;岃皟鏁存槸?#24385;楂?#37804;ц兘鐨勬湁鏁堟?#23339;銆傚綋?#22688;涓浜?#28598;?#37928;?#37835;?#37835;勮皟鏁翠篃浼氬鑷磋?#20904;ぇ鐨勬ц兘鐨勬彁鍗?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#30045;鍗?#37928;?#37720;?#37714;?#37828;?#37734;?#28103;?#29831;侀?#26440;戞纭?#37928;勬儏鍐靛皬锛屾?#24807;埌鎬?#38003;界?#22549;锛屽皬姝?#37824;?#26473;?#37724;屼紭鍖?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>鍙?#38000;?#29863;勬枡</h2> <ul style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "> <li>Amdahl's law: <a href="http://en.wikipedia.org/wiki/Amdahl%27s_law" rel="nofollow" style="text-decoration: none; ">http://en.wikipedia.org/wiki/Amdahl%27s_law</a></li> <li>Gustafson's law: <a href="http://en.wikipedia.org/wiki/Gustafson%27s_law" rel="nofollow" style="text-decoration: none; ">http://en.wikipedia.org/wiki/Gustafson%27s_law</a></li> <li>Sun-Ni law: <a href="http://en.wikipedia.org/wiki/Sun-Ni_law" rel="nofollow" style="text-decoration: none; ">http://en.wikipedia.org/wiki/Sun-Ni_law</a></li> <li>澶?#37837;哥郴缁熶腑涓?#32457;?#37711;?#37736;嬮攣绔?#27996;?#37928;?#37716;?#38315;?#23011;斿垎鏋?nbsp;<a href="http://blog.csdn.net/drzhouweiming/article/details/1800319" rel="nofollow" style="text-decoration: none; ">http://blog.csdn.net/drzhouweiming/article/details/1800319</a></li> <li>闃垮杈惧皵瀹氬緥鍜孏ustafson瀹氬緥鐨?#32475;?#28000;?#37804;?nbsp;<a href="http://book.51cto.com/art/201004/197506.htm" rel="nofollow" style="text-decoration: none; ">http://book.51cto.com/art/201004/197506.htm</a></li> </ul> <p> </p> <div id="index"> <div id="previous"><a href="http://www.5432034.com/xylz/archive/2011/12/30/367592.html">?#33503;鍙?#37804;?#32513;?part 3 甯?#29785;?#37928;勫苟鍙戦櫡闃?/a> </div> <div id="center" align="center"><a href="http://www.5432034.com/xylz/archive/2010/07/08/325587.html"><strong>鐩?nbsp;  ?#32141;</strong></a> </div> <div id="next"><a name="over">?#27535;鏃?#28729;岀粨</a></div> </div><img src ="http://www.5432034.com/xylz/aggbug/367641.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2011-12-31 14:13 <a href="http://www.5432034.com/xylz/archive/2011/12/31/367641.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>?#32321;鍏?#23092;呭嚭 Java Concurrency (39): ?#33503;鍙?#37804;?#32513;?part 3 甯?#29785;?#37928;勫苟鍙戦櫡闃?/title><link>http://www.5432034.com/xylz/archive/2011/12/30/367592.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Fri, 30 Dec 2011 09:25:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2011/12/30/367592.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/367592.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2011/12/30/367592.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/367592.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/367592.html</trackback:ping><description><![CDATA[<h1>甯?#29785;?#37928;勫苟鍙戦櫡闃?/h1> <h2>volatile</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">volatile鍙兘寮鸿?#20905;暟鎹?#37928;?#37721;?#29785;?#37804;?#38171;屽苟涓嶈兘淇?#29831;佸?#29111;瓙鎿嶄綔鍜岀嚎绋嬪畨鍏?#38171;屽?#29363;volatile涓?#37828;?#28051;囪兘鐨?#37510;?#37721;?#38000;?a href="http://www.5432034.com/xylz/archive/2010/07/03/325168.html" rel="nofollow" style="text-decoration: none; ">鎸?#28000;?#38322;嶆帓搴?/a></p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">volatile鏈甯?#29785;佷簬涓嬮潰涓?#32457;?#37734;烘櫙銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">a. 寰?#37916;?#22955;娴?#37832;哄埗<br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">volatile</span> <span style="color: #0000FF; ">boolean</span> done = <span style="color: #0000FF; ">false</span>;<br /> <img src="http://www.5432034.com/Images/dot.gif" alt="" /><br /> <br />     <span style="color: #0000FF; ">while</span>( ! done ){<br />         dosomething();<br />     }</div> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /> b. 鍗?#28186;嬫ā鍨?锛?a href="http://www.5432034.com/xylz/archive/2009/12/18/306622.html%ef%bc%89" rel="nofollow" style="text-decoration: none; ">http://www.5432034.com/xylz/archive/2009/12/18/306622.html锛?br /> <br /> </a></p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><a href="http://www.5432034.com/xylz/archive/2009/12/18/306622.html%ef%bc%89" rel="nofollow" style="text-decoration: none; "><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> DoubleLockSingleton {<br /> <br />     </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">volatile</span><span style="color: #000000; "> DoubleLockSingleton instance </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">;<br /> <br />     </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> DoubleLockSingleton() {<br />     }<br /> <br />     </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> DoubleLockSingleton getInstance() {<br />         </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (instance </span><span style="color: #000000; ">==</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">) {<br />             </span><span style="color: #0000FF; ">synchronized</span><span style="color: #000000; "> (DoubleLockSingleton.</span><span style="color: #0000FF; ">class</span><span style="color: #000000; ">) {<br />                 </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (instance </span><span style="color: #000000; ">==</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">) {<br />                     instance </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> DoubleLockSingleton();<br />                 }<br />             }<br />         }<br />         </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> instance;<br />     }<br /> }</span></a></div> <p> </p> <h2><br /> synchronized/Lock</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鐪?#29863;?#37833;ock鏈?#37831;村ソ鐨勬ц兘浠?#37721;?#37831;寸伒娲?#37928;勬帶?#22487;锛?#37828;?#37722;?#28729;?#37711;?#37721;?#28000;?#37831;?#37817;ynchronized锛?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍦?a href="http://www.5432034.com/xylz/archive/2010/07/16/326246.html" rel="nofollow" style="text-decoration: none; ">閿?#37928;?#28051;浜?#37711;?#28729;?#38338;?#26864;?/a>?#33105;璇?#26473;?#38171;宻ynchronized鐨勬ц兘闅忕潃JDK鐗?#37832;?#37928;?#37719;囩骇?#32048;瓒?#37833;?#29906;?#26946;?#38171;?#38000;孡ock浼?#37718;栫?#21229;┖闂?#37721;楅檺浜嶤PU鐨勬ц兘锛屽緢鏈夐檺銆?#37721;?#28598;朖DK鍐呴儴鐨?#23480;?#37711;?#38171;堢嚎绋?#26462;偍锛?#28725;箂ynchronized鏄?#37832;?#28051;浜?#37824;?#37816;?#37928;?#38171;?#37826;?#28186;?#37721;戠幇姝?#38335;?#32475;?#38171;?#38171;?#38000;屽Lock鏄病鏈?#28000;?#28003;?#37824;?#37816;?#37928;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涔?#28751;?#29831;寸畝鍗?#37928;?#38315;?#26440;戜娇鐢╯ynchronized瀹?#37711;ㄦ病鏈?#38338;?#26864;?#38171;岄?#24533;潃鏈哄櫒鐨勬ц兘鐨勬彁楂?#38171;?#26473;欑偣寮閿鏄?#37721;?#28000;?#36423;界暐鐨?#37510;?#38000;?#28051;?#28000;?#28000;g爜缁?#37835;?#28051;?#29825;?#37828;?#37831;寸畝鍗?#37928;?#37510;傜畝鍗?#28751;?#37828;?#32519;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">瀵?#27996;?#28598;?#37833;?#37928;?#38315;?#26440;?#38171;屽鏋滄秹鍙?#37714;?#29831;诲啓閿?#37510;佹潯?#27426;鍙橀噺銆?#37831;?#26946;樼殑鍚?#37722;愰噺浠?#37721;?#37831;寸伒娲?#37510;佸姩鎬?#37928;?#37922;ㄦ硶锛?#38317;?#28052;堝氨鍙?#28000;?#38000;冭?#25116;娇鐢↙ock銆傚綋鐒惰繖閲屽挨鍏?#38343;瑕佹敞?#21104;Lock鐨勬纭?#37922;ㄦ硶銆?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->Lock lock = <img src="http://www.5432034.com/Images/dot.gif" alt="" /><br /> lock.lock();<br /> <span style="color: #0000FF; ">try</span>{<br />     <span style="color: #008000; ">//</span><span style="color: #008000; ">do something</span><span style="color: #008000; "><br /> </span>}<span style="color: #0000FF; ">finally</span>{<br />     lock.unlock();<br /> }</div> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /> 涓瀹?#29781;佸皢Lock鐨?#38322;?#37824;?#37824;?#37711;inally鍧椾腑锛?#37722;?#37714;?#28051;鏃?#37721;戠敓寮?#29999;?#37812;?#38000;呴?#26440;戣煩杞?#38171;屽緢鏈?#37721;兘浼氬鑷?#38335;佹病鏈?#38322;?#37824;?#38171;?#28000;?#38000;屽?#25120;?#29112;閿?#37510;?#38000;?#28051;?#26473;?#32457;嶆閿?#37828;?#38341;?#28000;?#37818;?#37836;?#37928;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">濡?#37835;?#38343;瑕乻ynchronized鏃犳?#26334;?#27692;?#25198;殑灏濊瘯閿?#37832;哄埗锛?#37812;?#38000;?#29831;?#37815;?#36423;冨?#25120;?#29112;閿佹?#29363;硶?#22172;鎭?#28598;?#38171;?#38317;?#28052;堜娇鐢╰ryLock()鏄?#28051;涓?#23011;旇緝鏄庢櫤鐨?#38315;?#37815;?#37928;?#37510;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->Lock lock = <img src="http://www.5432034.com/Images/dot.gif" alt="" /><br /> <span style="color: #0000FF; ">if</span>(lock.tryLock()){<br />     <span style="color: #0000FF; ">try</span>{<br />         <span style="color: #008000; ">//</span><span style="color: #008000; ">do something</span><span style="color: #008000; "><br /> </span>    }<span style="color: #0000FF; ">finally</span>{<br />         lock.unlock();<br />     }<br /> }</div> <p> </p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鐢?#38007;?#37721;?#28000;?#28003;?#37922;?#38014;?#37721;?#38335;佷竴娈?#37827;?#38338;村?#21616;?#21614;椂鐨勬?#21700;埗Lock.tryLock(long,TimeUnit)銆?閿?#37928;?#28003;?#37922;?#37721;?#28000;?#37721;?#38000;冨墠闈?#37826;?#32468;?#37928;勬弿杩?#37724;屽缓璁?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>閿?#37928;勮?#22317;晫</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涓涓?#23092;?#29723;岀殑閿?#29831;?#37828;?#26473;欐牱鐨?#37510;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->ConcurrentMap<String,String> map = <span style="color: #0000FF; ">new</span> ConcurrentHashMap<String,String>();<br /> <br /> <span style="color: #0000FF; ">if</span>(!map.containsKey(key)){<br />     map.put(key,value);<br /> }</div> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /> 鐪?#29863;?#37833;?#23536;?#37722;堢悊鐨?#38171;屽浜?#28051;涓?#32510;?#32459;嬪畨鍏?#37928;凪ap瀹?#37916;?#38171;?#29781;佸瓨鍙?#28051;涓?#28051;?#38322;嶅鐨勭粨鏋?#38171;?#37711;堟娴?#37828;?#37722;?#28699;?#37734;?#37906;?#37722;?#37716;?#37711;?#37510;?鍏?#28729;?#37812;?#28000;煡?#20158;涓?#28051;?#37720;熷瓙鎿嶄綔鍜屽湪涓璧?#37928;勬寚浠?#25652;?#37714;?#28051;?#28000;?#29723;?#28751;?#37828;?#32510;?#32459;嬪畨鍏?#37928;?#37510;?鍓?#29761;?#37928;?#28598;?#28051;?#37720;熷瓙鎿嶄綔鏀?#37734;?#28051;璧?#37734;?#28598;氱嚎绋?#37928;勬儏鍐?#28051;嬪氨鏈?#37721;兘鍙戠?#29116;敊璇?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">瀹?#38340;?#28051;奀oncurrentMap?#24385;渚?#27996;唒utIfAbsent(K, V)鐨?#8220;鍘熷瓙鎿嶄綔”鏈哄埗锛?#26473;?#32475;?#28000;?#27996;?#28051;嬮潰鐨?#38315;?#26440;?#38171;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">if</span>(map.containsKey(key)){<br />     <span style="color: #0000FF; ">return</span> map.get(key);<br /> }<span style="color: #0000FF; ">else</span>{<br />     <span style="color: #0000FF; ">return</span> map.put(k,v);<br /> }</div> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /> ?#27342;浜唒utIfAbsent杩?#37832;塺eplace(K, V)浠?#37721;妑eplace(K, V, V)涓?#32457;?#37832;哄?#33333;潵瀹?#37812;?#32513;?#37722;?#37928;勬?#23940;綔銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#24385;鍒癕ap锛?#26473;?#38322;?#37832;?#28051;绡囪皥<a href="http://www.5432034.com/xylz/archive/2009/12/18/306602.html" rel="nofollow" style="text-decoration: none; ">HashMap璇诲啓?#33503;鍙?/a>鐨?#38338;?#26864;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>鏋?#38315;犲?#33445;暟鍚姩绾?#32459;?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">涓嬮潰鐨?#28729;?#28186;?#37828;?#37734;?#37835;?#38315;犲?#33445;暟?#33105;鍚姩涓涓?#32510;?#32459;?#37510;?br /> </p> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> Runner{<br />    <span style="color: #0000FF; ">int</span> x,y;<br />    Thread thread;<br />    <span style="color: #0000FF; ">public</span> Runner(){<br />       <span style="color: #0000FF; ">this</span>.x=1;<br />       <span style="color: #0000FF; ">this</span>.y=2;<br />       <span style="color: #0000FF; ">this</span>.thread=<span style="color: #0000FF; ">new</span> MyThread();<br />       <span style="color: #0000FF; ">this</span>.thread.start();<br />    }<br /> }</div> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /> 杩?#38322;屽彲?#20824;瀛?#37734;?#37928;勯櫡闃?#37828;?#28641;?#37835;?#23005;ょ被琚?#32513;?#37813;?#38171;?#38317;?#28052;?#37722;姩鐨勭嚎绋?#37721;兘鏃犳硶姝?#32429;?#29831;?#37721;栧瓙?#34987;鐨?#37714;濆鍖?#37823;嶄綔銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">鍥犳涓涓畝鍗?#37928;?#37720;?#37714;?#37828;?#38171;岀?#20345;鍦?#37835;?#38315;犲?#33445;暟?#33105;鍚姩绾?#32459;?#38171;屽彲浠?#38000;冭?#25116;絾鏄彁渚?#28051;涓?#37826;规硶鏉?#37722;姩绾?#32459;?#37510;傚鏋滈潪瑕佽?#27406;?#22557;仛锛?#37832;濂?#28751;嗙被璁?#32515;?#28051;篺inal锛岀?#20345;缁?#37813;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>涓?#28598;?#38315;氱煡鐨?#38338;?#26864;?/h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><a href="http://www.5432034.com/xylz/archive/2011/09/05/326988.html" rel="nofollow" style="text-decoration: none; ">杩欑瘒鏂?#32468;?/a>閲岄潰?#24385;鍒?#26473;噉otify涓?#28598;?#38315;氱煡鐨?#38338;?#26864;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">瀵?#27996;巜ait/notify/notifyAll浠?#37721;奱wait/singal/singalAll锛屽鏋?#28051;嶇‘瀹氬埌搴?#37828;?#37722;﹁兘澶熸纭?#37928;勬?#36346;埌娑堟伅锛?#37815;?#36423;?#28051;?#28598;?#38315;氱煡锛岀畝鍗?#28051;?#20579;灏?#37828;?#37804;?#37828;?#38315;氱煡鎵鏈?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">濡?#37835;?#37815;?#36423;冨彧鏀跺埌涓娆?#23057;堟伅锛屼娇鐢?#23536;?#37916;?#28051;鐩?#37929;?#37722;?#37828;?#28051;?#38335;?#37928;?#38315;?#37815;?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#28522;甯?#28051;?#37922;?#37804;ц兘鐨勭郴缁?#38171;屽彲?#20824;灏?#38343;瑕佸?#21700;垎鍒?#25652;?#37828;?#38315;氱煡鍗?#28051;?#26473;?#37828;?#38315;氱煡鎵鏈?#37928;勬寕璧?#38000;?#37510;?/p> <div style="margin-top: 1.33em; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "></div> <h2>绾?#32459;嬫暟</h2> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">?#33503;涓?#37828;?#32510;?#32459;嬫暟瓒?#28598;?#29906;?#28610;?#38171;屽湪涓?#28051;绡?#37826;?#32468;?#38322;岄潰?#32048;鍏?#28003;?#27996;?#29785;?#28051;?#37804;ц兘鍜屽彲浼?#32514;?#37804;?#37510;??#30045;鍗?#37928;?#29831;?#38171;岀嚎绋嬫暟澶氬?#25118;病鏈?#28051;涓?#37733;哄畾鐨勭粨璁?#38171;屽彈?#27322;浜嶤PU鐨勫?#21614;?#21578;暟锛孖O鐨勬ц兘浠?#37721;?#28186;?#29863;栫?#21228;湇鍔?#32475;?#32475;?#37510;傚?#29363;閫?#37815;?#28051;涓?#37722;?#38315;?#37928;勭嚎绋嬫暟鏈?#37716;?#27996;庢彁楂?#37722;?#37722;愰噺銆?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">瀵?#27996;嶤PU瀵?#38342;?#37736;嬪簲鐢?#38171;岀嚎绋嬫暟鍜孋PU鐨勫?#21614;?#21578;暟涓鑷存湁鍔?#27996;庢彁楂?#37722;?#37722;愰噺锛屾墍鏈塁PU?#20824;寰堢?#20344;繖锛屾晥鐜?#28751;?#23536;?#26946;?#37510;?瀵?#27996;嶪O瀵?#38342;?#37736;嬪簲鐢?#38171;岀嚎绋嬫暟鍙楅檺浜嶪O鐨勬ц兘锛屾煇浜?#37827;跺?#37719;?#32510;?#32459;?#37721;兘姣?#28598;氱嚎绋嬫晥鐜?#37831;?#26946;?#37510;?#28003;?#38315;?#29999;告儏鍐?#28051;嬮傚綋?#24385;楂樼嚎绋嬫暟锛?#37832;?#37714;?#27996;庢彁楂樼?#25120;?#28122;O鐨勬晥鐜?#38171;屽洜涓?#37812;?#28000;?#37804;?#37828;?#29825;?#28051;?#32515;戠?#28122;O鐨勬晥鐜?#23011;旇緝浣?#37510;?/p> <p style="margin-top: 1.33em; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; ">瀵?#27996;庣嚎绋?#23033;?#38000;岃█锛岄?#37815;?#37722;?#38315;?#37928;勭嚎绋嬫暟浠?#37721;?#28000;诲姟闃?#37714;?#37828;彁楂樼嚎绋?#23033;犳晥鐜?#37928;勬?#23339;銆?br /> </p> <div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; border-image: initial; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">public</span> ThreadPoolExecutor(<br />     <span style="color: #0000FF; ">int</span> corePoolSize,<br />     <span style="color: #0000FF; ">int</span> maximumPoolSize,<br />     <span style="color: #0000FF; ">long</span> keepAliveTime,<br />     TimeUnit unit,<br />     BlockingQueue<Runnable> workQueue,<br />     ThreadFactory threadFactory,<br />     RejectedExecutionHandler handler)</div> <p> </p> <p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; background-color: #ffffff; "><br /> 瀵?#27996;庣嚎绋?#23033;犳潵璇?#38171;屽鏋?#28000;诲姟鎬?#37828;?#37832;?#32457;?#37720;?#38171;?#38317;?#28052;?#37721;?#28000;?#38315;傚綋?#24385;楂榗orePoolSize澶?#28751;?#38171;涘鏋?#37832;哄櫒璐?#26462;借緝浣?#38171;?#38317;?#28052;?#37721;?#28000;?#38315;傚綋?#24385;楂榤aximumPoolSize鐨?#28598;?#28751;?#38171;?#28000;诲姟闃?#37714;?#28051;?#38336;?#37928;勬儏鍐?#28051;嬪噺灏弅eepAliveTime鐨勬椂闂存湁鍔?#27996;?#38340;?#28003;?#29840;?#26462;?#38171;?#37721;?#28598;?#28000;诲姟闃?#37714;?#37928;?#38336;?#25652;?#28000;?#37721;?#28000;诲姟闃?#37714;?#37928;?a href="http://www.5432034.com/xylz/archive/2011/01/18/343183.html" rel="nofollow" style="text-decoration: none; ">鎷掔粷绛栫暐</a>涔?#28028;氬浠诲姟鐨?#28598;勭悊鏈?#28051;浜涘奖鍝?#37510;?/p> <p> </p> <div id="index"> <div id="previous"><a href="http://www.5432034.com/xylz/archive/2011/12/29/367480.html">?#33503;鍙?#37804;?#32513;?part 2 甯?#29785;?#37928;勫苟鍙戝満鏅?/a> </div> <div id="center" align="center"><a href="http://www.5432034.com/xylz/archive/2010/07/08/325587.html"><strong>鐩?nbsp;  ?#32141;</strong></a> </div> <div id="next"><a href="http://www.5432034.com/xylz/archive/2011/12/31/367641.html">?#33503;鍙?#37804;?#32513;?part 4 鎬ц兘涓庝几缂?#37804;?/a> </div> </div><img src ="http://www.5432034.com/xylz/aggbug/367592.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2011-12-30 17:25 <a href="http://www.5432034.com/xylz/archive/2011/12/30/367592.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>?#32321;鍏?#23092;呭嚭 Java Concurrency (38): ?#33503;鍙?#37804;?#32513;?part 2 甯?#29785;?#37928;勫苟鍙戝満鏅?/title><link>http://www.5432034.com/xylz/archive/2011/12/29/367480.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Thu, 29 Dec 2011 08:31:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2011/12/29/367480.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/367480.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2011/12/29/367480.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/367480.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/367480.html</trackback:ping><description><![CDATA[     鎽?#29781;? 绾?#32459;?#23033;?<br> <br>?#33503;鍙?#37832;甯?#29785;?#37922;?#27996;庣嚎绋?#23033;?#38171;?#37828;?#37906;?#28003;?#37922;?#32510;?#32459;?#23033;?#37721;?#28000;?#37832;夋晥鐨勬彁楂?#37722;?#37722;愰噺銆?<br>鏈甯?#29785;?#37510;?#23011;旇?#20904;鏉?#28051;涓?#37734;烘櫙鏄疻eb瀹瑰櫒鐨勭嚎绋?#23033;?#37510;俉eb瀹瑰櫒浣?#37922;?#32510;?#32459;?#23033;?#37722;屾鎴?#38000;?#23534;傛澶勭悊HTTP璇?#23033;?#38171;?#37722;屾?#24816;?#27406;篃鍙?#28000;?#37832;夋晥鐨?#28598;?#37922;℉TTP杩?#37818;?#38171;岄檷浣?#29863;勬簮鐢?#29831;?#37928;?#23534;閿銆?#38315;?#29999;?#37812;?#28000;?#29825;?#28051;篐TTP璇?#23033;?#37827;堕潪甯?#37828;?#29840;?#37928;?#38171;屽苟涓?#28052;?#37828;?#23011;旇?#20909;?#29840;?#29863;勬簮鍜?#37804;ц兘鐨?#38171;屾墍浠?#32510;?#32459;?#23033;?#37734;?#26473;?#38322;屽氨鎵紨浜嗛潪甯?#38322;嶈鐨勮鑹?#37510;?<br>鍦?#32510;?#32459;?#23033;?#37928;?#32468;犺妭?#33105;?#28522;甯?#29831;?#32513;?#37928;?#29825;?#29825;?#27996;?#32510;?#32459;?#23033;?#37928;?#37720;?#37918;?#37724;屼娇鐢?#38171;?#37722;屾椂涔熸彁鍒?#27996;?#38171;岀嚎绋?#23033;?#37928;勯?#23943;疆鍜屽?#20635;暟瀵?#37804;ц兘鐨勫奖鍝?#37828;?#23480;?#28598;?#37928;?#37510;?#28051;嶅?#34249;?#20635;锛屽彈?#27322;浜?#29863;勬簮锛?#37832;哄櫒鐨勬ц兘銆?#32515;戠粶鐨?#29999;?#28729;?#32475;?#32475;?#38171;?#37510;佷緷璧栫?#21228;湇鍔?#38171;屽鎴?#32468;?#37928;?#37725;嶅簲閫熷害绛?#38171;岀嚎绋?#23033;?#37928;勫?#20344;?#28055;篃涓嶄細涓鐩?#28583;?#38336;?#37510;傝?#24807;埌浜?#32510;?#32459;?#23033;?#37928;勭?#22549;鍚?#38171;?#37804;ц兘鍜?#37722;?#37722;愰噺?#20824;浼氬ぇ骞?#25652;?#38340;?#28003;?#37510;?<br>涓鐩?#28583;?#37716;?#37832;哄櫒鐨勬ц兘鎴?#38000;?#28583;?#28598;?#32510;?#32459;?#37928;?#28051;暟锛屽苟涓?#28051;瀹氳兘鏈夋晥鐨勬彁楂?#37722;?#37722;愰噺銆?#26946;樺苟鍙戠?#21228;儏鍐?#28051;?#38171;?#37832;哄櫒鐨?#29840;?#26462;?#28028;氬ぇ骞呮彁鍗?#38171;?#26473;?#37827;跺?#37832;哄櫒鐨?#32459;?#28729;?#37804;?#37510;?#37832;?#37716;?#37928;?#37721;?#38344;?#37804;ч兘?#32048;涓嬮檷銆?<br>灏界濡傛锛岀嚎绋?#23033;?#28186;?#37906;舵槸?#24385;楂?#37722;?#37722;愰噺鐨?#28051;涓?#37832;夋?#22559;帾鏂?#38171;岄厤鍚?#37722;?#38315;?#37928;?#37721;傛暟?#20824;澶?#37832;夋晥鐨?#37711;呭垎鍒?#37922;?#29863;勬簮锛屾彁楂?#29863;勬簮鐨?#37714;?#37922;?#37916;?#37510;?nbsp; <a href='http://www.5432034.com/xylz/archive/2011/12/29/367480.html'>闃?#29831;?#37711;?#37826;?/a><img src ="http://www.5432034.com/xylz/aggbug/367480.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2011-12-29 16:31 <a href="http://www.5432034.com/xylz/archive/2011/12/29/367480.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>?#32321;鍏?#23092;呭嚭 Java Concurrency (37): ?#33503;鍙?#37804;?#32513;?part 1 姝?#38335;佷?#24226;椿璺冨害http://www.5432034.com/xylz/archive/2011/12/29/365149.htmlimxylzimxylzThu, 29 Dec 2011 06:04:00 GMThttp://www.5432034.com/xylz/archive/2011/12/29/365149.htmlhttp://www.5432034.com/xylz/comments/365149.htmlhttp://www.5432034.com/xylz/archive/2011/12/29/365149.html#Feedback2http://www.5432034.com/xylz/comments/commentRss/365149.htmlhttp://www.5432034.com/xylz/services/trackbacks/365149.html
    ?#22688;闈?#29835;?#27996;嗗?#22557;?#27692;苟鍙戠?#21229;壒鎬?#37724;屽伐鍏?#38171;屼絾鏄?#28598;?#38318;ㄥ垎?#20824;鏄?#37724;岄攣鏈?#37711;?#37928;?#37510;?#37812;?#28000;?#28003;?#37922;?#38335;佹潵淇?#29831;?#32510;?#32459;嬪畨鍏?#38171;屼絾鏄?#26473;欎篃?#32048;寮?#29863;?#28051;浜?#38338;?#26864;?#37510;?
    閿侀?#21700;簭姝?#38335;?lock-ordering deadlock)锛氬涓?#32510;?#32459;嬭瘯?#27992;閫?#26473;?#28051;?#37722;岀殑椤哄簭鑾?#23536;?#28598;?#28051;?#37929;?#37722;岀殑璧勬簮锛屽垯鍙戠敓鐨?#23536;?#37916;?#38335;佷緷璧栫?#25292;薄銆?
    ?#23017;鎬?#37928;勯?#20352;?#21700;簭姝?#38335;?#38171;圖ynamic Lock Order Deadlocks锛?#38171;氬涓?#32510;?#32459;嬮?#26473;?#28028;?#38315;?#28051;?#37722;岀殑閿侀?#37812;?#37928;勯?#20352;?#21700;簭姝?#38335;?#38338;?#26864;?#37510;?
    璧勬簮姝?#38335;?#38171;圧esource Deadlocks锛?#38171;氱嚎绋?#38338;?#37929;?#27996;?#32475;?#23536;?#28725;规?#35268;寔鏈?#37928;勯攣锛屽苟涓旇?#20352;兘涓嶄細閲?#37824;捐嚜?#32321;鎸?#37832;?#37928;勯?#20344;?#25120;敓鐨勬閿?#37510;?#28052;?#28751;?#37828;?#29831;村綋鐜?#37734;烘寔鏈?#37724;岀瓑寰?#37928;?#37929;爣鎴?#28051;?#29863;勬簮锛屽氨鏈?#37721;兘鍙戠?#29112;姝?#38335;?#37510;?#26473;?#37724;岄?#20352;?#21700;簭姝?#38335;佷笉涓鏍?#37928;?#37734;?#37826;?#37828;?#38171;岀珵浜?#37928;?#29863;勬簮涔?#38338;?#39582;舵病鏈?#28051;?#37837;?#37711;?#37722;?#26916;哄簭锛?#28000;?#28000;?#37828;?#37929;?#27996;?#28186;?#29863;?#38000;屽凡銆?nbsp; 
    闃?#29831;?#37711;?#37826;?/a>

    ]]>?#32042;绋嬭瑷澶?#37812;?/title><link>http://www.5432034.com/xylz/archive/2011/12/06/365658.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Tue, 06 Dec 2011 03:25:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2011/12/06/365658.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/365658.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2011/12/06/365658.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/365658.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/365658.html</trackback:ping><description><![CDATA[     鎽?#29781;? 鍒?#37930;嬪埌杩?#28051;?#37832;?#37928;勭紪绋嬭瑷鎺?#29723;屾锛屽緢鏄?#37906;秊ava鐨?#38343;?#28051;诲湴浣嶅?#22557;揩灏变細鍦?#37721;戣?#24807;浗瀹惰鎸?#37818;?#38171;孋璇?#29815;渚?#37906;舵槸鐜嬭?#38171;堟?#34411;兂涓?#28051;?#37832;堣嚜?#32321;涔扮殑涓?#28051;狢璇?#29815;鐨勪功锛屽喎姹?#37929;存祦锛?#37510;?#37930;?#37833;?#37812;?#26473;熸棭瑕佸?#28850;?#25174;锛?#26473;欐墠鏄?#37930;熸鐨勭?#23342;亾銆?<br> <br> <br> <br>?#28522;甯?#28000;?#27996;?#37722;冩儕鐨勬槸C++璇?#29815;渚?#37906;?#28051;嶅?#29111;潥鎸?#38171;岀敱浜嶹indows 7/Windows 8鐨?#37721;戝姏锛孋#寰堝揩灏变細鎶?#37719;燙++鐨?#29999;?#37734;?#38171;屼及璁?#23536;堝揩灏?#28028;氬皢C++浠庡墠涓?#37722;嶄腑鎸?#28051;嬪幓銆?<br> <br> <br> <br>iPhone/iPad鐨勭儹閿璁㎡bject C缁?#32513;?#37903;儹锛屽墠鍗?#37928;勪綅缃?#26473;?#37828;?#37721;?#28000;?#37816;?#32513;?#23536;堜箙鐨?#38171;?#26473;?#28051;?#20579;姣嬪焊缃?#37924;?#37510;?#32457;诲姩璁惧寮鍙戠殑楂樼浜烘墠鐜?#37734;?#37828;?#26946;樿柂闅?#23033;?#38171;屽鏋?#37832;?#37827;?#38338;存?#25116;篃瑕?#32513;?#32513;?#37711;虫敞涓?#37510;?nbsp; <a href='http://www.5432034.com/xylz/archive/2011/12/06/365658.html'>闃?#29831;?#37711;?#37826;?/a><img src ="http://www.5432034.com/xylz/aggbug/365658.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2011-12-06 11:25 <a href="http://www.5432034.com/xylz/archive/2011/12/06/365658.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>澶勭悊Zookeeper鐨剆ession杩?#37832;?#38338;?#26864;?/title><link>http://www.5432034.com/xylz/archive/2011/12/05/365578.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Mon, 05 Dec 2011 05:57:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2011/12/05/365578.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/365578.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2011/12/05/365578.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/365578.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/365578.html</trackback:ping><description><![CDATA[     鎽?#29781;? Zookeeper瀹?#37812;?#32468;?#37724;?#37832;?#37716;?#32468;?#32513;存?#20343;竴涓?#38336;?#26473;?#37818;?#38171;?#23011;?#38341;?0s鍚?#37832;?#37716;?#32468;?#37721;?#38315;佷竴涓?#36423;冭煩锛?#37832;?#37716;?#32468;?#26473;?#37733;?#28729;?#37812;?#32468;?#28051;涓?#37725;嶅簲銆?#26473;?#28751;?#37828;?#28051;涓猄ession杩?#37818;?#38171;?#37815;?#37832;?#37711;?#28766;?#25966;涓鐨剆ession id銆係ession杩?#37818;?#38315;?#29999;?#37828;?#28051;鐩存湁?#26213;锛屽鏋滃洜涓?#32515;戠粶鍘熷?#29363;柇寮浜?#26473;?#37818;?#38171;屽鎴?#32468;細浣?#37922;?#37929;?#37722;岀殑session id杩?#29723;岄?#23944;繛銆?#37922;?#27996;?#37832;?#37716;?#32468;?#28103;濈暀浜唖ession鐨?#37722;?#32457;嶇?#33333;?#38171;屽挨鍏舵槸鍚?#32457;嶇灛鏃惰妭?#20579;鏄?#37722;?#37714;犻櫎渚?#29863;?#27996;巗ession鏄?#37722;?#28598;辨晥銆?<br>Session澶辨晥闂?#26864;?<br> <br>閫?#29999;?#28729;?#37812;?#32468;?#28051;诲姩鍏?#38338;?#26473;?#37818;?#29825;?#28051;?#37828;?#28051;娆ession澶辨晥銆?#37721;?#28598;?#28052;?#37832;?#37721;兘?#27932;涓?#37711;?#28729;?#37832;煡鍘熷洜锛?#28186;嬪缃戠粶瓒呮?#36346;鑷?#37928;剆ession澶辨晥闂?#26864;?#37510;?#37734;?#37832;?#37716;?#32468;?#37930;?#37833;?#38171;屾?#29363;硶鍖哄垎session澶辨晥鏄?#28003;?#32457;嶆儏鍐?#38171;?#28051;娆?#28051;鏃?#37721;戠敓session澶辨晥锛?#28051;瀹?#37827;?#38338;?#37722;?#28751;?#28028;氬皢session鎸?#37832;?#37928;勬墍鏈墂atcher浠?#37721;婄灛鏃惰妭?#20579;鍒犻櫎銆?<br>鑰屽浜嶼ookeeper瀹?#37812;?#32468;?#38000;岃█锛?#28051;鏃?#37721;戠敓澶辨晥涓嶇煡?#20158;鏄?#37722;?#29831;?#38322;嶈繛锛?#26473;欐秹鍙?#37714;皐atcher鍜岀灛鏃惰妭?#20579;闂?#26864;?#38171;屽?#29363;Zookeeper瀹?#37812;?#32468;?#29825;?#28051;?#38171;?#28051;鏃?#37721;戠敓浜唖eesion澶辨晥锛?#38317;?#28052;堝氨璁?#28051;哄鎴?#32468;?#23005;绘帀浜?#37510;?#28000;?#38000;屾墍鏈夋?#23940;綔?#20824;涓嶈兘澶?#26473;?#29723;?#37510;?#37721;?#38000;?How should I handle SESSION  <a href='http://www.5432034.com/xylz/archive/2011/12/05/365578.html'>闃?#29831;?#37711;?#37826;?/a><img src ="http://www.5432034.com/xylz/aggbug/365578.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2011-12-05 13:57 <a href="http://www.5432034.com/xylz/archive/2011/12/05/365578.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Redis 2.2.x 鍗囩骇鍒?.4.xhttp://www.5432034.com/xylz/archive/2011/11/21/364457.htmlimxylzimxylzMon, 21 Nov 2011 08:48:00 GMThttp://www.5432034.com/xylz/archive/2011/11/21/364457.htmlhttp://www.5432034.com/xylz/comments/364457.htmlhttp://www.5432034.com/xylz/archive/2011/11/21/364457.html#Feedback1http://www.5432034.com/xylz/comments/commentRss/364457.htmlhttp://www.5432034.com/xylz/services/trackbacks/364457.html

    鏈?#27996;?#29831;碦edis鐨勪綔鑰?#37828;?#28051;涓?#37717;?#28610;?#37928;?#27996;?#38171;屾繁琛?#37722;屾剰锛?


    鏈?#37833;?#37719;囩骇鏄?#28051;?#27996;?#28583;?#37716;犳壒?#22138;鎿嶄綔浠?#38000;屾彁楂?#37804;ц兘锛屾病?#20802;鍒板唴瀛?#37719;?#37922;ㄨ妭鐪佷?#21975;?#22557;銆?

    瀵?#27996;?2?#32133;鐨勬?#23940;綔?#37108;缁?#38000;岃█锛岃妭鐪佸唴瀛?2%锛屽浜?4?#32133;鎿嶄綔?#37108;缁?#38000;岃█?#22957;鐪?3%銆傞潪甯?#37721;?#29785;?#37510;?nbsp; 
    闃?#29831;?#37711;?#37826;?/a>

    ]]>鍏戠幇http://www.5432034.com/xylz/archive/2011/10/10/360915.htmlimxylzimxylzMon, 10 Oct 2011 14:44:00 GMThttp://www.5432034.com/xylz/archive/2011/10/10/360915.htmlhttp://www.5432034.com/xylz/comments/360915.htmlhttp://www.5432034.com/xylz/archive/2011/10/10/360915.html#Feedback3http://www.5432034.com/xylz/comments/commentRss/360915.htmlhttp://www.5432034.com/xylz/services/trackbacks/360915.html

    鎴戞壙璁ゅ啓鎶鏈?#37719;氬鏄?#28051;?#27426;鐗瑰埆杈涜嫤鍜岀?#28060;嫤鐨?#27996;嬫儏銆?/p>


    ?#21843;涓绡?#37814;鏈?#37719;氬闇瑕佸ぇ?#22138;鐨勬妧鏈偍澶?#38171;?#37722;屾?#24816;嚜?#23017;浜茶嚜?#23017;鎵嬪?#35826;疄璺?#38171;?#29831;佸?#28852;兂琛?#32448;?#37928;?#38171;屽?#25120;幇瑕佸洖閬?#37928;?#38338;?#26864;?#38171;?#26473;?#38343;瑕佸皢?#22172;?#32321;浣撻?#23680;殑杩?#32459;嬭?#26495;綍涓?#37833;?#38171;?#28000;?#28186;?#37722;?#37833;?#27996;鸿兘澶熼伩鍏嶇被浼?#37928;?#38338;?#26864;?#37510;?/p>


    鑰?#26473;?#28051;鍒?#37828;?#37906;?#28051;?#37828;啓涓绡?#37833;?#29825;?#37812;?#38000;?#26462;?#26462;?#28051;绡?#37826;?#32468;?#38317;?#28052;堝鏄?#37510;?/p>


    涓?#39582;村墠?#21843;涓涓?#37814;鏈?#28051;?#26864;?#38171;屾柇鏂?#32513;?#32513;啓浜?#28051;?#39582;?#38171;屽埌浠?#28598;?#28186;?#37906;舵病鏈?#28729;?#37812;?#37510;?#23011;?#23046;?#37804;?#37828;?#29999;?#37832;涜嚜?#32321;?#20824;澶?#23536;?#29825;?#37930;?#37510;佸?#22557;姫鍔?#37928;?#28729;?#37812;?#38171;岀敋鑷抽兘鏈?#32475;?#25652;旂綉鍙嬪敖蹇?#28729;?#37812;?#37928;勫?#25554;姩銆?#37721;?#37828;?#37930;熸寮濮?#37827;舵墠鍙戠幇鎴戠?#21228;敞?#21104;鍔?#37828;?#37828;炬病鏈夊綋鍒?#38317;?#28052;?#38342;嗕腑浜?#37510;?/p>


    鑰?#37812;戠幇鍦?#37831;村枩娆?#37831;存柊閭?#32457;峎iki?#32033;鐨勬妧鏈?#37714;?#37826;?#38171;屼綔涓虹偣婊?#37928;?#32457;?#32497;?#37510;傛病鏈?#37720;嬪姏锛屾病鏈?#29840;?#37815;?#38171;岄殢蹇冮殢?#21104;銆?/p>


    涔?#29825;?#38343;瑕?#37831;?#28598;?#37928;?#37711;磋叮鍜?#23011;?#37716;涙墠?#20824;鍧?#37816;佷?#23338;幓锛?#28051;嶇鎬庝箞璇?#38171;?#28000;?#39582;?#26473;?#37828;?#29999;?#37832;涜兘澶?#37832;?#37831;?#28598;?#37928;勬妧鏈?#37826;?#32468;犲嚭鏉?#38171;?#28051;?#39582;村墠鐨勬壙璇轰?#29111;簲璇?#37717;囨暍鐨?#37711;戠幇銆?/p>



    ]]>Ganglia瀹夎?#21614;寚鍗?(?#29056;浜嶤entOS 5.6)http://www.5432034.com/xylz/archive/2011/07/21/354744.htmlimxylzimxylzWed, 20 Jul 2011 16:34:00 GMThttp://www.5432034.com/xylz/archive/2011/07/21/354744.htmlhttp://www.5432034.com/xylz/comments/354744.htmlhttp://www.5432034.com/xylz/archive/2011/07/21/354744.html#Feedback7http://www.5432034.com/xylz/comments/commentRss/354744.htmlhttp://www.5432034.com/xylz/services/trackbacks/354744.html

    Ganglia瀹夎?#21614;寚鍗?(?#29056;浜嶤entOS 5.6)

    瀹夎渚?#29863;?/h2>
    rpm -ivh http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/zlib-devel-1.2.3-3.x86_64.rpm
    rpm -ivh http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/freetype-devel-2.2.1-28.el5_5.1.x86_64.rpm
    rpm -ivh http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/libart_lgpl-devel-2.3.17-4.x86_64.rpm
    rpm -ivh http://mirrors.sohu.com/centos/5/os/x86_64/CentOS/libpng-devel-1.2.10-7.1.el5_5.3.x86_64.rpm
    

    濡?#37835;?#28051;?#26473;?#28729;夎澶?#29840;?#38171;屽彲?#20824;闇瑕佸?#22798;浠?#28051;嬪簱渚?#29863;?/p>

    yum install zlib freetype libart_lgpl libpng
    

    瀹夎rrdtools

    http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz
    tar zxvf rrdtool-1.2.27.tar
    cd rrdtool-1.2.27
    ./configure --prefix=/usr/local/rrdtool
    make
    make install
    

    鎵?#29723;?#28051;嬪懡浠?#38171;岀湅鏄?#37722;?#28729;夎鎴?#37716;?/p>

    /usr/local/rrdtool/bin/rrdtool
    

    瀹夎expat渚?#29863;?/h2>
    http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz?use_mirror=cdnetworks-kr-2
    tar zxvf expat-2.0.1.tar.gz
    ./configure --prefix=/usr/local/expat
    make
    make install
    

    瀵?#27996;?4?#32133;鎿嶄綔?#37108;缁?#38171;岄渶瑕佹?#23338;姩鐨?#37815;?#29840;?#28051;嬪姩鎬侀摼鎺?#25652;?#37714;發ib64涓?/p>

    mkdir /usr/local/expat/lib64
    cp -a /usr/local/expat/lib/* /usr/local/expat/lib64/
    

    瀹夎apr浠?#37721;奱pr-util

    http://labs.renren.com/apache-mirror/apr/apr-1.4.5.tar.gz
    tar xvjf apr-1.3.2.tar.bz2
    ./configure --prefix=/usr/local/apr
    make
    make install
    
    http://labs.renren.com/apache-mirror/apr/apr-util-1.3.12.tar.gz
    tar xvjf apr-util-1.3.2.tar.bz2
    ./configure --with-apr=/usr/local/apr --with-expat=/usr/local/expat
    make
    make install
    

    鍚屾牱64?#32133;鏈哄櫒闇瑕?#37815;?#29840;濆姩鎬侀摼鎺?#25652;?/p>

    /bin/cp -f /usr/local/apr/include/apr-1/* /usr/local/apr/include/
    mkdir -p /usr/local/apr/lib64
    /bin/cp -a -f /usr/local/apr/lib/* /usr/local/apr/lib64/
    

    瀹夎confuse

    http://download.savannah.gnu.org/releases/confuse/confuse-2.7.tar.gz
    tar zxvf confuse-2.6.tar.gz
    ./configure CFLAGS=-fPIC --disable-nls --prefix=/usr/local/confuse
    make
    make install
    

    鎷?#29840;濆姩鎬侀摼鎺?#25652;?/p>

    mkdir -p /usr/local/confuse/lib64
    /bin/cp -a -f /usr/local/confuse/lib/* /usr/local/confuse/lib64/
    

    瀹夎ganglia

    鐜?#37734;ㄦ墠鏄?#28729;夎ganglia鐨?#23534;濮?#38171;屽鏋滄彁绀?#38343;瑕乸cre鐨?#29831;?#38171;屽?#22798;涓?nbsp;yum install pcre 涓?#26462;絞anglia-3.2.0锛?#29785;?#37720;?#38171;屽?#22798;

    ./configure --prefix=/usr/local/ganglia --with-librrd=/usr/local/rrdtool --with-libapr=/usr/local/apr --with-libexpat=/usr/local/expat \
    --with-libconfuse=/usr/local/confuse --with-gmetad --enable-gexec --enable-status --sysconfdir=/etc/ganglia
    make
    make install
    

    鏈?#37716;?#32468;?#38320;嶇疆

    鍒?#23524;簉rdtool?#26271;鎹?#37929;綍锛岀湅$ganglia-3.2.0/web/conf.php閲岄潰鐨刧metad_root鍙橀噺锛屽?#33333;?#35268;嵁apache鐨勮繍琛岀敤鎴?#37714;?#23524;烘潈?#27322;锛?#28186;嬪apache?#32333;琛?#27996;巃pache鐢?#37812;?#28051;?銆?/p>

    mkdir -p /var/lib/ganglia/rrds
    mkdir -p /var/lib/ganglia/dwoo
    chown -R apache;apache /var/lib/ganglia
    

    閰嶇疆涓涓暟鎹簮锛屼慨鏀?etc/ganglia/gmetad.conf鏂囦欢锛?#37722;屾?#36346;皢?#32333;琛岀敤鎴?#29825;?#32515;?#28051;簉rdtool鐨?#37929;綍?#28488;?#27322;鐢?#37812;?#38171;?#28186;嬪apache鐢?#37812;?/p>

    data_source "suc" localhost
    setuid_username "apache"
    

    鍏朵腑suc鏄暟鎹簮鐨?#37722;?#32457;?#38171;屽鎴?#32468;垎缁勪細渚?#29863;?#23005;?#37722;?#32457;?#38171;?#37722;?#38344;細?#24385;鍒?#37510;?娣诲姞?#22172;鍚姩?#21116;鏈?/p>

    /bin/cp -f gmetad/gmetad.init /etc/init.d/gmetad
    /bin/cp -f /usr/local/ganglia/sbin/gmetad /usr/sbin/gmetad
    chkconfig -add gmetad
    

    鍚姩gmetad鏈?#37716;?/p>

    service gmetad start
    

    鐪嬭?#20028;tarting GANGLIA gmetad: [ OK ]灏?#28000;?#29723;ㄨ繍琛屾甯?#27996;?#37510;?/p>

    瀹?#37812;?#32468;?#38320;嶇疆锛坓mond?#22957;?#20579;锛?/h2>

    鏈?#37832;哄?#22798;濡?#28051;?#38171;?/p>

    /bin/cp -f gmond/gmond.init /etc/init.d/gmond
    /bin/cp -f /usr/local/ganglia/sbin/gmond/usr/sbin/gmond
    chkconfig -add gmond
    gmond --default_config > /etc/ganglia/gmond.conf
    

    瀵?#27996;庣敓鎴?#37928;?#27035;?#29825;?#38320;嶇疆鏂囦欢闇瑕佸仛閫傚綋鐨勪慨鏀?/p>

    cluster {
    name="suc"
    owner="apache"
    latlong="unspecified"
    url="unspecified"
    }
    

    鍏朵腑name鏄?#28751;?#29781;佸湪鏈?#37716;?#32468;?#26473;?#29723;岀殑?#22414;缁?#38171;?#37828;?#37832;?#37716;?#32468;?#37928;勬暟鎹簮銆傛帴涓?#37833;?#23534;鍚?#37832;?#37716;?/p>

    service gmond start
    

    鐪嬭?#20028;tarting GANGLIA gmetad: [ OK ]浠?#29723;?#37722;姩鎴?#37716;?#37510;傚鏋?#37832;?#28598;?#29840;?#38171;屽彲浠?#29825;瞘mond.conf?#33105;鐨刣ebug鏈?鏀?#28051;?00锛岀湅鏇?#28598;?#37928;勬棩蹇?#38171;岀劧鍚?#26473;?#29723;屾帓鏌?#37510;?/p>

    globals {
    daemonize = yes
    setuid = yes
    user = nobody
    debug_level = 100
    }
    

    ?#28522;鏈?#37832;哄鎴?#32468;?#38320;嶇疆闇瑕佸?#22798;鏈?#37716;?#32468;?#28729;夎涓鏍?#26473;?#29723;岄?#23943;疆锛岃繍琛?#38171;岄潪甯搁?#33636;儲锛?#26473;?#38322;屼娇鐢?#37832;?#37832;哄?#22798;濂?#37928;勬?#22246;欢杩?#29723;屽?#22798;銆?浣?#37922;?#28051;嬮潰鐨勮剼鏈?#26473;?#29723;屽?#22798;?#21325;eploy-ganglia.sh

    i=$1
    scp /usr/sbin/gmond $i:/usr/sbin/gmond
    ssh $i mkdir -p /etc/ganglia/
    ssh $i mkdir -p /usr/local/ganglia/lib64
    ssh $i mkdir -p /usr/local/expat/lib
    scp /etc/ganglia/gmond.conf $i:/etc/ganglia/
    scp /etc/init.d/gmond $i:/etc/init.d/
    scp -r /usr/local/ganglia/lib64/* $i:/usr/local/ganglia/lib64/
    scp /usr/local/expat/lib/libexpat.so.1 $i:/usr/local/expat/lib/libexpat.so.1
    scp /usr/lib64/libapr-1.so.0 $i:/usr/lib64/
    

    瀹?#38340;?#28051;?#28751;?#37828;?#28751;?#37832;?#37832;哄?#22798;濂??#32042;璇戝ソ)鐨勫姩鎬侀摼鎺?#25652;?#37815;?#29840;?#37714;?#37711;?#28729;?#37832;哄櫒涓?#38171;屼娇鐢?#28641;?#28051;嬪懡浠?#37815;?#29840;?#37719;?#37721;?/p>

    sh deploy-ganglia.sh 10.1.11.2
    

    鏈?#37716;?#32468;?#37928;刉EB閰嶇疆

    PHP绋嬪簭闇瑕佷緷璧朅pache鏉ヨ繍琛?#38171;屽?#29363;闇瑕佸?#22798;濡?#28051;?#28186;?#29863;?/p>

    yum install php-common php-cli php php-gd httpd
    

    瀹夎?#21376;eb绋嬪簭锛?#26473;?#38322;屽亣瀹歛pache鐨剅oot璺?#23536;?#37734;?var/www/html涓嬮潰銆?/p>

    mkdir /var/www/html/ganglia
    cp -a -f ganglia-3.2.0/web/* /var/www/html/ganglia
    

    绂?#37922;⊿ELinux setenforce 0 淇?#37824;箁rdtool鐨勮矾寰?#38171;屾?#22246;欢/var/www/html/ganglia/conf.php?#33105;鐨凴RDTOOL

    define("RRDTOOL", "/usr/local/rrdtool/bin/rrdtool");
    

    閲?#37722;痟ttpd鏈?#37716;?#37731;?#37719;?#37721;?#37930;嬪埌?#26213;鏋?nbsp;service httpd restart

    鏇?#28598;?#37721;?#38000;?http://www.imxylz.info/wiki/Ganglia/Ganglia


    ]]>?#32321;鍏?#23092;呭嚭 Java Concurrency (36): 绾?#32459;?#23033;?part 9 ?#33503;鍙戞?#23940;綔寮?#29999;?#28003;撶郴http://www.5432034.com/xylz/archive/2011/07/12/354206.htmlimxylzimxylzTue, 12 Jul 2011 15:15:00 GMThttp://www.5432034.com/xylz/archive/2011/07/12/354206.htmlhttp://www.5432034.com/xylz/comments/354206.htmlhttp://www.5432034.com/xylz/archive/2011/07/12/354206.html#Feedback3http://www.5432034.com/xylz/comments/commentRss/354206.htmlhttp://www.5432034.com/xylz/services/trackbacks/354206.html?#33503;鍙?#37718;?#23534;?#37711;?#37928;?#23480;?#37711;?#32491;诲?#22557;鏂规?#26338;兘?#32048;鎶涘嚭涓瀹?#37928;?#23534;?#29999;?#38171;?#26473;?#27996;?#23534;?#29999;告弿杩?#27996;?#28000;诲姟鍦?#32510;?#32459;?#23033;犱腑鎵?#29723;屾椂鍙戠敓鐨?#28186;嬪?#26664;儏鍐?#38171;?#38000;岄?#29999;?#26473;?#27996;?#28186;嬪闇瑕佸簲鐢?#32459;嬪簭杩?#29723;屾崟鎹?#37724;屽?#21229;悊銆?/p>

    渚嬪鍦‵uture鎺?#37721;d腑鏈?#28641;?#28051;?#28051;涓狝PI锛?/p>

     

    java.util.concurrent.Future.get(long, TimeUnit) throws InterruptedException, ExecutionException, TimeoutException;

     

    鍦?a href="http://www.5432034.com/xylz/archive/2011/02/13/344207.html" target="_blank">?#22688;闈?#37928;?#32468;犺妭?#33105;鎻?#26473;?#27996;咶uture?#34987;鐨?#37711;?#28003;?#28729;?#37916;?#37720;?#37918;?#37510;?#26473;?#38322;?#28051;嶅啀璁?#29825;?#38171;屼絾鏄?#23011;旇?#20904;?#34249;鐨勬?#28056;嚭鐨?#28051;?#28051;?#23534;?#29999;?#37510;?/p>

    杩?#38322;?#37832;?#28051;绡?#37826;?#32468;?#38171;?a href="http://www.ibm.com/developerworks/cn/java/j-jtp05236.html" target="_blank">Java 鐞?#29825;?#28051;?#28729;?#29882;? 澶勭悊 InterruptedException锛夋弿杩?#27996;咺nterruptedException鐨勬潵?#31790;鍜屽?#21229;悊鏂瑰紡銆傜畝鍗?#37928;?#29831;?#28751;?#37828;?#32510;?#32459;嬪湪鎵?#29723;岀殑杩?#32459;嬩腑琚嚜?#32321;鎴?#38000;呭埆浜轰腑鏂?#27996;?#37510;?#26473;?#37827;跺?#28051;?#27996;嗗?#23941;?#26046;腑鏂?#28751;?#38343;瑕佸?#21229;?#21975;綋?#22688;鐨?#23534;?#29999;?#37510;?/p>

    瀵?#27996;巎ava.lang.Thread鑰岃█锛孖nterruptedException涔?#37828;?#28051;涓?#23536;?#29831;?#23534;?#37928;?#38338;?#26864;?#37510;?/p>

    ?#33105;鏂?#28051;涓?#32510;?#32459;婽hread.interrupt()鏃朵細瑙?#37721;?#28051;嬮潰涓绉嶆儏鍐?#38171;?/p>

    濡?#37835;?#32510;?#32459;嬪湪璋?#37922;?Object ?#34987;鐨?wait()銆亀ait(long) 鎴?wait(long, int) 鏂规硶锛?#37812;?#38000;?#29831;ョ被鐨?join()銆乯oin(long)銆乯oin(long, int)銆乻leep(long) 鎴?sleep(long, int) 鏂规硶杩?#32459;嬩腑鍙?#38339;?#38171;屽垯鍏朵腑鏂?#37912;舵佸皢琚?#23059;呴櫎锛屽?#20909;繕灏?#37824;跺埌涓涓?InterruptedException銆?/p>

    妫娴?#28051;涓?#32510;?#32459;?#37928;勪腑鏂?#37912;舵佹弿杩?#37828;?#26473;欐牱鐨凾hread.interrupted()锛?/strong>

    娴嬭瘯?#32139;?#22688;绾?#32459;?#37828;?#37722;?#23480;茬粡?#33105;鏂?#37510;傜嚎绋?#37928;?em>?#33105;鏂?#37912;舵?/em> 鐢?#29831;?#37826;规硶娓呴櫎銆傛崲鍙?#29831;?#29831;?#38171;屽鏋?#26473;?#32513;?#28051;?#23046;?#29835;?#37922;?#29831;?#37826;规硶锛屽垯绗?#27996;屾璋?#37922;?#28751;?#26473;?#37733;?false锛堝湪绗?#28051;娆?#29835;?#37922;?#23480;?#23059;呴櫎浜?#37711;朵腑鏂?#37912;舵佷箣鍚?#38171;?#28051;旂浜屾璋?#37922;?#22955;楠屽?#23676;腑鏂?#37912;舵佸墠锛屽綋?#22688;绾?#32459;嬪?#23942;?#33105;鏂?#37928;勬儏鍐甸櫎澶?#38171;?#37510;?nbsp;

    涔?#28751;?#37828;?#29831;村鏋滄娴嬪埌涓涓?#32510;?#32459;?#23480;茬粡琚腑鏂?#27996;?#38171;?#38317;?#28052;堢嚎绋?#37928;?#28003;?#37922;?#37826;?#38171;堟寕璧?#37510;?#32475;?#23536;?#37812;?#38000;呮鍦?#37813;?#29723;?#38171;夐兘灏嗗簲璇?#23536;?#37714;?#28051;涓腑鏂?#23534;?#29999;?#38171;?#37722;屾?#36346;?#21973;細娓呴櫎寮?#29999;镐腑鏂?#37912;舵?#37510;?/p>

     

    V innerGet(long nanosTimeout) throws InterruptedException, ExecutionException, TimeoutException {
        
    if (!tryAcquireSharedNanos(0, nanosTimeout))
            
    throw new TimeoutException();
        
    if (getState() == CANCELLED)
            
    throw new CancellationException();
        
    if (exception != null)
            
    throw new ExecutionException(exception);
        
    return result;
    }

     

    涓?#38344;?#38014;?#37721;?#28000;诲姟缁?#37835;?#37928;勬?#35268;硶瀹?#37916;颁腑锛屽皢鍦?#38014;?#37721;?#38335;?#37928;?#26473;?#32459;嬩腑寰?#37714;?#28051;涓腑鏂?#23534;?#29999;?#37510;?#28000;g爜java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(int, long)鎻?#26473;?#27996;?#26473;?#32457;嶆儏鍐?#38171;?br />

        public final boolean tryAcquireSharedNanos(int arg, long nanosTimeout) throws InterruptedException {
        
    if (Thread.interrupted())
            
    throw new InterruptedException();
        
    return tryAcquireShared(arg) >= 0 ||
            doAcquireSharedNanos(arg, nanosTimeout);
        }

     


    杩?#38322;屽湪鑾?#37721;?#38335;?#37928;勬?#36346;欐娴?#32510;?#32459;嬩腑鏂儏鍐?#38171;屽鏋滆?#33105;鏂?#37714;?#23059;呴櫎?#33105;鏂綅锛?#37722;屾?#33333;?#28056;嚭涓涓腑鏂?#23534;?#29999;?#37510;?#28051;?#28000;涔堝?#20635;?#20187;锛熷洜涓?#37812;?#28000;?#37928;勭嚎绋嬪湪绾?#32459;?#23033;犱腑鏄?#29722;?#38322;嶅鎵?#29723;岀殑锛屾墍浠?#28051;鏃?#32510;?#32459;嬭?#33105;鏂?#37722;庡苟涓嶄細閫?#22189;绾?#32459;?#38171;?#38000;?#37828;?#29825;?#32515;腑鏂綅锛岀瓑鍊?#28000;诲姟闃?#37714;楄嚜?#32321;澶勭悊绾?#32459;?#38171;?#28000;?#38000;岃?#24807;?#25198;嚎绋嬭閲嶅?#23941;埄鐢?#37928;?#37929;?#37928;?#37510;?#37832;?#37711;磋叮鐨?#37721;?#28000;?#37721;?#38000;?#28000;g爜java.util.concurrent.ThreadPoolExecutor.Worker.runTask(Runnable)銆?#26473;?#38322;屽湪鍏?#38338;?#32510;?#32459;?#23033;?#37827;跺氨浼氬鑷翠腑鏂?#37813;鏈夌嚎绋?#37510;?/p>

    ?#27342;浜咺nterruptedException 寮?#29999;?#37812;?#28000;?#26473;?#37721;戠幇浜?#28051;涓?#37711;ㄦ柊鐨?#23534;?#29999;竕ava.util.concurrent.TimeoutException锛屾寮?#29999;?#37828;?#37922;?#37833;?#37819;?#26473;?#28000;诲姟鎵?#29723;屾椂闂磋秴杩?#27996;?#37832;?#37832;?#32475;?#23536;呮椂闂?#38171;屼篃璁?#37828;?#28051;鐩存病鏈夎幏鍙?#37714;?#38335;?#38171;屼篃璁?#37828;?#26473;樻病鏈?#37813;?#29723;屽畬鎴?#37510;?/p>

    鍦╥nnerGet浠g爜鐗囨?#20856;腑鎴?#28000;?#37930;嬪埌锛屽鏋?#32510;?#32459;嬪湪鎸?#28729;?#37928;勬椂闂存?#29363;硶鑾?#37721;?#37714;?#38335;?#38171;?#38317;?#28052;堝氨浼氬緱鍒?#28051;涓?#29906;呮椂寮?#29999;?#37510;?#26473;?#28051;?#23536;堝?#30028;悊瑙?#38171;?#23011;?#28641;傚鏋?#37813;?#29723;?#28051;涓潪甯?#38000;?#37827;?#37928;勭?#25120;粶浠诲姟锛?#37812;?#28000;?#28051;?#29999;?#37832;?#28000;诲姟涓鐩?#32475;?#23536;?#28000;?#38000;屽崰鐢?#28598;ч噺鐨?#29863;勬簮锛屽彲?#20824;鍦?#28051;瀹?#37827;?#38338;?#37722;?#28751;变細甯?#37832;?#37721;栨?#22559;鎿嶄綔銆傛鏃惰?#21614;椂寮?#29999;?#23536;堝ソ鐨勬弿杩?#27996;?#26473;?#32457;?#38343;姹?#37510;?/p>

    涓?#23005;?#37722;屾椂锛屽鏋?#37721;栨秷浜?#28051;涓?#28000;诲姟锛?#38317;?#28052;堝?#23942;浠?#28000;诲姟?#33105;鑾?#37721;?#37813;?#29723;岀粨鏋?#38171;?#38317;?#28052;堝?#21973;?#27692;緱鍒?#28051;涓?#28000;诲姟琚?#37721;栨秷鐨?#23534;?#29999;竕ava.util.concurrent.CancellationException銆?/p>

    ?#27342;浜?#28051;?#26473;?#23534;?#29999;?#28598;?#38171;?#26473;?#28751;嗗緱鍒?#28051;涓猨ava.util.concurrent.ExecutionException寮?#29999;?#38171;?/p>

    杩?#37828;洜涓?#37812;?#28000;?#37928;勬彁浜?#37928;?#28000;诲姟java.util.concurrent.Callable鍦╟all()鏂规硶?#33105;鍏佽鎶涘嚭浠?#28003;?#23534;?#29999;?#38171;屽彟澶?#29999;?#29785;?#37928;勭嚎绋?#37813;?#29723;屼篃鍙兘鎶涘嚭涓涓猂untimeException锛屾墍浠?#26473;?#38322;岀畝鍗?#37718;呰浜?#28051;?#37813;鏈?#23534;?#29999;?#38171;屽綋?#32148;鎵?#29723;?#26473;?#32459;嬩腑鍙戠敓鐨?#23534;?#29999;窫xecutionException鎶涘嚭銆?/p>

    浠?#28051;?#28751;?#37828;?#37825;翠釜寮?#29999;?#28003;撶郴锛屾墍鏈夊苟鍙戞?#23940;綔鐨?#23534;?#29999;搁兘鍙?#28000;?#35120;掔粨浜?#28051;?#26473;板嚑?#34987;銆?/p>

    寰堝?#27693;儏鍐?#28051;嬪?#21229;悊鏃?#38338;?#38336;?#25652;﹂兘鏄?#37922;?strong>java.util.concurrent.TimeUnit锛?#26473;?#37828;?#28051;涓?#37835;?#28051;剧?#35826;瀷锛岀敤鏉?#37819;?#26473;?#37827;?#38338;?#38336;?#25652;?#37510;?#37711;朵腑鍐?#32515;?#27996;?#28051;浜?#38336;?#25652;?#37928;?#37719;曚綅銆?#37711;朵腑鍖?#37815;?#32510;?#32457;?#37510;佸井绉?#37510;?#23011;?#32457;?#37510;?#32457;?#37510;佸垎銆佹椂銆佸ぉ銆?#28186;嬪?#20637;?#21614;?#33333;?#23940;綔5绉?#38171;屽彲浠?#28003;?#37922;?/p>

    Future.get(5,TimeUnit.SECONDS) 鎴?#38000;?Future.get(5000L,TimeUnit.MILLISECONDS)

    ?#32139;鐒?#28051;绉嶅崟?#32133;鐨勬椂闂?#26462;?#37817;?#37812;?#37721;?#28051;绉嶅崟?#32133;鐨勬椂闂翠篃鏄潪甯告柟渚?#37928;?#37510;?#37721;?#28598;?#26473;?#37832;夌嚎绋?#37928;剆leep/join浠?#37721;?#28725;硅薄鐨剋ait鎿嶄綔鐨?#28186;?#37817;?#37823;嶄綔銆?/p>

     



    ]]>浜?#37721;楃儹閮?#32515;?#37928;勫ソ澶?/title><link>http://www.5432034.com/xylz/archive/2011/06/17/352476.html</link><dc:creator>imxylz</dc:creator><author>imxylz</author><pubDate>Fri, 17 Jun 2011 01:25:00 GMT</pubDate><guid>http://www.5432034.com/xylz/archive/2011/06/17/352476.html</guid><wfw:comment>http://www.5432034.com/xylz/comments/352476.html</wfw:comment><comments>http://www.5432034.com/xylz/archive/2011/06/17/352476.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.5432034.com/xylz/comments/commentRss/352476.html</wfw:commentRss><trackback:ping>http://www.5432034.com/xylz/services/trackbacks/352476.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="font-family: verdana; font-size: 12px; line-height: normal; background-color: #ffffff; "><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size: 14pt; "><strong>浣?#26473;?#37734;?#28051;?#26864;戠?#20352;儴缃?#37832;?#37716;?#37731;?#38000;岀儲鎭?#28052;?#38171;?br /></strong></span><br />浜?#38171;岃瘯?#30255;jrebel鍚?#37510;?#37831;?#28598;歫rebel鐨?#28000;?#32513;?#37721;?#38000;冭繖閲?a href="http://www.zeroturnaround.com/jrebel/" target="_blank" style="color: #4d87c1; text-decoration: none; font-family: arial; font-weight: bold; font-size: 1.1em; ">http://www.zeroturnaround.com/jrebel/</a>銆?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鍟?#38171;?#37711;?#29840;?#37911;?#37721;兘浣?#37922;?0澶?#38171;熻姳閽?#38171;?#37719;佷釜浜?#37928;勫洟闃?#28003;?#37922;?#28051;骞?#37928;勪?#20343;笟鐗圠icense鏄?span style="font-family: 'Comic Sans MS'; font-size: 18pt; "><strong>2891$</strong></span>锛佷?#29363;病鐪嬮敊锛?#37828;?#37930;?#37930;熸姝?#37928;勭編甯濆浗鐨?#38333;?#38171;?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">濂?#37722;?#38171;?#37812;戠瓑绌?#27996;?#28003;?#37922;?#28051;?#29863;?#38171;屽彧濂?#8220;?#22172;?#32321;?#23017;鎵?涓?#29723;?#29906;抽”銆?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">杩?#38322;屾彁渚?#27996;?#28051;涓?#28729;屾暣鍔熻兘鐨勪?#20343;笟鐗?#38171;?#37711;?#29840;瑰ぇ鐢?#38315;佷簡锛?#37832;?#37832;?#37832;?!!</p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div><a href="http://www.5432034.com/xylz/archive/2011/06/12/352109.html">http://www.5432034.com/xylz/archive/2011/06/12/352109.html</a></div><p> </p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鎬庝?#22556;娇鐢?#38171;?#37832;?#30045;鍗?#37826;瑰紡,鍦╮esin鐨?#37722;姩鏂囦欢锛?#28186;嬪httpd.sh?#33105;澧?#37716;?#38171;?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Resin 3.1+鐗?#37832;?#38171;?/p><blockquote style="background-image: initial; background-color: #fafafa; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: #e5e5e5; border-right-color: #e5e5e5; border-bottom-color: #e5e5e5; border-left-color: #e5e5e5; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; font-size: 10px; "><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">exec $JAVA_EXE <span style="color: #ff0000; "><strong>-javaagent:/opt/apps/resin/jrebel4.0-crack.jar</strong></span> -jar ${RESIN_HOME}/lib/resin.jar $*</p></blockquote><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Resin 3.0-鐗?#37832;?#38171;?/p><blockquote style="background-image: initial; background-color: #fafafa; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: #e5e5e5; border-right-color: #e5e5e5; border-bottom-color: #e5e5e5; border-left-color: #e5e5e5; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; font-size: 10px; "><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">args=”<span style="color: #ff0000; "><strong>-J-javaagent:/opt/apps/resin/jrebel4.0-crack.jar</strong></span>“</p></blockquote><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size: 14pt; ">Tomcat锛烰etty? Jboss? WebLogic? WebSphere? Maven? Eclipse? And More?</span></p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">OK锛屽弬鑰冭繖閲屾枃妗?#37722;?#38171;?a href="http://www.zeroturnaround.com/reference-manual/" target="_blank" style="color: #4d87c1; text-decoration: none; font-family: arial; font-weight: bold; font-size: 1.1em; ">http://www.zeroturnaround.com/reference-manual/</a></p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">浜?#38171;?#28051;嶈?#20352;挶鐨?#38171;岃瘯?#30255;鍚?#38171;?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鏈?#37832;?#37832;?#37831;寸畝鍗?#38171;?#37831;碞B鐨勭儹閮?#32515;?#32457;樼睄鍟?#38171;?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鏈?#37928;?#38171;?#27996;?#38171;?/p><p style="margin-right: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">濡?#37835;滀綘鐨凩inux x86 (x86_64?#32133;鐩墠?#30149;鏈?鐨刧libc鏄?.4+鐗?#37832;?#38171;岃瘯?#30255;<a href="http://ssw.jku.at/dcevm/" target="_blank" style="color: #4d87c1; text-decoration: none; font-family: arial; font-weight: bold; font-size: 1.1em; ">dcevm</a>鍚?#38171;乄indows 32/64?#32133;鍚屾牱鏈?#37929;?#25652;?#37928;勭増鏈?#37727;?#38171;?/p></span><img src ="http://www.5432034.com/xylz/aggbug/352476.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.5432034.com/xylz/" target="_blank">imxylz</a> 2011-06-17 09:25 <a href="http://www.5432034.com/xylz/archive/2011/06/17/352476.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;?#29825;?/a></div>]]></description></item><item><title>Crack JRebel 4.0锛屾棤闇閲?#37722;疛VM锛岀儹閮?#32515;?#29785;?#37712;虫?#35268;http://www.5432034.com/xylz/archive/2011/06/12/352109.htmlimxylzimxylzSat, 11 Jun 2011 16:24:00 GMThttp://www.5432034.com/xylz/archive/2011/06/12/352109.htmlhttp://www.5432034.com/xylz/comments/352109.htmlhttp://www.5432034.com/xylz/archive/2011/06/12/352109.html#Feedback36http://www.5432034.com/xylz/comments/commentRss/352109.htmlhttp://www.5432034.com/xylz/services/trackbacks/352109.htmlhttp://dl.dropbox.com/u/22951342/jrebel.jar  www.zeroturnaround.com鏈杩?#37721;堟帴瑙?#37714;?#28051;?#20579;WEB搴?#37922;?#38171;屾兂鍒癛esin鏈?#37716;?#37731;?#38322;?#37722;?#38343;瑕佽姳璐?#23011;旇?#20904;鐨勬椂闂?#38171;圫pring灏哤EB鏈?#37716;?#37820;?#23536;?#29906;?#37833;?#29906;?#28598;?#37833;?#38171;?#29906;?#37833;?#29906;?#38007;冭偪浜?#38171;?#38171;屾墍浠?#37721;堟兂鍒?#27996;?8骞?#38317;?#37827;跺?#37922;↗avaRebel浜?#37510;?#28051;娈?#37827;?#38338;翠笉鐢?#27996;哄?#36346;眳鐒舵敼鍚?#28051;篔avaRebel浜?#37510;?br />濡?#37835;?#28051;嶇?#29112;倝鐨?#37721;?#28000;?#37820;?#32497;?#28051;婮Rebel/JavaRebel锛?#26473;?#38322;?#37828;?#28729;?#37826;?#32515;戠珯锛?div style="display: inline-block; ">
    www.zeroturnaround.com銆?br />鏈杩戝垰鍙?#29999;?#27996;?.0鐗?#37832;?#38171;屽?#29115;兘鏇?#23534;哄ぇ锛岄?#23943;疆涔?#37831;?#37716;犵畝鍗?#27996;?#37510;?#28000;?#37837;?#28051;嶈彶銆?br />瀹?#37826;规彁渚?0澶╄瘯鐢?#37911;?#38171;屽彲浠?#37711;堜綋楠?#28051;嬪?#23941;喅瀹?#37828;?#37722;?#29840;?#28052;?#37510;?br />
    鐪嬪埌閲岄潰鐨?#28000;?#37934;佹?#38155;穯璁?#37812;戝?#22557;穿婧?#38171;屾病鏈夋繁鍏?#37934;旂?#33333;?#38155;穯鍚庣殑?#32333;琛?#37832;哄埗銆?#23011;?#28641;?#28051;嬮潰灞?#37906;舵湁涓?#28051;?#37722;?#32457;扮浉鍚?#38171;屽?#20635;?#25198;浉鍚?#38171;屼絾鏄?#26473;?#37733;?#37706;?#28051;?#37722;岀殑闈?#37804;佹?#35268;硶锛?#28051;嶇煡鏄?#28641;?#28003;?#37813;?#29723;岀殑銆?br />public static void a(String s)鍜?public static String a(String)锛?#28000;?#37721;?br />private static void c()鍜宲rivate static String c()銆?br />鐚?#23092;?#37828;?#37734;ㄨ繍琛岀?#21228;?#36346;欒嚜?#32321;杩?#29723;孞VM鎸?#28000;?#37928;勬墽琛?#37510;?#26473;欐牱鐨?#28000;?#37934;佸?#23943;紪璇?#37722;庨兘涓嶇煡?#20158;鎬庝?#22557;啓鍥?#37720;?#38171;屾兂鍒板穿婧?#38171;屽洜涓?#28051;?#28051;?#37826;规?#26334;眳鐒堕兘鏈?#37734;?#37826;硅皟鐢?#27996;?#37510;?br />


    zhangthe9 ?#24385;渚?#27996;?#28051;涓?.0鐨勭?#30923;В鐗?#38171;?#37812;戝?#22557;?#34249;锛?#37724;?#29831;?#27996;?#28051;?#38171;屽眳鐒惰繕鏄?#28000;ュ墠鐨凴SA绛?#37722;嶇畻?#30838;銆?/div>
    濂?#37722;?#38171;岀?#35826;嚭08骞村啓鐨凧avaRebel 2.0-M1鐨勭?#30923;В绋嬪簭锛岄?#23942;柊鐢?#37812;?#28051;涓猯icense鏂囦欢锛屼慨鏀?#37711;?#38333;?#38171;?#37831;?#37817;icense鏂囦欢锛屽眳鐒惰繍琛屾甯?#37510;?#26473;欎?#22557;?#27692;?#32736;簡锛岀鍚嶇畻?#30838;鍜屾楠?#28766;?#37906;?#28051;?#20579;?#20824;?#30149;鍙?#38171;屽棷锛?#27996;哄鐪熸墽?#28483;锛?br />?#32139;鐒舵槸鏃犻?#24876;埗鐗?#38171;屾墍鏈?#37716;熻兘鍙?#37922;?#38171;屼?#29112;病鏈?#37827;?#38338;?#38340;愬埗銆?br />

    #############################################################

     JRebel 
    4.0 (201105311152)
       with Enterprise Add
    -On! (see http://jrebel.com/enterprise)
     (c) Copyright ZeroTurnaround OU, Estonia, Tartu.

     Over the last 
    1 days JRebel prevented 
     at least 
    0 redeploys/restarts saving you about 0 hours.

     This product is licensed to www.imxylz.info
     
    for unlimited number of developer seats on site.
     
    == Cracked by imxylz (imxylz#gmail.com) from JavaRebel 2.0-M1, 2008 ==

    #############################################################

    浼?#28598;?#26864;?#29722;?#23011;?#28051;诲腑锛屾寚寮?#37812;?#28000;?#37722;戝墠杩?#38171;?br />jrebel cracked by imxylz
    浼?#28598;?#26864;?#29722;?#23011;?#28051;诲腑锛屾寚寮?#37812;?#28000;?#37722;戝墠杩?#38171;?br />jrebel cracked by imxylz
    JRebel: Reloading class 'ReloadClass'.change 
    浼?#28598;?#26864;?#29722;?#23011;?#28051;诲腑锛屾寚寮?#37812;?#28000;?#37722;戝墠杩?#38171;?br />
    class!

    鐮磋В鎬?#29882;?#23536;堢畝鍗?#38171;?#37831;?#37817;?#37711;?#38333;?#38171;屼娇鐢ㄨ嚜?#32321;绉侀挜鐢?#37812;?#32475;?#37722;峀icense鏂囦欢銆?br />濡?#37835;?#37807;冲?#24538;斀鐗?#37832;?#37831;存柊?#24385;绀?#38171;?#37832;?#28000;?#28051;嬪嚑绉?#37804;?#29882;?#38171;?br />锛?锛?#28103;?#37824;硅皟鐢?#37831;存柊鍧?#37816;?#37928;勭被锛?#38341;鹃亾鏈夌偣澶?#38171;屽洜涓烘?#38155;穯姣旇緝涓?#38322;?#38171;?#28051;?#28729;?#37828;?#37721;嶇紪璇?#38171;?br />锛?锛?#28103;?#37824;?#37831;存柊鏈?#37716;?#37731;?#37928;?#37734;板潃锛屽皢http://update.zeroturnaround.com/jrebel/鍦板潃淇?#37824;?#38171;屽彲浠?#28003;?#37922;?#27996;?#26473;涘埗宸?#37711;?#37929;存帴淇?#37824;瑰?#26947;涓?#38171;?#23011;?#28641;?#37812;戝氨灏唘pdate鏀?#28051;簎pdatt锛屾?#29363;硶瑙?#37835;愬煙鍚嶅氨涓嶈兘鑾?#37721;?#37832;?#26570;鐗?#37832;?#27996;?#37510;?br />锛?锛?#28583;?#37716;?Drebel.disable_update=true鍙傛暟鍗?#37721;?#37510;?#38171;?#26473;?#32457;?#37826;规硶鏈?#30045;鍗?#38171;?#37510;?br />
    ?#32139;鐒?#27996;?#38171;?#28051;?#27996;?#8220;淇?#37814;ょ煡璇嗕骇?#28488;”锛?#28051;嶄?#27692;皢鐮磋В鏂?#28000;舵?#24807;嚭鏉?#38171;?#37832;?#38343;姹?#37928;?#37721;?#28000;?#37923;欒█鑱旂郴銆?#38171;堟墍璋?#37928;?#8220;璁?#32480;?#37832;烘潯渚?#8221;鏄?#37711;佽涓?#27996;嗗涔?#37510;佺?#26050;?#24816;?#26473;?#29723;岀浉鍏?#38315;?#37722;?#23480;?#32459;?#37928;?#38171;屽?#22557;搱锛?#37510;?/strike>

    濂?#37722;?#38171;?#37835;?#28051;?#28003;忓浗浜?#37928;勭儹?#20751;锛?#26473;?#38322;?#37828;?#28051;?#26462;?#37734;板潃锛岄渶瑕?#32520;籜锛屼?#29363;?#20634;緱锛?div style="display: inline-block; ">
    http://dl.dropbox.com/u/22951342/jrebel.jar  

    [鍏?#38335;?#28699;?#38171;?JRebel, JavaRebel, JRebel Crack, JRebel License, JavaRebel License]


    ]]> 11选5时时彩软件
    1. <mark id="ghavm"><button id="ghavm"></button></mark>

        <listing id="ghavm"><strong id="ghavm"></strong></listing>
        <code id="ghavm"></code><rt id="ghavm"><label id="ghavm"><legend id="ghavm"></legend></label></rt>
        1. <tt id="ghavm"><button id="ghavm"></button></tt>

          1. <mark id="ghavm"><button id="ghavm"></button></mark>

              <listing id="ghavm"><strong id="ghavm"></strong></listing>
              <code id="ghavm"></code><rt id="ghavm"><label id="ghavm"><legend id="ghavm"></legend></label></rt>
              1. <tt id="ghavm"><button id="ghavm"></button></tt>

                cf手游官网 矮木头注册 中国福彩中心主任是谁 丝绸之路电子 北京赛车pk10计划 开心点心电子 巴黎圣日耳曼和曼联的门票多少钱 和平精英应用未安装 大航海时代ol17173 卡昂沙发图片及价格