锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产婷婷香蕉久久久久久,亚洲中文字幕无码永久在线,亚洲w码欧洲s码免费 http://m.tkk7.com/paulwong/category/11299.htmlzh-cn Fri, 07 Aug 2015 06:58:36 GMT Fri, 07 Aug 2015 06:58:36 GMT 60 RESTful API 璁捐鎸囧崡 http://m.tkk7.com/paulwong/archive/2015/08/07/426659.htmlpaulwong paulwong Fri, 07 Aug 2015 06:13:00 GMT http://m.tkk7.com/paulwong/archive/2015/08/07/426659.html http://m.tkk7.com/paulwong/comments/426659.html http://m.tkk7.com/paulwong/archive/2015/08/07/426659.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/426659.html http://m.tkk7.com/paulwong/services/trackbacks/426659.html
緗戠粶搴旂敤紼嬪簭錛屽垎涓哄墠绔拰鍚庣涓や釜閮ㄥ垎銆傚綋鍓嶇殑鍙戝睍瓚嬪娍錛屽氨鏄墠绔澶囧眰鍑轟笉絀鳳紙鎵嬫満銆佸鉤鏉褲佹闈㈢數(shù)鑴戙佸叾浠栦笓鐢ㄨ澶?.....錛夈?/p>
鍥犳錛屽繀欏繪湁涓縐嶇粺涓鐨勬満鍒訛紝鏂逛究涓嶅悓鐨勫墠绔澶囦笌鍚庣榪涜閫氫俊銆傝繖瀵艱嚧API鏋勬灦鐨勬祦琛岋紝鐢氳嚦鍑虹幇"API First" 鐨勮璁℃濇兂銆?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">RESTful API鏄洰鍓嶆瘮杈冩垚鐔熺殑涓濂椾簰鑱旂綉搴旂敤紼嬪簭鐨凙PI璁捐鐞嗚銆傛垜浠ュ墠鍐欒繃涓綃?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">銆婄悊瑙ESTful鏋舵瀯銆?/a>錛屾帰璁ㄥ浣曠悊瑙h繖涓蹇點?/p>
浠婂ぉ錛屾垜灝嗕粙緇峈ESTful API鐨勮璁$粏鑺傦紝鎺㈣濡備綍璁捐涓濂楀悎鐞嗐佸ソ鐢ㄧ殑API銆傛垜鐨勪富瑕佸弬鑰冧簡涓ょ瘒鏂囩珷錛?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">1錛?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">2錛夈?/p>
涓銆佸崗璁?/h2> API涓庣敤鎴風殑閫氫俊鍗忚錛屾繪槸浣跨敤HTTPs鍗忚 銆?/p>
浜屻佸煙鍚?/h2> 搴旇灝介噺灝咥PI閮ㄧ講鍦ㄤ笓鐢ㄥ煙鍚嶄箣涓嬨?/p>
https: / / api. example. com
濡傛灉紜畾API寰堢畝鍗曪紝涓嶄細鏈夎繘涓姝ユ墿灞曪紝鍙互鑰冭檻鏀懼湪涓誨煙鍚嶄笅銆?/p>
https: / / example. org/api/
涓夈佺増鏈紙Versioning錛?/h2> 搴旇灝咥PI鐨勭増鏈彿鏀懼叆URL銆?/p>
https: / / api. example. com/v1/
鍙︿竴縐嶅仛娉曟槸錛屽皢鐗堟湰鍙鋒斁鍦℉TTP澶翠俊鎭腑錛屼絾涓嶅鏀懼叆URL鏂逛究鍜岀洿瑙傘?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">Github閲囩敤榪欑鍋氭硶銆?/p>
鍥涖佽礬寰勶紙Endpoint錛?/h2> 璺緞鍙堢О"緇堢偣"錛坋ndpoint錛夛紝琛ㄧずAPI鐨勫叿浣撶綉鍧銆?/p>
鍦≧ESTful鏋舵瀯涓紝姣忎釜緗戝潃浠h〃涓縐嶈祫婧愶紙resource錛夛紝鎵浠ョ綉鍧涓笉鑳芥湁鍔ㄨ瘝錛屽彧鑳芥湁鍚嶈瘝錛岃屼笖鎵鐢ㄧ殑鍚嶈瘝寰寰涓庢暟鎹簱鐨勮〃鏍煎悕瀵瑰簲銆備竴鑸潵璇達紝鏁版嵁搴撲腑鐨勮〃閮芥槸鍚岀璁板綍鐨?闆嗗悎"錛坈ollection錛夛紝鎵浠PI涓殑鍚嶈瘝涔熷簲璇ヤ嬌鐢ㄥ鏁般?/p>
涓句緥鏉ヨ錛屾湁涓涓狝PI鎻愪緵鍔ㄧ墿鍥紙zoo錛夌殑淇℃伅錛岃繕鍖呮嫭鍚勭鍔ㄧ墿鍜岄泧鍛樼殑淇℃伅錛屽垯瀹冪殑璺緞搴旇璁捐鎴愪笅闈㈣繖鏍楓?/p>
https://api.example.com/v1/zoos https://api.example.com/v1/animals https://api.example.com/v1/employees 浜斻丠TTP鍔ㄨ瘝 瀵逛簬璧勬簮鐨勫叿浣撴搷浣滅被鍨嬶紝鐢盚TTP鍔ㄨ瘝琛ㄧず銆?/p>
甯哥敤鐨凥TTP鍔ㄨ瘝鏈変笅闈簲涓紙鎷彿閲屾槸瀵瑰簲鐨凷QL鍛戒護錛夈?/p>
GET錛圫ELECT錛夛細浠庢湇鍔″櫒鍙栧嚭璧勬簮錛堜竴欏規(guī)垨澶氶」錛夈?/li> POST錛圕REATE錛夛細鍦ㄦ湇鍔″櫒鏂板緩涓涓祫婧愩?/li> PUT錛圲PDATE錛夛細鍦ㄦ湇鍔″櫒鏇存柊璧勬簮錛堝鎴風鎻愪緵鏀瑰彉鍚庣殑瀹屾暣璧勬簮錛夈?/li> PATCH錛圲PDATE錛夛細鍦ㄦ湇鍔″櫒鏇存柊璧勬簮錛堝鎴風鎻愪緵鏀瑰彉鐨勫睘鎬э級銆?/li> DELETE錛圖ELETE錛夛細浠庢湇鍔″櫒鍒犻櫎璧勬簮銆?/li> 榪樻湁涓や釜涓嶅父鐢ㄧ殑HTTP鍔ㄨ瘝銆?/p>
HEAD錛氳幏鍙栬祫婧愮殑鍏冩暟鎹?/li> OPTIONS錛氳幏鍙栦俊鎭紝鍏充簬璧勬簮鐨勫摢浜涘睘鎬ф槸瀹㈡埛绔彲浠ユ敼鍙樼殑銆?/li> 涓嬮潰鏄竴浜涗緥瀛愩?/p>
GET /zoos錛氬垪鍑烘墍鏈夊姩鐗╁洯 POST /zoos錛氭柊寤轟竴涓姩鐗╁洯 GET /zoos/ID錛氳幏鍙栨煇涓寚瀹氬姩鐗╁洯鐨勪俊鎭?/li> PUT /zoos/ID錛氭洿鏂版煇涓寚瀹氬姩鐗╁洯鐨勪俊鎭紙鎻愪緵璇ュ姩鐗╁洯鐨勫叏閮ㄤ俊鎭級 PATCH /zoos/ID錛氭洿鏂版煇涓寚瀹氬姩鐗╁洯鐨勪俊鎭紙鎻愪緵璇ュ姩鐗╁洯鐨勯儴鍒嗕俊鎭級 DELETE /zoos/ID錛氬垹闄ゆ煇涓姩鐗╁洯 GET /zoos/ID/animals錛氬垪鍑烘煇涓寚瀹氬姩鐗╁洯鐨勬墍鏈夊姩鐗?/li> DELETE /zoos/ID/animals/ID錛氬垹闄ゆ煇涓寚瀹氬姩鐗╁洯鐨勬寚瀹氬姩鐗?/li> 鍏佽繃婊や俊鎭紙Filtering錛?/h2> 濡傛灉璁板綍鏁伴噺寰堝錛屾湇鍔″櫒涓嶅彲鑳介兘灝嗗畠浠繑鍥炵粰鐢ㄦ埛銆侫PI搴旇鎻愪緵鍙傛暟錛岃繃婊よ繑鍥炵粨鏋溿?/p>
涓嬮潰鏄竴浜涘父瑙佺殑鍙傛暟銆?/p>
?limit=10錛氭寚瀹氳繑鍥炶褰曠殑鏁伴噺 ?offset=10錛氭寚瀹氳繑鍥炶褰曠殑寮濮嬩綅緗?/li> ?page=2&per_page=100錛氭寚瀹氱鍑犻〉錛屼互鍙婃瘡欏電殑璁板綍鏁般?/li> ?sortby=name&order=asc錛氭寚瀹氳繑鍥炵粨鏋滄寜鐓у摢涓睘鎬ф帓搴忥紝浠ュ強鎺掑簭欏哄簭銆?/li> ?animal_type_id=1錛氭寚瀹氱瓫閫夋潯浠?/li> 鍙傛暟鐨勮璁″厑璁稿瓨鍦ㄥ啑浣欙紝鍗沖厑璁窤PI璺緞鍜孶RL鍙傛暟鍋跺皵鏈夐噸澶嶃傛瘮濡傦紝GET /zoo/ID/animals 涓?GET /animals?zoo_id=ID 鐨勫惈涔夋槸鐩稿悓鐨勩?/p>
涓冦佺姸鎬佺爜錛圫tatus Codes錛?/h2> 鏈嶅姟鍣ㄥ悜鐢ㄦ埛榪斿洖鐨勭姸鎬佺爜鍜屾彁紺轟俊鎭紝甯歌鐨勬湁浠ヤ笅涓浜涳紙鏂規(guī)嫭鍙蜂腑鏄鐘舵佺爜瀵瑰簲鐨凥TTP鍔ㄨ瘝錛夈?/p>
200 OK - [GET]錛氭湇鍔″櫒鎴愬姛榪斿洖鐢ㄦ埛璇鋒眰鐨勬暟鎹紝璇ユ搷浣滄槸騫傜瓑鐨勶紙Idempotent錛夈?/li> 201 CREATED - [POST/PUT/PATCH]錛氱敤鎴鋒柊寤烘垨淇敼鏁版嵁鎴愬姛銆?/li> 202 Accepted - [*]錛氳〃紺轟竴涓姹傚凡緇忚繘鍏ュ悗鍙版帓闃燂紙寮傛浠誨姟錛?/li> 204 NO CONTENT - [DELETE]錛氱敤鎴峰垹闄ゆ暟鎹垚鍔熴?/li> 400 INVALID REQUEST - [POST/PUT/PATCH]錛氱敤鎴峰彂鍑虹殑璇鋒眰鏈夐敊璇紝鏈嶅姟鍣ㄦ病鏈夎繘琛屾柊寤烘垨淇敼鏁版嵁鐨勬搷浣滐紝璇ユ搷浣滄槸騫傜瓑鐨勩?/li> 401 Unauthorized - [*]錛氳〃紺虹敤鎴鋒病鏈夋潈闄愶紙浠ょ墝銆佺敤鎴峰悕銆佸瘑鐮侀敊璇級銆?/li> 403 Forbidden - [*] 琛ㄧず鐢ㄦ埛寰楀埌鎺堟潈錛堜笌401閿欒鐩稿錛夛紝浣嗘槸璁塊棶鏄紱佹鐨勩?/li> 404 NOT FOUND - [*]錛氱敤鎴峰彂鍑虹殑璇鋒眰閽堝鐨勬槸涓嶅瓨鍦ㄧ殑璁板綍錛屾湇鍔″櫒娌℃湁榪涜鎿嶄綔錛岃鎿嶄綔鏄箓絳夌殑銆?/li> 406 Not Acceptable - [GET]錛氱敤鎴瘋姹傜殑鏍煎紡涓嶅彲寰楋紙姣斿鐢ㄦ埛璇鋒眰JSON鏍煎紡錛屼絾鏄彧鏈塜ML鏍煎紡錛夈?/li> 410 Gone -[GET]錛氱敤鎴瘋姹傜殑璧勬簮琚案涔呭垹闄わ紝涓斾笉浼氬啀寰楀埌鐨勩?/li> 422 Unprocesable entity - [POST/PUT/PATCH] 褰撳垱寤轟竴涓璞℃椂錛屽彂鐢熶竴涓獙璇侀敊璇?/li> 500 INTERNAL SERVER ERROR - [*]錛氭湇鍔″櫒鍙戠敓閿欒錛岀敤鎴峰皢鏃犳硶鍒ゆ柇鍙戝嚭鐨勮姹傛槸鍚︽垚鍔熴?/li> 鐘舵佺爜鐨勫畬鍏ㄥ垪琛ㄥ弬瑙?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">榪欓噷銆?/p>
鍏侀敊璇鐞嗭紙Error handling錛?/h2> 濡傛灉鐘舵佺爜鏄?xx錛屽氨搴旇鍚戠敤鎴瘋繑鍥炲嚭閿欎俊鎭備竴鑸潵璇達紝榪斿洖鐨勪俊鎭腑灝唀rror浣滀負閿悕錛屽嚭閿欎俊鎭綔涓洪敭鍊煎嵆鍙?/p>
{ error: "Invalid API key" }
涔?jié)銆佽繑鍥炵粨鏋?/h2> 閽堝涓嶅悓鎿嶄綔錛屾湇鍔″櫒鍚戠敤鎴瘋繑鍥炵殑緇撴灉搴旇絎﹀悎浠ヤ笅瑙勮寖銆?/p>
GET /collection錛氳繑鍥炶祫婧愬璞$殑鍒楄〃錛堟暟緇勶級 GET /collection/resource錛氳繑鍥炲崟涓祫婧愬璞?/li> POST /collection錛氳繑鍥炴柊鐢熸垚鐨勮祫婧愬璞?/li> PUT /collection/resource錛氳繑鍥炲畬鏁寸殑璧勬簮瀵硅薄 PATCH /collection/resource錛氳繑鍥炲畬鏁寸殑璧勬簮瀵硅薄 DELETE /collection/resource錛氳繑鍥炰竴涓┖鏂囨。 鍗併丠ypermedia API RESTful API鏈濂藉仛鍒癏ypermedia錛屽嵆榪斿洖緇撴灉涓彁渚涢摼鎺ワ紝榪炲悜鍏朵粬API鏂規(guī)硶錛屼嬌寰楃敤鎴蜂笉鏌ユ枃妗o紝涔熺煡閬撲笅涓姝ュ簲璇ュ仛浠涔堛?/p>
姣斿錛屽綋鐢ㄦ埛鍚慳pi.example.com鐨勬牴鐩綍鍙戝嚭璇鋒眰錛屼細寰楀埌榪欐牱涓涓枃妗c?/p>
{ "link" : { "rel" : "collection https://www.example.com/zoos " , "href" : "https://api.example.com/zoos " , "title" : "List of zoos" , "type" : "application/vnd.yourformat+json" } }
涓婇潰浠g爜琛ㄧず錛屾枃妗d腑鏈変竴涓猯ink灞炴э紝鐢ㄦ埛璇誨彇榪欎釜灞炴у氨鐭ラ亾涓嬩竴姝ヨ璋冪敤浠涔圓PI浜嗐俽el琛ㄧず榪欎釜API涓庡綋鍓嶇綉鍧鐨勫叧緋伙紙collection鍏崇郴錛屽茍緇欏嚭璇ollection鐨勭綉鍧錛夛紝href琛ㄧずAPI鐨勮礬寰勶紝title琛ㄧずAPI鐨勬爣棰橈紝type琛ㄧず榪斿洖綾誨瀷銆?/p>
Hypermedia API鐨勮璁¤縐頒負HATEOAS 銆侴ithub鐨凙PI灝辨槸榪欑璁捐錛岃闂?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">api.github.com浼氬緱鍒頒竴涓墍鏈夊彲鐢ˋPI鐨勭綉鍧鍒楄〃銆?/p>
{ "current_user_url" : "https://api.github.com/user " , "authorizations_url" : "https://api.github.com/authorizations " , // ... }
浠庝笂闈㈠彲浠ョ湅鍒幫紝濡傛灉鎯寵幏鍙栧綋鍓嶇敤鎴風殑淇℃伅錛屽簲璇ュ幓璁塊棶api.github.com/user 錛岀劧鍚庡氨寰楀埌浜嗕笅闈㈢粨鏋溿?/p>
{ "message" : "Requires authentication" , "documentation_url" : "https://developer.github.com/v3 " }
涓婇潰浠g爜琛ㄧず錛屾湇鍔″櫒緇欏嚭浜嗘彁紺轟俊鎭紝浠ュ強鏂囨。鐨勭綉鍧銆?/p>
鍗佷竴銆佸叾浠?/h2> 錛?錛堿PI鐨勮韓浠借璇佸簲璇ヤ嬌鐢?a target="_blank" style="margin: 0px; padding: 0px; list-style-type: none; border: none; color: #112233;">OAuth 2.0妗嗘灦銆?/p>
錛?錛夋湇鍔″櫒榪斿洖鐨勬暟鎹牸寮忥紝搴旇灝介噺浣跨敤JSON錛岄伩鍏嶄嬌鐢╔ML銆?/p>
錛堝畬錛?/p>
]]>WEB鐗堢殑REST嫻嬭瘯宸ュ叿 http://m.tkk7.com/paulwong/archive/2015/05/27/425327.htmlpaulwong paulwong Wed, 27 May 2015 06:12:00 GMT http://m.tkk7.com/paulwong/archive/2015/05/27/425327.html http://m.tkk7.com/paulwong/comments/425327.html http://m.tkk7.com/paulwong/archive/2015/05/27/425327.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/425327.html http://m.tkk7.com/paulwong/services/trackbacks/425327.html http://hackst.com/ http://www.quadrillian.com/ ]]>maven3 jetty jrebel 鎼緩鍙皟寮忕殑寮鍙戠幆澧?/title> http://m.tkk7.com/paulwong/archive/2015/05/10/424979.htmlpaulwong paulwong Sun, 10 May 2015 12:53:00 GMT http://m.tkk7.com/paulwong/archive/2015/05/10/424979.html http://m.tkk7.com/paulwong/comments/424979.html http://m.tkk7.com/paulwong/archive/2015/05/10/424979.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/424979.html http://m.tkk7.com/paulwong/services/trackbacks/424979.html http://my.oschina.net/edeis2012/blog/68831http://chen-rojer-gmail-com.iteye.com/blog/910748 ]]> 鍒嗗竷寮忛厤緗鐞嗗鉤鍙癉isconf http://m.tkk7.com/paulwong/archive/2015/04/13/424366.htmlpaulwong paulwong Mon, 13 Apr 2015 08:12:00 GMT http://m.tkk7.com/paulwong/archive/2015/04/13/424366.html http://m.tkk7.com/paulwong/comments/424366.html http://m.tkk7.com/paulwong/archive/2015/04/13/424366.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/424366.html http://m.tkk7.com/paulwong/services/trackbacks/424366.html http://www.oschina.net/p/disconfDisconf 鍙互涓哄悇縐嶄笟鍔″鉤鍙版彁渚涚粺涓鐨勯厤緗鐞嗘湇鍔°?/p>
閲嶈鍔熻兘鐗圭偣 娉細閰嶇疆欏規(guī)槸鎸囨煇涓被閲岀殑鏌愪釜Field瀛楁銆?/p>
Disconf鐨勫姛鑳界壒鐐規(guī)弿榪板浘錛?/strong>
鏌ョ湅澶у浘
鍏跺畠鍔熻兘鐗圭偣 浣庝鏡鍏ユф垨鏃犱鏡鍏ユс佸己鍏煎鎬?/strong>錛?/p>
浣庝鏡鍏ユэ細閫氳繃鏋佸皯鐨勬敞瑙e紡浠g爜鎾板啓錛屽嵆鍙疄鐜板垎甯冨紡閰嶇疆銆?/p>
鏃犱鏡鍏ユэ細閫氳繃XML綆鍗曢厤緗紝鍗沖彲瀹炵幇鍒嗗竷寮忛厤緗?/p>
寮哄吋瀹規(guī)э細涓虹▼搴忔坊鍔犱簡鍒嗗竷寮忛厤緗敞瑙e悗錛屽紑鍚疍isconf鍒欎嬌鐢ㄥ垎甯冨紡閰嶇疆錛涜嫢鍏抽棴Disconf鍒欎嬌鐢ㄦ湰鍦伴厤緗紱鑻ュ紑鍚疍isconf鍚巇isconf-web涓嶈兘姝e父Work錛屽垯Disconf浣跨敤鏈湴閰嶇疆銆?/p>
鏀寔閰嶇疆欏瑰涓」鐩叡浜紝鏀寔鎵歸噺澶勭悊欏圭洰閰嶇疆 銆?/p>
閰嶇疆鐩戞帶 錛氬鉤鍙版彁渚涜嚜鏍¢獙鍔熻兘錛堣繘涓姝ユ彁楂樼ǔ瀹氭э級錛屽彲浠ュ畾鏃舵牎楠屽簲鐢ㄧ郴緇熺殑閰嶇疆鏄惁姝g‘銆?/p>
妯″潡鏋舵瀯鍥?/h2>
]]> JAVAEE璧勬簮 http://m.tkk7.com/paulwong/archive/2014/12/26/421859.htmlpaulwong paulwong Fri, 26 Dec 2014 08:29:00 GMT http://m.tkk7.com/paulwong/archive/2014/12/26/421859.html http://m.tkk7.com/paulwong/comments/421859.html http://m.tkk7.com/paulwong/archive/2014/12/26/421859.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/421859.html http://m.tkk7.com/paulwong/services/trackbacks/421859.html
http://www.importnew.com/12408.html
Java EE + MongoDb with Apache TomEE and Jongo Starter Project
http://www.javacodegeeks.com/2014/09/java-ee-mongodb-with-apache-tomee-and-jongo-starter-project.html
From Spring to Java EE 6
http://www.javacodegeeks.com/2011/11/from-spring-to-java-ee-6.html
Java EE 7 and WebSocket API for Java (JSR 356) with AngularJS on WildFlyhttp://www.javacodegeeks.com/2014/01/java-ee-7-and-websocket-api-for-java-jsr-356-with-angularjs-on-wildfly.html lll ]]> 鍒嗗竷寮忚皟搴UARTZ+SPRING http://m.tkk7.com/paulwong/archive/2014/11/14/420104.htmlpaulwong paulwong Fri, 14 Nov 2014 10:46:00 GMT http://m.tkk7.com/paulwong/archive/2014/11/14/420104.html http://m.tkk7.com/paulwong/comments/420104.html http://m.tkk7.com/paulwong/archive/2014/11/14/420104.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/420104.html http://m.tkk7.com/paulwong/services/trackbacks/420104.html 瑙﹀彂鍣細瀛樻斁鏃墮棿鎺掔▼ 浠誨姟錛氳敓涓氬姟浠g爜 鎺掔▼鍣細璐熻矗璋冨害錛屽嵆鍦ㄦ寚瀹氱殑鏃墮棿鎵ц瀵瑰簲鐨勪換鍔?br /> 濡傛灉鏄垎甯冨紡QUARTZ錛屽垯鍚勪釜鑺傜偣浼氫笂鎶ヤ換鍔★紝瀛樺埌鏁版嵁搴撲腑錛屾墽琛屾椂浼氫粠鏁版嵁搴撲腑鍙栧嚭瑙﹀彂鍣ㄦ潵鎵ц錛屽鏋滆Е鍙戝櫒鐨勫悕縐板拰鎵ц鏃墮棿鐩稿悓錛屽垯鍙湁涓涓妭鐐瑰幓鎵ц姝や換鍔°?br />濡傛灉姝よ妭鐐規(guī)墽琛屽け璐ワ紝鍒欐浠誨姟鍒欎細琚垎媧懼埌鍙︿竴鑺傜偣鎵ц銆?br />quartz.properties
# ============================================================================ # Configure JobStore # Using Spring datasource in quartzJobsConfig.xml # Spring uses LocalDataSourceJobStore extension of JobStoreCMT #============================================================================ org.quartz.jobStore.useProperties=true org.quartz.jobStore.tablePrefix = QRTZ_ org.quartz.jobStore.isClustered = true org.quartz.jobStore.clusterCheckinInterval = 5000 org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.txIsolationLevelReadCommitted = true # Change this to match your DB vendor org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate # ============================================================================ # Configure Main Scheduler Properties # Needed to manage cluster instances #============================================================================ org.quartz.scheduler.instanceId=AUTO org.quartz.scheduler.instanceName=MY_CLUSTERED_JOB_SCHEDULER org.quartz.scheduler.rmi.export = false org.quartz.scheduler.rmi.proxy = false# ============================================================================ # Configure ThreadPool #============================================================================ org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount = 10 org.quartz.threadPool.threadPriority = 5 org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
web-schedule-applicationcontext.xml
<? xml version="1.0" encoding="UTF-8" ?> < beans xmlns ="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context ="http://www.springframework.org/schema/context" xmlns:mongo="http://www.springframework.org/schema/data/mongo" xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" > <!-- 澧炲姞瀹氭椂鍣ㄩ厤緗?nbsp; --> <!-- 綰跨▼鎵ц鍣ㄩ厤緗紝鐢ㄤ簬浠誨姟娉ㄥ唽 --> < bean id ="executor" class ="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" > < property name ="corePoolSize" value ="10" /> < property name ="maxPoolSize" value ="100" /> < property name ="queueCapacity" value ="500" /> </ bean > <!-- 璁劇疆璋冨害 --> < bean id ="webScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" > < property name ="configLocation" value ="classpath:/properties/config/quartz.properties" /> < property name ="dataSource" ref ="dataSourceCMS" /> < property name ="transactionManager" ref ="txManager" /> <!-- This name is persisted as SCHED_NAME in db. for local testing could change to unique name to avoid collision with dev server --> < property name ="schedulerName" value ="quartzScheduler" /> <!-- Will update database cron triggers to what is in this jobs file on each deploy. Replaces all previous trigger and job data that was in the database. YMMV --> < property name ="overwriteExistingJobs" value ="true" /> < property name ="startupDelay" value ="5" /> < property name ="applicationContextSchedulerContextKey" value ="applicationContext" /> < property name ="jobFactory" > < bean class ="com.tcl.project7.boss.common.scheduling.AutowiringSpringBeanJobFactory" /> </ property > < property name ="triggers" > < list > < ref bean ="springQuertzClusterTaskSchedulerTesterTigger" /> </ list > </ property > < property name ="jobDetails" > < list > < ref bean ="springQuertzClusterTaskSchedulerTesterJobDetail" /> </ list > </ property > < property name ="taskExecutor" ref ="executor" /> </ bean > <!-- 瑙﹀彂鍣?nbsp; --> < bean id ="springQuertzClusterTaskSchedulerTesterTigger" class ="common.scheduling.PersistableCronTriggerFactoryBean" > < property name ="jobDetail" ref ="springQuertzClusterTaskSchedulerTesterJobDetail" /> < property name ="cronExpression" value ="* * * * * ?" /> </ bean > < bean id ="springQuertzClusterTaskSchedulerTesterJobDetail" class ="org.springframework.scheduling.quartz.JobDetailBean" > < property name ="jobClass" value ="common.scheduling.SpringQuertzClusterTaskSchedulerTester" /> <!-- fail-over 閲嶅啓鎵ц澶辮觸鐨勪換鍔?default=false --> < property name ="requestsRecovery" value ="false" /> </ bean > </ beans >
JOB鏂囦歡錛歋pringQuertzClusterTaskSchedulerTester.javapackage common.scheduling;import java.util.Date;import org.quartz.JobExecutionContext;import org.quartz.JobExecutionException;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.scheduling.quartz.QuartzJobBean;import com.tcl.project7.boss.common.util.UrlUtil;import com.tcl.project7.boss.common.util.time.TimeUtils;/** * <p>Title:SpringQuertzClusterTaskSchedulerTester</p> * <p>Description: * 搴斾負瑕佹寔涔呭寲絳夌壒鎬ф搷浣?闇瑕佺戶鎵?nbsp;QuartzJobBean * <br>鐢變簬瑕佽鎸佷箙鍖?鎵浠ヤ笉鑳藉瓨鏀緓xxxManager綾諱技瀵硅薄, * 鍙兘浠庢瘡嬈′粠QuartzJobBean娉ㄥ叆鐨凙pplicationContext 涓幓鍙栧嚭 * * </p> * * */ public class SpringQuertzClusterTaskSchedulerTester extends QuartzJobBean { private static Logger logger = LoggerFactory.getLogger(SpringQuertzClusterTaskSchedulerTester.class ); @Autowired private UrlUtil urlUtil; protected void executeInternal(JobExecutionContext arg0) throws JobExecutionException { logger.info("------" + TimeUtils.formatTime(new Date()) + "------" + urlUtil.getNginxHost()); System.out.println("------" + TimeUtils.formatTime(new Date()) + "------" + urlUtil.getNginxHost()); } }
濡傛灉JOB涓湁闇瑕佽皟鐢⊿PRING鐨凚EAN錛屽垯闇瑕佹鏂囦歡AutowiringSpringBeanJobFactory.javapackage common.scheduling;import org.quartz.spi.TriggerFiredBundle;import org.springframework.beans.factory.config.AutowireCapableBeanFactory;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframework.scheduling.quartz.SpringBeanJobFactory;/** * Autowire Quartz Jobs with Spring context dependencies * @see http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030 #15211030 */ public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware { private transient AutowireCapableBeanFactory beanFactory; public void setApplicationContext(final ApplicationContext context) { beanFactory = context.getAutowireCapableBeanFactory(); } @Override protected Object createJobInstance(final TriggerFiredBundle bundle) throws Exception { final Object job = super .createJobInstance(bundle); beanFactory.autowireBean(job); return job; } }
鐢變簬JOB闇瑕佸瓨鍌ㄥ埌鏁版嵁搴撲腑錛屼細浜х敓PROPERTY鐨勯棶棰橈紝闇鍓旈櫎JOB-DATA錛岄渶姝ゆ枃浠禤ersistableCronTriggerFactoryBean.javapackage common.scheduling;import org.springframework.scheduling.quartz.CronTriggerFactoryBean;import org.springframework.scheduling.quartz.JobDetailAwareTrigger;/** * Needed to set Quartz useProperties=true when using Spring classes, * because Spring sets an object reference on JobDataMap that is not a String * * @see http://site.trimplement.com/using-spring-and-quartz-with-jobstore-properties/ * @see http://forum.springsource.org/showthread.php?130984-Quartz-error-IOException */ public class PersistableCronTriggerFactoryBean extends CronTriggerFactoryBean { @Override public void afterPropertiesSet() { super .afterPropertiesSet(); // Remove the JobDetail element getJobDataMap().remove(JobDetailAwareTrigger.JOB_DETAIL_KEY); } }
寤鴻〃璇彞錛孧YSQL錛歲uartzTables.sql# # Quartz seems to work best with the driver mm.mysql- 2.0 .7 - bin.jar # # In your Quartz properties file , you' ll need to set # org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate # DROP TABLE IF EXISTS QRTZ_JOB_LISTENERS; DROP TABLE IF EXISTS QRTZ_TRIGGER_LISTENERS; DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS; DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS; DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE; DROP TABLE IF EXISTS QRTZ_LOCKS; DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS; DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS; DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS; DROP TABLE IF EXISTS QRTZ_TRIGGERS; DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; DROP TABLE IF EXISTS QRTZ_CALENDARS; CREATE TABLE QRTZ_JOB_DETAILS ( JOB_NAME VARCHAR(200) NOT NULL, JOB_GROUP VARCHAR(200) NOT NULL, DESCRIPTION VARCHAR(250) NULL, JOB_CLASS_NAME VARCHAR(250) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, JOB_DATA BLOB NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP) ); CREATE TABLE QRTZ_JOB_LISTENERS ( JOB_NAME VARCHAR(200) NOT NULL, JOB_GROUP VARCHAR(200) NOT NULL, JOB_LISTENER VARCHAR(200) NOT NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER), FOREIGN KEY (JOB_NAME,JOB_GROUP) REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP) ); CREATE TABLE QRTZ_TRIGGERS ( TRIGGER_NAME VARCHAR(200) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, JOB_NAME VARCHAR(200) NOT NULL, JOB_GROUP VARCHAR(200) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, DESCRIPTION VARCHAR(250) NULL, NEXT_FIRE_TIME BIGINT(13) NULL, PREV_FIRE_TIME BIGINT(13) NULL, PRIORITY INTEGER NULL, TRIGGER_STATE VARCHAR(16) NOT NULL, TRIGGER_TYPE VARCHAR(8) NOT NULL, START_TIME BIGINT(13) NOT NULL, END_TIME BIGINT(13) NULL, CALENDAR_NAME VARCHAR(200) NULL, MISFIRE_INSTR SMALLINT(2) NULL, JOB_DATA BLOB NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (JOB_NAME,JOB_GROUP) REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP) ); CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( TRIGGER_NAME VARCHAR(200) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, REPEAT_COUNT BIGINT(7) NOT NULL, REPEAT_INTERVAL BIGINT(12) NOT NULL, TIMES_TRIGGERED BIGINT(10) NOT NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP) ); CREATE TABLE QRTZ_CRON_TRIGGERS ( TRIGGER_NAME VARCHAR(200) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, CRON_EXPRESSION VARCHAR(200) NOT NULL, TIME_ZONE_ID VARCHAR(80), PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP) ); CREATE TABLE QRTZ_BLOB_TRIGGERS ( TRIGGER_NAME VARCHAR(200) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, BLOB_DATA BLOB NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP) ); CREATE TABLE QRTZ_TRIGGER_LISTENERS ( TRIGGER_NAME VARCHAR(200) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, TRIGGER_LISTENER VARCHAR(200) NOT NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP) ); CREATE TABLE QRTZ_CALENDARS ( CALENDAR_NAME VARCHAR(200) NOT NULL, CALENDAR BLOB NOT NULL, PRIMARY KEY (CALENDAR_NAME) ); CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( TRIGGER_GROUP VARCHAR(200) NOT NULL, PRIMARY KEY (TRIGGER_GROUP) ); CREATE TABLE QRTZ_FIRED_TRIGGERS ( ENTRY_ID VARCHAR(95) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, INSTANCE_NAME VARCHAR(200) NOT NULL, FIRED_TIME BIGINT(13) NOT NULL, PRIORITY INTEGER NOT NULL, STATE VARCHAR(16) NOT NULL, JOB_NAME VARCHAR(200) NULL, JOB_GROUP VARCHAR(200) NULL, IS_STATEFUL VARCHAR(1) NULL, REQUESTS_RECOVERY VARCHAR(1) NULL, PRIMARY KEY (ENTRY_ID) ); CREATE TABLE QRTZ_SCHEDULER_STATE ( INSTANCE_NAME VARCHAR(200) NOT NULL, LAST_CHECKIN_TIME BIGINT(13) NOT NULL, CHECKIN_INTERVAL BIGINT(13) NOT NULL, PRIMARY KEY (INSTANCE_NAME) ); CREATE TABLE QRTZ_LOCKS ( LOCK_NAME VARCHAR(40) NOT NULL, PRIMARY KEY (LOCK_NAME) ); INSERT INTO QRTZ_LOCKS values( ' TRIGGER_ACCESS' ); INSERT INTO QRTZ_LOCKS values( ' JOB_ACCESS' ); INSERT INTO QRTZ_LOCKS values( ' CALENDAR_ACCESS' ); INSERT INTO QRTZ_LOCKS values( ' STATE_ACCESS' ); INSERT INTO QRTZ_LOCKS values( ' MISFIRE_ACCESS' ); commit;
鍙傝冿細http://wenku.baidu.com/view/82e3bcbdfd0a79563c1e7223.html Quartz闆嗘垚springMVC 鐨勬柟妗堜簩錛堟寔涔呭寲浠誨姟銆侀泦緹ゅ拰鍒嗗竷寮忥級http://blog.csdn.net/congcong68/article/details/39256307 ]]> Spring瀵笻ttpSession鐨勯噸鏂板皝闂?/title> http://m.tkk7.com/paulwong/archive/2014/08/19/417090.htmlpaulwong paulwong Tue, 19 Aug 2014 01:13:00 GMT http://m.tkk7.com/paulwong/archive/2014/08/19/417090.html http://m.tkk7.com/paulwong/comments/417090.html http://m.tkk7.com/paulwong/archive/2014/08/19/417090.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/417090.html http://m.tkk7.com/paulwong/services/trackbacks/417090.html https://github.com/spring-projects/spring-session/tree/master/samples ]]> 杞紙鎺㈣鍒嗗竷寮忕郴緇熶笌闆嗙兢鐨勫尯鍒級 http://m.tkk7.com/paulwong/archive/2014/05/23/414022.htmlpaulwong paulwong Fri, 23 May 2014 05:27:00 GMT http://m.tkk7.com/paulwong/archive/2014/05/23/414022.html http://m.tkk7.com/paulwong/comments/414022.html http://m.tkk7.com/paulwong/archive/2014/05/23/414022.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/414022.html http://m.tkk7.com/paulwong/services/trackbacks/414022.html 綆鍗曡錛屽垎甯冨紡鏄互緙╃煭鍗曚釜浠誨姟鐨勬墽琛屾椂闂存潵鎻愬崌鏁堢巼鐨勶紝鑰岄泦緹ゅ垯鏄氳繃鎻愰珮鍗曚綅鏃墮棿鍐呮墽琛岀殑浠誨姟鏁版潵鎻愬崌鏁堢巼銆?/p>銆銆渚嬪錛氬鏋滀竴涓換鍔$敱10涓瓙浠誨姟緇勬垚錛屾瘡涓瓙浠誨姟鍗曠嫭鎵ц闇1灝忔椂錛屽垯鍦ㄤ竴鍙?a target="_blank" rel="nofollow" style="padding: 0px; margin: 0px; color: #ff8373; outline: 0px; font-size: 12px;">鏈嶅姟鍣?/a>涓婃墽琛屾敼浠誨姟闇10灝忔椂銆?/p>
銆銆閲囩敤鍒嗗竷寮忔柟妗堬紝鎻愪緵10鍙?a target="_blank" rel="nofollow" style="padding: 0px; margin: 0px; color: #ff8373; outline: 0px; font-size: 12px;">鏈嶅姟鍣?/a>錛屾瘡鍙版湇鍔″櫒鍙礋璐e鐞嗕竴涓瓙浠誨姟錛屼笉鑰冭檻瀛愪換鍔¢棿鐨勪緷璧栧叧緋伙紝鎵ц瀹岃繖涓換鍔″彧闇涓涓皬鏃躲?/p>
銆銆鑰岄噰鐢ㄩ泦緹ゆ柟妗堬紝鍚屾牱鎻愪緵10鍙版湇鍔″櫒錛屾瘡鍙版湇鍔″櫒閮借兘鐙珛澶勭悊榪欎釜浠誨姟銆傚亣璁炬湁10涓換鍔″悓鏃跺埌杈撅紝10涓湇鍔″櫒灝嗗悓鏃跺伐浣滐紝10灝忓悗錛?0涓換鍔″悓鏃跺畬鎴愶紝榪欐牱錛屾暣韜潵鐪嬶紝榪樻槸1灝忔椂鍐呭畬鎴愪竴涓換鍔?
銆銆闆嗙兢姒傚康
銆銆1. 涓ゅぇ鍏抽敭鐗規(guī)?/strong>
銆銆闆嗙兢鏄竴緇勫崗鍚屽伐浣滅殑鏈嶅姟瀹炰綋錛岀敤浠ユ彁渚涙瘮鍗曚竴鏈嶅姟瀹炰綋鏇村叿鎵╁睍鎬т笌鍙敤鎬х殑鏈嶅姟騫沖彴銆傚湪瀹㈡埛绔湅鏉ワ紝涓涓泦緹ゅ氨璞℃槸涓涓湇鍔″疄浣擄紝浣嗕簨瀹炰笂闆嗙兢鐢變竴緇勬湇鍔″疄浣撶粍鎴愩備笌鍗曚竴鏈嶅姟瀹炰綋鐩告瘮杈冿紝闆嗙兢鎻愪緵浜嗕互涓嬩袱涓叧閿壒鎬э細
銆銆· 鍙墿灞曟?- 闆嗙兢鐨勬ц兘涓嶉檺浜庡崟涓鐨勬湇鍔″疄浣擄紝鏂扮殑鏈嶅姟瀹炰綋鍙互鍔ㄦ佸湴鍔犲叆鍒伴泦緹わ紝浠庤屽寮洪泦緹ょ殑鎬ц兘銆?/p>
銆銆· 楂樺彲鐢ㄦ?- 闆?緹ら氳繃鏈嶅姟瀹炰綋鍐椾綑浣垮鎴風鍏嶄簬杞繪槗閬囧埌out of service鐨勮鍛娿傚湪闆嗙兢涓紝鍚屾牱鐨勬湇鍔″彲浠ョ敱澶氫釜鏈嶅姟瀹炰綋鎻愪緵銆傚鏋滀竴涓湇鍔″疄浣撳け璐ヤ簡錛屽彟涓涓湇鍔″疄浣撲細鎺ョ澶辮觸鐨勬湇鍔″疄浣撱傞泦緹ゆ彁渚涚殑浠庝竴涓嚭 閿欑殑鏈嶅姟瀹炰綋鎭㈠鍒板彟涓涓湇鍔″疄浣撶殑鍔熻兘澧炲己浜嗗簲鐢ㄧ殑鍙敤鎬с?/p>
銆銆2. 涓ゅぇ鑳藉姏
銆銆涓轟簡鍏鋒湁鍙墿灞曟у拰楂樺彲鐢ㄦх壒鐐癸紝闆嗙兢鐨勫繀欏誨叿澶囦互涓嬩袱澶ц兘鍔涳細
銆銆· 璐熻澆鍧囪 -- 璐熻澆鍧囪 鑳芥妸浠誨姟姣旇緝鍧囪 鍦板垎甯冨埌闆嗙兢鐜涓嬬殑璁$畻鍜岀綉緇滆祫婧愩?/p>
銆銆· 閿欒鎭㈠-- 鐢變簬鏌愮鍘熷洜錛屾墽琛屾煇涓換鍔$殑璧勬簮鍑虹幇鏁呴殰錛屽彟涓鏈嶅姟瀹炰綋涓墽琛屽悓涓浠誨姟鐨勮祫婧愭帴鐫瀹屾垚浠誨姟銆傝繖縐嶇敱浜庝竴涓疄浣撲腑鐨勮祫婧愪笉鑳藉伐浣滐紝鍙︿竴涓疄浣撲腑鐨勮祫婧愰忔槑鐨勭戶緇畬鎴愪換鍔$殑榪囩▼鍙敊璇仮澶嶃?/p>
銆銆璐熻澆鍧囪 鍜岄敊璇仮澶嶉兘瑕佹眰鍚勬湇鍔″疄浣撲腑鏈夋墽琛屽悓涓浠誨姟鐨勮祫婧愬瓨鍦紝鑰屼笖瀵逛簬鍚屼竴浠誨姟鐨勫悇涓祫婧愭潵璇達紝鎵ц浠誨姟鎵闇鐨勪俊鎭鍥?淇℃伅涓婁笅鏂?蹇呴』鏄竴鏍風殑銆?/p>
銆銆3. 涓ゅぇ鎶鏈?/strong>
銆銆瀹炵幇闆嗙兢鍔″繀瑕佹湁浠ヤ笅涓ゅぇ鎶鏈細
銆銆· 闆嗙兢鍦板潃-- 闆?緹ょ敱澶氫釜鏈嶅姟瀹炰綋緇勬垚錛岄泦緹ゅ鎴風閫氳繃璁塊棶闆嗙兢鐨勯泦緹ゅ湴鍧鑾峰彇闆嗙兢鍐呴儴鍚勬湇鍔″疄浣撶殑鍔熻兘銆傚叿鏈夊崟涓闆嗙兢鍦板潃(涔熷彨鍗曚竴褰卞儚)鏄泦緹ょ殑涓涓熀 鏈壒寰併傜淮鎶ら泦緹ゅ湴鍧鐨勮緗縐頒負璐熻澆鍧囪 鍣ㄣ傝礋杞藉潎琛″櫒鍐呴儴璐熻矗綆$悊鍚勪釜鏈嶅姟瀹炰綋鐨勫姞鍏ュ拰閫鍑猴紝澶栭儴璐熻矗闆嗙兢鍦板潃鍚戝唴閮ㄦ湇鍔″疄浣撳湴鍧鐨勮漿鎹€傛湁鐨勮礋杞藉潎 琛″櫒瀹炵幇鐪熸鐨勮礋杞藉潎琛$畻娉曪紝鏈夌殑鍙敮鎸佷換鍔$殑杞崲銆傚彧瀹炵幇浠誨姟杞崲鐨勮礋杞藉潎琛″櫒閫傜敤浜庢敮鎸丄CTIVE-STANDBY鐨勯泦緹ょ幆澧冿紝鍦ㄩ偅閲岋紝闆嗙兢涓彧鏈?涓涓湇鍔″疄浣撳伐浣滐紝褰撴鍦ㄥ伐浣滅殑鏈嶅姟瀹炰綋鍙戠敓鏁呴殰鏃訛紝璐熻澆鍧囪 鍣ㄦ妸鍚庢潵鐨勪換鍔¤漿鍚戝彟澶栦竴涓湇鍔″疄浣撱?/p>
銆銆· 鍐呴儴閫氫俊-- 涓轟簡鑳藉崗鍚屽伐浣溿佸疄鐜拌礋杞藉潎琛″拰閿欒鎭㈠錛岄泦緹ゅ悇瀹炰綋闂村繀欏繪椂甯擱氫俊錛屾瘮濡傝礋杞藉潎琛″櫒瀵規(guī)湇鍔″疄浣撳績璺蟲祴璇曚俊鎭佹湇鍔″疄浣撻棿浠誨姟鎵ц涓婁笅鏂囦俊鎭殑閫氫俊銆?/p>
銆銆鍏鋒湁鍚屼竴涓泦緹ゅ湴鍧浣垮緱瀹㈡埛绔兘璁塊棶闆嗙兢鎻愪緵鐨勮綆楁湇鍔★紝涓涓泦緹ゅ湴鍧涓嬮殣钘忎簡鍚勪釜鏈嶅姟瀹炰綋鐨勫唴閮ㄥ湴鍧錛屼嬌寰楀鎴瘋姹傜殑璁$畻鏈嶅姟鑳藉湪鍚勪釜鏈嶅姟瀹炰綋涔嬮棿鍒嗗竷銆傚唴閮ㄩ氫俊鏄泦緹よ兘姝e父榪愯漿鐨勫熀紜錛屽畠浣垮緱闆嗙兢鍏鋒湁鍧囪 璐熻澆鍜岄敊璇仮澶嶇殑鑳藉姏銆?/p>
銆銆闆嗙兢鍒嗙被
銆 銆Linux闆嗙兢涓昏鍒嗘垚涓夊ぇ綾? 楂樺彲鐢ㄩ泦緹わ紝 璐熻澆鍧囪 闆嗙兢錛岀瀛﹁綆楅泦緹?錛岄珮鍙敤闆嗙兢( High Availability Cluster)錛岃礋杞藉潎琛¢泦緹?Load Balance Cluster)錛岀瀛﹁綆楅泦緹?High Performance Computing Cluster)
銆銆鍏蜂綋鍖呮嫭錛?/p>
銆銆Linux High Availability 楂樺彲鐢ㄩ泦緹わ細鏅氫袱鑺傜偣鍙屾満鐑錛屽鑺傜偣HA闆嗙兢錛孯AC, shared, share-nothing闆嗙兢絳夛紱Linux Load Balance 璐熻澆鍧囪 闆嗙兢錛歀VS絳?...錛汱inux High Performance Computing 楂樻ц兘縐戝璁$畻闆嗙兢錛欱eowulf 綾婚泦緹?...錛涘垎甯冨紡瀛樺偍錛涘叾浠栫被linux闆嗙兢錛氬Openmosix, rendering farm 絳?.
銆銆璇︾粏浠嬬粛
銆銆1. 楂樺彲鐢ㄩ泦緹?High Availability Cluster)
銆銆甯歌鐨勫氨鏄?涓妭鐐瑰仛鎴愮殑HA闆嗙兢錛屾湁寰堝閫氫織鐨勪笉縐戝鐨勫悕縐幫紝姣斿"鍙屾満鐑", "鍙屾満浜掑", "鍙屾満".
銆銆楂樺彲鐢ㄩ泦緹よВ鍐崇殑鏄繚闅滅敤鎴風殑搴旂敤紼嬪簭鎸佺畫瀵瑰鎻愪緵鏈嶅姟鐨勮兘鍔涖?(璇鋒敞鎰忛珮鍙敤闆嗙兢鏃笉鏄敤鏉ヤ繚鎶や笟鍔℃暟鎹殑錛屼繚鎶ょ殑鏄敤鎴風殑涓氬姟紼嬪簭瀵瑰涓嶉棿鏂彁渚涙湇鍔★紝鎶婂洜杞歡/紜歡/浜轟負閫犳垚鐨勬晠闅滃涓氬姟鐨勫獎鍝嶉檷浣庡埌鏈灝忕▼搴?銆?/p>
銆銆2. 璐熻澆鍧囪 闆嗙兢(Load Balance Cluster)
銆銆璐熻澆鍧囪 緋葷粺錛氶泦緹や腑鎵鏈夌殑鑺傜偣閮藉浜庢椿鍔ㄧ姸鎬侊紝瀹冧滑鍒嗘憡緋葷粺鐨勫伐浣滆礋杞姐備竴鑸琖eb鏈嶅姟鍣ㄩ泦緹ゃ佹暟鎹簱闆嗙兢鍜屽簲鐢ㄦ湇鍔″櫒闆嗙兢閮藉睘浜庤繖縐嶇被鍨嬨?/p>
銆銆璐熻澆鍧囪 闆嗙兢涓鑸敤浜庣浉搴旂綉緇滆姹傜殑緗戦〉鏈嶅姟鍣紝鏁版嵁搴撴湇鍔″櫒銆傝繖縐嶉泦緹ゅ彲浠ュ湪鎺ュ埌璇鋒眰鏃訛紝媯鏌ユ帴鍙楄姹傝緝?yōu)畱锛屼笉绻佸繖鐨勬湇鍔″櫒锛岒q舵妸璇鋒眰杞埌榪欎簺鏈嶅姟鍣ㄤ笂銆備粠媯鏌ュ叾浠栨湇鍔″櫒鐘舵佽繖涓鐐逛笂鐪嬶紝璐熻澆鍧囪 鍜屽閿欓泦緹ゅ緢鎺ヨ繎錛屼笉鍚屼箣澶勬槸鏁伴噺涓婃洿澶氥?/p>
銆銆3. 縐戝璁$畻闆嗙兢(High Performance Computing Cluster)
銆銆楂樻ц兘璁$畻(High Perfermance Computing)闆嗙兢錛岀畝縐癏PC闆嗙兢銆傝繖綾婚泦緹よ嚧鍔涗簬鎻愪緵鍗曚釜璁$畻鏈烘墍涓嶈兘鎻愪緵鐨勫己澶х殑璁$畻鑳藉姏銆?/p>
銆銆楂樻ц兘璁$畻鍒嗙被
銆銆楂樺悶鍚愯綆?High-throughput Computing)
銆 銆鏈変竴綾婚珮鎬ц兘璁$畻錛屽彲浠ユ妸瀹冨垎鎴愯嫢騫插彲浠ュ茍琛岀殑瀛愪換鍔★紝鑰屼笖鍚勪釜瀛愪換鍔″郊姝ら棿娌℃湁浠涔堝叧鑱斻傝薄鍦ㄥ鎼滃澶栨槦浜? SETI@HOME -- Search for Extraterrestrial Intelligence at Home )灝辨槸榪欎竴綾誨瀷搴旂敤銆傝繖涓欏圭洰鏄埄鐢↖nternet涓婄殑闂茬疆鐨勮綆楄祫婧愭潵鎼滃澶栨槦浜恒係ETI欏圭洰鐨勬湇鍔″櫒灝嗕竴緇勬暟鎹拰鏁版嵁妯″紡鍙戠粰Internet涓?鍙傚姞SETI鐨勮綆楄妭鐐癸紝璁$畻鑺傜偣鍦ㄧ粰瀹氱殑鏁版嵁涓婄敤緇欏畾鐨勬ā寮忚繘琛屾悳绱紝鐒跺悗灝嗘悳绱㈢殑緇撴灉鍙戠粰鏈嶅姟鍣ㄣ傛湇鍔″櫒璐熻矗灝嗕粠鍚勪釜璁$畻鑺傜偣榪斿洖鐨勬暟鎹眹闆嗘垚瀹屾暣鐨?鏁版嵁銆傚洜涓鴻繖縐嶇被鍨嬪簲鐢ㄧ殑涓涓叡鍚岀壒寰佹槸鍦ㄦ搗閲忔暟鎹笂鎼滅儲鏌愪簺妯″紡錛屾墍浠ユ妸榪欑被璁$畻縐頒負楂樺悶鍚愯綆椼傛墍璋撶殑Internet璁$畻閮藉睘浜庤繖涓綾匯傛寜鐓?Flynn鐨勫垎綾伙紝楂樺悶鍚愯綆楀睘浜嶴IMD(Single Instruction/Multiple Data)鐨勮寖鐣淬?/p>
銆銆鍒嗗竷璁$畻(Distributed Computing)
銆銆鍙︿竴綾昏綆楀垰濂藉拰楂樺悶鍚愯綆楃浉鍙嶏紝瀹冧滑铏界劧鍙互緇欏垎鎴愯嫢騫插茍琛岀殑瀛愪換鍔★紝浣嗘槸瀛愪換鍔¢棿鑱旂郴寰堢揣瀵嗭紝闇瑕佸ぇ閲忕殑鏁版嵁浜ゆ崲銆傛寜鐓lynn鐨勫垎綾伙紝鍒嗗竷寮忕殑楂樻ц兘璁$畻灞炰簬MIMD(Multiple Instruction/Multiple Data)鐨勮寖鐣淬?/p>
銆銆4. 鍒嗗竷寮?闆嗙兢)涓庨泦緹ょ殑鑱旂郴涓庡尯鍒?/strong>
銆銆鍒嗗竷寮忔槸鎸囧皢涓嶅悓鐨勪笟鍔″垎甯冨湪涓嶅悓鐨勫湴鏂廣傝岄泦緹ゆ寚鐨勬槸灝嗗嚑鍙版湇鍔″櫒闆嗕腑鍦ㄤ竴璧鳳紝瀹炵幇鍚屼竴涓氬姟銆傚垎甯冨紡涓殑姣忎竴涓妭鐐癸紝閮藉彲浠ュ仛闆嗙兢銆傝岄泦緹ゅ茍涓嶄竴瀹氬氨鏄垎甯冨紡鐨勩?/p>
銆銆涓句緥錛氬氨姣斿鏂版氮緗戯紝璁塊棶鐨勪漢澶氫簡錛屼粬鍙互鍋氫竴涓兢闆嗭紝鍓嶉潰鏀句竴涓搷搴旀湇鍔″櫒錛屽悗闈㈠嚑鍙版湇鍔″櫒瀹屾垚鍚屼竴涓氬姟錛屽鏋滄湁涓氬姟璁塊棶鐨勬椂鍊欙紝鍝嶅簲鏈嶅姟鍣ㄧ湅鍝彴鏈嶅姟鍣ㄧ殑璐熻澆涓嶆槸寰堥噸錛屽氨灝嗙粰鍝竴鍙板幓瀹屾垚銆?/p>
銆銆鑰屽垎甯冨紡錛屼粠紿勬剰涓婄悊瑙o紝涔熻窡闆嗙兢宸笉澶氾紝 浣嗘槸瀹冪殑緇勭粐姣旇緝鏉炬暎錛屼笉鍍忛泦緹わ紝鏈変竴涓粍緇囨э紝涓鍙版湇鍔″櫒鍨簡錛屽叾瀹冪殑鏈嶅姟鍣ㄥ彲浠ラ《涓婃潵銆?/p>
銆銆鍒嗗竷寮忕殑姣忎竴涓妭鐐癸紝閮藉畬鎴愪笉鍚岀殑涓氬姟錛屼竴涓妭鐐瑰灝浜嗭紝鍝繖涓笟鍔″氨涓嶅彲璁塊棶浜嗐?/p>
]]> 鏁村悎嫻嬭瘯 http://m.tkk7.com/paulwong/archive/2014/04/20/412701.htmlpaulwong paulwong Sun, 20 Apr 2014 02:33:00 GMT http://m.tkk7.com/paulwong/archive/2014/04/20/412701.html http://m.tkk7.com/paulwong/comments/412701.html http://m.tkk7.com/paulwong/archive/2014/04/20/412701.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/412701.html http://m.tkk7.com/paulwong/services/trackbacks/412701.html http://arquillian.org/guides/getting_started_zh_cn/
]]> Java EE 搴旂敤寮鍙戝鉤鍙?Koala http://m.tkk7.com/paulwong/archive/2014/04/17/412553.htmlpaulwong paulwong Thu, 17 Apr 2014 01:18:00 GMT http://m.tkk7.com/paulwong/archive/2014/04/17/412553.html http://m.tkk7.com/paulwong/comments/412553.html http://m.tkk7.com/paulwong/archive/2014/04/17/412553.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/412553.html http://m.tkk7.com/paulwong/services/trackbacks/412553.html Koala (鑰冩媺) 鏄竴嬈懼簲鐢ㄥ湪 Java EE 浼佷笟綰у簲鐢ㄥ紑鍙戦鍩燂紝鐢ㄤ簬甯姪鏋舵瀯甯堢畝鍖栫郴緇熻璁★紝闄嶄綆妗嗘灦鑰﹀悎搴︼紝鎻愰珮緋葷粺鐏墊椿鎬э紝鎻愪緵寮鍙戝伐紼嬪笀宸ヤ綔鏁堢巼錛岄檷浣庢垚鏈殑騫沖彴宸ュ叿銆?/p>
涓轟粈涔堜嬌鐢?Koala錛?/p>
寮婧愬厤璐圭殑寮鍙戝鉤鍙幫紝鍏佽浣犱換鎰忎慨鏀規(guī)簮鐮佸茍鎵╁睍鍔熻兘
浠DD棰嗗煙椹卞姩鎬濇兂涓烘牳蹇冿紝鎶涘純浼犵粺鐨勪互鏁版嵁搴撲負涓績鐨勫洓灞傜紪鐮佹ā鍨?/li>
涓板瘜鐨勫熀紜緇勪歡鏀寔錛屽寘鎷細鍥介檯鍖栥佸紓甯搞佺紦瀛樼瓑
鍚戝寮忕殑鎼緩欏圭洰榪囩▼錛屾敮鎸佸悇縐嶆妧鏈夋嫨錛孞PA,Mybstis,SpringMVC,struts2MVC絳?/li>
鍚戝寮忕殑鏁版嵁搴撳埌瀹炰綋鐨勭敓鎴愯繃紼?/li>
鍚戝寮忕殑瀹炰綋鐢熸垚CURD鍔熻兘
鍚戝寮忕殑鏈嶅姟鍙戝竷涓閿棤緙濆彂甯冩垚war銆丒JB銆亀ebservice(SOAP/REST) 澶氱鏈嶅姟褰㈠紡
鍩轟簬RBAC3妯″瀷鐨勬潈闄愬瓙緋葷粺
鐩戞帶瀛愮郴緇熻交鏉懼崗鍔╀綘鐩戞帶URL,鏂規(guī)硶錛屾暟鎹簱錛屽唴瀛樼瓑鐘舵?/li>
浣跨敤閫氱敤鏌ヨ瀛愮郴緇熻交鏉懼畾鍒跺畬鎴愭煡璇㈠姛鑳?/li>
鍩轟簬IP榪囨護錛岀敤鎴峰悕楠岃瘉鍙婃柟娉曟潈闄愭帶鍒剁殑WS瀹夊叏瀛愮郴緇?/li>
鍩轟簬JBPM5 鐨勬祦紼嬪瓙緋葷粺
]]> javaee7-samples http://m.tkk7.com/paulwong/archive/2014/04/06/411982.htmlpaulwong paulwong Sun, 06 Apr 2014 00:33:00 GMT http://m.tkk7.com/paulwong/archive/2014/04/06/411982.html http://m.tkk7.com/paulwong/comments/411982.html http://m.tkk7.com/paulwong/archive/2014/04/06/411982.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/411982.html http://m.tkk7.com/paulwong/services/trackbacks/411982.html http://git.oschina.net/ld/javaee7-samples ]]> 涔熻皥鍩轟簬Web鐨勫惈宸ヤ綔嫻侀」鐩殑涓鑸紑鍙戞祦紼?杞? http://m.tkk7.com/paulwong/archive/2014/04/04/411925.htmlpaulwong paulwong Fri, 04 Apr 2014 00:23:00 GMT http://m.tkk7.com/paulwong/archive/2014/04/04/411925.html http://m.tkk7.com/paulwong/comments/411925.html http://m.tkk7.com/paulwong/archive/2014/04/04/411925.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/411925.html http://m.tkk7.com/paulwong/services/trackbacks/411925.html
璇ラ」鐩寘鍚殑閫氱敤妯″潡浠g爜絳夋垜鏈夋椂闂翠竴騫跺墺紱昏礎鐚嚭鏉ワ紙鍩轟簬WebSocket鐨勯氱煡寮曟搸錛屽伐浣滄祦鏁村悎妯″潡錛岃嚜瀹氫箟琛ㄥ崟錛?a target="_blank" style="color: #1d58d1; text-decoration: none; ">璇﹁榪欓噷錛夛紝鍩轟簬RBAC鏉冮檺璁捐錛夛紝鏈榪戝お蹇欎簡錛學eb欏圭洰鏈変竴孌墊椂闂存病紕幫紝鏈夌偣鐢熺枏鐨勬劅瑙夛紝涓昏鍦ㄥ繖GQT欏圭洰錛屼竴濂楀熀浜庢闈㈠紑鍙戠殑妗嗘灦錛?a target="_blank" style="color: #1d58d1; text-decoration: none; ">璇﹁榪欓噷錛屽啓浠g爜鍐欑殑鏈夌偣鎵嬮吀鐨勬劅瑙夈?
鍩轟簬Web鐨勫惈宸ヤ綔嫻佺殑欏圭洰鐪嬭搗鏉ュ茍涓嶅鎯寵薄鐨勯偅涔堢畝鍗曪紝涓昏闇姹傦細
鐏墊椿瀹氬埗宸ヤ綔嫻侊紝騫惰窡韙祦紼嬭繘搴︼紱
姣忎釜Order鍚湁鍘嗗彶杞ㄨ抗璁板綍錛屽彲鍦ㄥ巻鍙蹭腑鏌ョ湅錛?/span>
宸ヤ綔嫻佺殑Action鐏墊椿錛岃棰嗕換鍔′笉涓瀹氶潪瑕佸厛鎻愬彇琛ㄥ崟錛屽洜涓哄緢澶氳妭鐐歸兘鍙湁鍑犱釜鍔ㄤ綔錛岀洿鎺ユ寜閽搷浣滃嵆鍙紱
寰呭姙浜嬪疁鍒楄〃鍦ㄤ笉鍒鋒柊欏甸潰鎯呭喌涓嬩篃鑳藉彉鍔紱
欏圭洰瑕佹眰錛?/span>
鎿嶄綔綆鍗曢珮鏁堬紱
鏉冮檺緇嗚妭鍒版寜閽駭鍒紱
騫跺彂鏁板皯錛屼笉瓚呰繃3000涓湪綰跨敤鎴鳳紱
涓昏鍙兘浣跨敤鍒版妧鏈細
宸ヤ綔嫻佸紩鎿庯紝鎴戣繖閲岄夌敤Activiti5錛屽緢鐏墊椿濂界敤錛?/span>
鏉冮檺浣跨敤Spring Security錛屽熀浜庢爣絳懼紡綆$悊鏉冮檺寰堟柟渚匡紱
閫氱煡寮曟搸浣跨敤WebSocket錛屽熀浜嶧lash瀹炴椂閫氫俊錛屽熀浜巗ocket.io錛?/span>
鏉冮檺綺掑害鍩轟簬緇忓吀鐨凴BAC錛?/span>
鎬諱綋妗嗘灦Spring MVC+Mybatis錛?/span>
瀹炵幇鐨刉ebSocket鐨勬諱綋鎬濊礬錛?/span>
WebSocket Server鐙珛浜嶹eb欏圭洰錛學eb Server涓嶹ebSocket Server涔嬮棿鐨勫眬鍩熺綉閫氫俊鍩轟簬綆鍗曠殑Socket閫氫俊錛岃繖鏍瘋繖涓粍浠跺彲浠ュ畬鍏ㄨВ鑰﹀拰閫氱敤錛?/span>
褰揥eb欏圭洰瑕丳ush娑堟伅鍒癈lient鏃訛紝閫氳繃Web Server鐨凷ocket Client鍚慦ebSocket Server鐨凷ocker Server鍙戦佹秷鎭紝鐒跺悗WebSocket Server鏀跺埌娑堟伅鍚庤В鐮侊紝騫挎挱鍒版墍鏈夋祻瑙堝櫒錛?/span>
鎴戜滑瀹炵幇鐨勪簨浠墮氱煡闈炲父綆鍗曪紝璁懼畾鍏ㄥ眬鍙橀噺騫惰嫻忚鍣ㄤ睛鍚細
var G_WebSocket=false;
var EVENT_ORDER_CHANGE_STATUS = "orderChange";
var EVENT_ORDER_CHANGE_AMOUNT = "amountChange";
var EVENT_ORDER_CHANGE_REFUND = "refundChange";
WebSocket.init = function(callbackFunc){
socket = io.connect(connUrl, connOptions);
socket.on('connect', function() {
G_WebSocket=true;
callbackFunc("connect",null);
});
socket.on('disconnect', function() {
G_WebSocket=false;
callbackFunc("disconnect",null);
});
socket.on('clientQuit', function(obj){
G_WebSocket=false;
callbackFunc("clientQuit",obj);
});
socket.on('broadcast', function(obj) {
callbackFunc("broadcast",obj);
});
};
鍦ㄩ渶瑕佷睛鍚琖ebSocket鎺ュ彈Web Server鎺ㄩ佹秷鎭殑鍦版柟鍔犱笂涓涓嚱鏁板嵆鍙細
WebSocket.init(function(command,jsonObj){
if(command=="broadcast"){
if(jsonObj.e == EVENT_ORDER_CHANGE_STATUS){
//TODO:write your code here
}else if(jsonObj.e == EVENT_ORDER_CHANGE_AMOUNT){
//TODO:write your code here
}else if(jsonObj.e == EVENT_ORDER_CHANGE_REFUND){
//TODO:write your code here
}
}
});
榪欐牱鐨勭粨鏋勮鎵╁睍鎺ㄩ佹湇鍔″緢綆鍗曪紝姣斿鎸夐閬撴帹閫佺瓑錛岄兘鍙互寰堝鏄撶殑鎵╁睍銆?/span>
鍐嶇湅鐪嬬湅宸ヤ綔嫻侊紝鎴戜滑瀹炵幇浜哸ctiviti閫氱敤鐨勭敵璇鋒彁浜や換鍔℃祦紼嬪拰鑷畾涔夎〃鍗曞姛鑳斤紝鎻愬彇璺熻釜嫻佺▼鍥懼姛鑳界瓑錛岃繖鏍蜂綘瑕佽璁′竴涓柊嫻佺▼涔熷彉寰楅潪甯哥畝鍗曪紝鍙渶瑕佸湪eclipse閲屽垝涓婂伐浣滄祦鍥撅紝鍦ㄥ悗鍙板彂甯冿紝鐒跺悗閫氳繃SpringMVC鐨凴estAPI鍚姩瀹炰緥嫻佺▼錛岀敵棰嗗畬鎴愪換鍔$瓑錛屽涓嬪浘錛?/span>
嫻佺▼璧板埌浜嗗垎鏀殑涓や釜鑺傜偣涓婏紝榪欐牱瀵瑰悗緇柊澧炵殑宸ヤ綔嫻佹彁渚涗簡鏋佸ぇ鐨勯亶鍘嗐?/span>
鏈鍚庤璇碨pring Security錛屽熀浜嶳BAC鐨勬潈闄愪綋緋繪惌寤哄ソ鍚庯紙鍙互鐢ㄥ湪浠諱綍綆$悊緋葷粺涓級錛岃鍦ㄩ〉闈腑璁塊棶涓涓祫婧愶紝棣栧厛鍒ゆ柇涓涓嬫槸鍚︽湁鏉冮檺錛屽涓婬TML錛?/span>
<sec:authorize ifAllGranted="r_pd">
<a href="#">resource access here</a>
</sec:authorize>
<sec:authorize url="/XXX/XXX/XXX.html">
<a href="XXX/XXX/XXX.html'">
<span>XXX鍔熻兘</span>
</a>
</sec:authorize>
鍓嶅彴鐢變簬欏圭洰姣旇緝?yōu)畯锛屾病鏈夌敤鍒癹s鐨凪VC妗嗘灦錛屽backbone絳夛紝榪欓噷灝變笉鍐嶈褰曚簡銆?/span>
]]> LOGBACK TUTORIA http://m.tkk7.com/paulwong/archive/2014/04/03/411871.htmlpaulwong paulwong Thu, 03 Apr 2014 00:10:00 GMT http://m.tkk7.com/paulwong/archive/2014/04/03/411871.html http://m.tkk7.com/paulwong/comments/411871.html http://m.tkk7.com/paulwong/archive/2014/04/03/411871.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/411871.html http://m.tkk7.com/paulwong/services/trackbacks/411871.html https://github.com/abdulwaheed18/Slf4jTutorial
< configuration >
< appender name ="STDOUT" class ="ch.qos.logback.core.ConsoleAppender" >
< encoder class ="ch.qos.logback.classic.encoder.PatternLayoutEncoder" >
< Pattern > %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</ Pattern >
</ encoder >
</ appender >
< appender name ="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender" >
< file > testFile7.log</ file >
< rollingPolicy class ="ch.qos.logback.core.rolling.TimeBasedRollingPolicy" >
<!-- daily rollover
Once any of the below condition met, it will change the file name as below and compressed it. -->
< fileNamePattern > logFile.%d{yyyy-MM-dd}.%i.log.zip
</ fileNamePattern >
<!-- keep 30 days' worth of history -->
< maxHistory > 30</ maxHistory >
<!-- or whenever the file size reaches 10MB -->
< timeBasedFileNamingAndTriggeringPolicy
class ="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP" >
< maxFileSize > 10MB</ maxFileSize >
</ timeBasedFileNamingAndTriggeringPolicy >
</ rollingPolicy >
< encoder >
< pattern > %-4relative [%thread] %-5level %logger{35} - %msg%n
</ pattern >
</ encoder >
</ appender >
< root level ="INFO" >
< appender-ref ref ="STDOUT" />
< appender-ref ref ="FILE" />
</ root >
</ configuration >
]]> 濡備綍鍦╓EB搴旂敤涓粦瀹氬井淇″叕浼楀笎鍙?/title> http://m.tkk7.com/paulwong/archive/2014/04/01/411767.htmlpaulwong paulwong Tue, 01 Apr 2014 00:41:00 GMT http://m.tkk7.com/paulwong/archive/2014/04/01/411767.html http://m.tkk7.com/paulwong/comments/411767.html http://m.tkk7.com/paulwong/archive/2014/04/01/411767.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/411767.html http://m.tkk7.com/paulwong/services/trackbacks/411767.html http://www.chanzhi.org/book/weixin.html
]]> weather API 鏀墮泦鏁寸悊 http://m.tkk7.com/paulwong/archive/2014/01/14/408906.htmlpaulwong paulwong Tue, 14 Jan 2014 02:54:00 GMT http://m.tkk7.com/paulwong/archive/2014/01/14/408906.html http://m.tkk7.com/paulwong/comments/408906.html http://m.tkk7.com/paulwong/archive/2014/01/14/408906.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/408906.html http://m.tkk7.com/paulwong/services/trackbacks/408906.html 鑵捐
http://sou.qq.com/online/get_weather.php?callback=Weather&city=鍗椾含
涓浗澶╂皵-weather.com.cn
http://geoip.weather.com.cn/g/ (鏍規(guī)嵁IP鏌ヨ鍩庡競ID)
http://m.weather.com.cn/data/101110101.html 錛堝叚澶╅鎶ワ級
http://www.weather.com.cn/data/sk/101110101.html 錛堝疄鏃跺ぉ姘斾俊鎭級
google
http://www.google.com/ig/api?weather=Beijing
璁捐铚傚發(fā)
http://www.hujuntao.com/api/weather/api.php?city=鍗椾含
MSN
http://weather.msn.com/data.aspx?wealocations=wc:CHXX0008&weadegreetype=C
YAHOO
http://xml.weather.yahoo.com/forecastrss?p=CHXX0008&u=f
http://weather.yahooapis.com/forecastrss?w=2459115&u=f
ThinkPage(鏀惰垂)
http://www.thinkpage.cn/weather/api.svc/getWeather?city=101010100&language=zh-chs&provider=cma&unit=c&key=
鏈夐亾
http://www.youdao.com/smartresult-xml/search.s?type=weather&jsFlag=true&q=鍗椾含
360
http://cdn.weather.hao.360.cn/api_weather_info.php?app=hao360&_jsonp=smartloaddata101190101&code=101190101
鎼滅嫍
http://123.sogou.com/get123.php?block=wt&ver=v32&city=CN110100
1616
http://weather.1616.net/grab/weather/%25E5%258C%2597%25E4%25BA%25AC.js
姣掗湼
http://123.duba.net/weatherinfo/
娣?23
http://weather.tao123.com/static/weather/weather_json.php?cb=callback
114鍟?/strong>
http://weather.api.114la.com/1901/101190101.txt
2345
http://tianqi.2345.com/t/detect2009v2.php
hao123
http://app.hao123.com/weather/forecast.php
鍏跺畠
http://weather.all2rss.com/weatherrss.asp?City=%C4%CF%BE%A9
]]>JAX-RS璧勬簮 http://m.tkk7.com/paulwong/archive/2013/11/27/406879.htmlpaulwong paulwong Wed, 27 Nov 2013 04:03:00 GMT http://m.tkk7.com/paulwong/archive/2013/11/27/406879.html http://m.tkk7.com/paulwong/comments/406879.html http://m.tkk7.com/paulwong/archive/2013/11/27/406879.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/406879.html http://m.tkk7.com/paulwong/services/trackbacks/406879.html
Jersey 2.4.1 User Guide
https://jersey.java.net/documentation/latest/index.html
The Java EE 6 Tutorial
http://docs.oracle.com/javaee/6/tutorial/doc/gkoib.html
鍩轟簬JAXB娉ㄩ噴鐨凧SON涓嶫AVA BEAN鐨勪簰杞?/div>
]]>
寰俊鍏紬騫沖彴寮鍙戣祫婧?/title> http://m.tkk7.com/paulwong/archive/2013/11/25/406817.htmlpaulwong paulwong Mon, 25 Nov 2013 14:00:00 GMT http://m.tkk7.com/paulwong/archive/2013/11/25/406817.html http://m.tkk7.com/paulwong/comments/406817.html http://m.tkk7.com/paulwong/archive/2013/11/25/406817.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/406817.html http://m.tkk7.com/paulwong/services/trackbacks/406817.html 銆愬井淇″叕浼楀鉤鍙版敼鐗堝悗銆慗ava妯℃嫙鐧誨綍寰俊騫沖彴,涓誨姩鎺ㄩ佹秷鎭粰鐢ㄦ埛
http://50vip.com/blog.php?i=349
寰俊鍏紬璐﹀彿寮鍙?br />
http://my.oschina.net/ywooer/blog?catalog=419479 ]]> 鍩轟簬springMVC+springSecurity3.x+Mybaits3.x鐨勬潈闄愮郴緇?/title> http://m.tkk7.com/paulwong/archive/2013/11/24/406757.htmlpaulwong paulwong Sun, 24 Nov 2013 12:54:00 GMT http://m.tkk7.com/paulwong/archive/2013/11/24/406757.html http://m.tkk7.com/paulwong/comments/406757.html http://m.tkk7.com/paulwong/archive/2013/11/24/406757.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/406757.html http://m.tkk7.com/paulwong/services/trackbacks/406757.html https://github.com/lanyuancom/lanyuan
@import url(http://m.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ]]> 澶у瀷緗戠珯鎶鏈灦鏋勮涔︾瑪璁?/title> http://m.tkk7.com/paulwong/archive/2013/11/09/406160.htmlpaulwong paulwong Sat, 09 Nov 2013 03:34:00 GMT http://m.tkk7.com/paulwong/archive/2013/11/09/406160.html http://m.tkk7.com/paulwong/comments/406160.html http://m.tkk7.com/paulwong/archive/2013/11/09/406160.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/406160.html http://m.tkk7.com/paulwong/services/trackbacks/406160.html 搴旂敤鏈嶅姟鍣ㄣ佹暟鎹簱鏈嶅姟鍣ㄥ拰鏂囦歡鏈嶅姟鍣ㄩ兘瀹夎鍦ㄥ悓涓鍙頒富鏈?/li> 搴旂敤鏈嶅姟鍣ㄣ佹暟鎹簱鏈嶅姟鍣ㄥ拰鏂囦歡鏈嶅姟鍣ㄥ垎鍒畨瑁呭湪涓嶅悓涓繪満 澧炲姞浜嗗垎甯冨紡鐨勭紦瀛樻湇鍔″櫒 搴旂敤鏈嶅姟鍣ㄥ鍔犱簡濂藉嚑鍙幫紝鍙樻垚闆嗙兢 澧炲姞浜咰DN鍜屽弽灝勪唬鐞嗘湇鍔″櫒 鏁版嵁搴撴湇鍔″櫒鍙樻垚涓諱粠褰㈠紡鐨勬湇鍔″櫒 鏁版嵁搴撴湇鍔″櫒鍙樻垚鍒嗗竷寮忕殑鏈嶅姟鍣紝鏂囦歡鏈嶅姟鍣ㄤ篃鍙樻垚鍒嗗竷寮忔湇鍔″櫒 NOSQL鍒嗗竷寮忔暟鎹簱鍜屾悳绱㈠紩鎿庣殑寮曞叆 搴旂敤鏈嶅姟鍣ㄨ櫧鐒舵槸澶氬彴錛屼絾閮芥槸閮ㄧ講浜嗗悓涓搴旂敤錛岃繖鏃跺皢搴旂敤鎷嗗垎錛屾瘡鍙版湇鍔″櫒閮ㄧ講涓嶅悓鐨勬媶鍒嗗簲鐢?/li> 铏界劧搴旂敤宸茬粡鎷嗗垎錛屼絾姣忎釜搴旂敤閮芥槸浠庨〉闈㈢鍒版暟鎹簱錛岃繖鏃剁戶緇媶鍒嗭紝灝嗗瓨鍙栨暟鎹簱鐨勯儴浠界嫭绔嬶紝欏甸潰閮ㄤ喚 涔熺嫭绔?/li> 鏋舵瀯妯″紡鍒嗗眰錛屼唬鐮佹斁鍦ㄤ笉鍚岀殑綾諱腑 鍒嗗壊錛屽簲鐢ㄦ斁鍦ㄤ笉鍚岀殑JVM涓?/li> 鍒嗗竷寮忥紝閮ㄧ講鍦ㄤ笉鍚岀殑鐗╃悊鏈?/li> 闆嗙兢錛屽悓涓涓簲鐢ㄩ儴緗插埌涓嶅悓鐨勪富鏈猴紝鍙互璐熻澆鍧囪 緙撳瓨錛孋ND鍔犻熴佸弽鍚戜唬鐞嗐佹湰鍦扮紦瀛樸佸垎甯冨紡緙撳瓨 寮傛錛屾秷闄ら珮騫跺彂 鍐椾綑錛屽澶勫浠?/li> 瀹夊叏鎬?/li> ]]> Java EE 8鎰挎湜娓呭崟錛氱己灝戣繖浜涳紝Java EE灝嗕笉浼氬畬緹?/title> http://m.tkk7.com/paulwong/archive/2013/11/09/406156.htmlpaulwong paulwong Sat, 09 Nov 2013 03:14:00 GMT http://m.tkk7.com/paulwong/archive/2013/11/09/406156.html http://m.tkk7.com/paulwong/comments/406156.html http://m.tkk7.com/paulwong/archive/2013/11/09/406156.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/406156.html http://m.tkk7.com/paulwong/services/trackbacks/406156.html 鎽樿錛?/strong>Java EE 7宸蹭簬6鏈堜腑鏃寮忓彂甯冿紝灝界鏂板鉤鍙板寘鍚簡璇稿鏂扮殑鐗規(guī)э紝浣嗘槸寮鍙戣呭姝や技涔庡茍涓嶆弧瓚籌紝浠栦滑鏈熷緟鏈潵鐨勭増鏈琂ava EE 8涓兘澶熷寘鍚洿瀹屽杽鐨勭壒鎬э紝姣斿鏇村ぇ鐨凜DI搴旂敤鑼冨洿銆佹爣鍑嗙殑緙撳瓨API銆佺幇浠e寲鐨勫畨鍏ㄦ鏋剁瓑銆?/div> ]]> OAUTH 2.0璧勬簮 http://m.tkk7.com/paulwong/archive/2013/10/24/405595.htmlpaulwong paulwong Thu, 24 Oct 2013 03:27:00 GMT http://m.tkk7.com/paulwong/archive/2013/10/24/405595.html http://m.tkk7.com/paulwong/comments/405595.html http://m.tkk7.com/paulwong/archive/2013/10/24/405595.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/405595.html http://m.tkk7.com/paulwong/services/trackbacks/405595.html http://wenku.baidu.com/view/0c80c91bb7360b4c2e3f647c.html
OAuth 2.0 Tutorial
http://tutorials.jenkov.com/oauth2/index.html
New JavaScript SDK & OAuth 2.0 based FBConnect Tutorial
http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/
Twitter OAuth
http://robfig.github.io/revel/samples/twitter-oauth.html
]]> 鍚敤TOMCAT鐨凷SL http://m.tkk7.com/paulwong/archive/2013/10/14/404941.htmlpaulwong paulwong Mon, 14 Oct 2013 00:02:00 GMT http://m.tkk7.com/paulwong/archive/2013/10/14/404941.html http://m.tkk7.com/paulwong/comments/404941.html http://m.tkk7.com/paulwong/archive/2013/10/14/404941.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/404941.html http://m.tkk7.com/paulwong/services/trackbacks/404941.html 鍩烘湰姝ラ錛?br /> 浣跨敤 java 鍒涘緩涓涓?keystore 鏂囦歡 閰嶇疆 Tomcat 浠ヤ嬌鐢ㄨ keystore 鏂囦歡 嫻嬭瘯 閰嶇疆搴旂敤浠ヤ究浣跨敤 SSL 錛屼緥濡?https://localhost:8443/yourApp 1. 鍒涘緩 keystore 鏂囦歡 鎵ц keytool -genkey -alias tomcat -keyalg RSA 緇撴灉濡備笅loiane:bin loiane$ keytool -genkey -alias tomcat -keyalg RSA Enter keystore password: password Re-enter new password: password What is your first and last name? [ Unknown ] : Loiane Groner What is the name of your organizational unit? [ Unknown ] : home What is the name of your organization? [ Unknown ] : home What is the name of your City or Locality? [ Unknown ] : Sao Paulo What is the name of your State or Province? [ Unknown ] : SP What is the two-letter country code for this unit? [ Unknown ] : BR Is CN=Loiane Groner, OU=home, O=home, L=Sao Paulo, ST=SP, C=BR correct? [ no ] : y Enter key password for (RETURN if same as keystore password): password Re-enter new password: password
榪欐牱灝卞湪鐢ㄦ埛鐨勪富鐩綍涓嬪垱寤轟簡涓涓?.keystore 鏂囦歡 2. 閰嶇疆 Tomcat 浠ヤ嬌鐢?keystore 鏂囦歡 鎵撳紑 server.xml 鎵懼埌涓嬮潰琚敞閲婄殑榪欐<!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" />-->
騫叉帀娉ㄩ噴錛屽茍灝嗗唴瀹規(guī)敼涓?br />< Connector SSLEnabled ="true" acceptCount ="100" clientAuth ="false" disableUploadTimeout="true" enableLookups ="false" maxThreads ="25" port="8443" keystoreFile ="/Users/loiane/.keystore" keystorePass ="password" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme ="https" secure="true" sslProtocol ="TLS" />
3. 嫻嬭瘯 鍚姩 Tomcat 騫惰闂?https://localhost:8443. 浣犲皢鐪嬪埌 Tomcat 榛樿鐨勯欏點?br /> 闇瑕佹敞鎰忕殑鏄紝濡傛灉浣犺闂粯璁ょ殑 8080 绔彛錛岃繕鏄湁鏁堢殑銆?br /> 4. 閰嶇疆搴旂敤浣跨敤 SSL 鎵撳紑搴旂敤鐨?web.xml 鏂囦歡錛屽鍔犻厤緗涓嬶細< security-constraint > < web-resource-collection > < web-resource-name > securedapp</ web-resource-name > < url-pattern > /*</ url-pattern > </ web-resource-collection > < user-data-constraint > < transport-guarantee > CONFIDENTIAL</ transport-guarantee > </ user-data-constraint > </ security-constraint >
灝?URL 鏄犲皠璁句負 /* 錛岃繖鏍蜂綘鐨勬暣涓簲鐢ㄩ兘瑕佹眰鏄?HTTPS 璁塊棶錛岃?transport-guarantee 鏍囩璁劇疆涓?CONFIDENTIAL 浠ヤ究浣垮簲鐢ㄦ敮鎸?SSL銆?br /> 濡傛灉浣犲笇鏈涘叧闂?SSL 錛屽彧闇瑕佸皢 CONFIDENTIAL 鏀逛負 NONE 鍗沖彲銆?br /> 濡傛灉鏄疢AVEN鐨凾OMCAT鎻掍歡錛屽垯鍔犲叆濡備笅閰嶇疆< build > < finalName > test-dropbox</ finalName > < plugins > < plugin > < groupId > org.apache.maven.plugins</ groupId > < artifactId > maven-compiler-plugin</ artifactId > < version > 2.5.1</ version > < configuration > < source > 1.6</ source > < target > 1.6</ target > </ configuration > </ plugin > < plugin > < groupId > org.apache.tomcat.maven</ groupId > < artifactId > tomcat7-maven-plugin</ artifactId > < version > 2.0</ version > < configuration > < httpsPort > 8443</ httpsPort > < keystorePass > password</ keystorePass > < keystoreFile > C:\Users\PAUL\.keystore</ keystoreFile > </ configuration > </ plugin > </ plugins > </ build >
]]>灝忚JPA http://m.tkk7.com/paulwong/archive/2013/08/14/402812.htmlpaulwong paulwong Wed, 14 Aug 2013 10:17:00 GMT http://m.tkk7.com/paulwong/archive/2013/08/14/402812.html http://m.tkk7.com/paulwong/comments/402812.html http://m.tkk7.com/paulwong/archive/2013/08/14/402812.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/402812.html http://m.tkk7.com/paulwong/services/trackbacks/402812.html
涔熸槸涓濂桰NTERFACE錛屼互ORM鐨勬柟寮忔彁渚涳紝鐢卞巶鍟嗗疄鐜幫紝濡侲CLIPSE LINK錛孒IBERNATE錛孫PENEJB絳夈?br />
ENTITYMANAGERFACTORY錛氭牴鎹厤緗枃浠跺埗閫燛NTITYMANAGER
ENTITYMANAGER錛氫互ORM鐨勬柟寮忔彁渚涙搷浣滄暟鎹簱鐨勫姛鑳?br />
TRANSACTION錛氫簨鍔′繚璇?br />
PERSISTENCE.XML錛氶摼鎺ユ暟鎹簱淇℃伅錛屼簨鍔$被鍨嬶紝閲嶅畾涔塉PA鐨勫疄鐜板巶鍟嗙瓑鐨勯厤緗俊鎭?br />
鍦ㄥ鍣ㄧ幆澧冧笅浣跨敤錛?br />
濡傛灉浜嬪姟鏄疪ESOURCE_LOCAL鐨勬柟寮忥紝鍒欏悎鐢ㄧ闇騫叉墍鏈夌殑浜嬫儏錛屽鏋勯燛NTITYMANAGER錛屾墦寮浜嬪姟錛屽叧闂簨鍔$瓑銆傜被浼間簬BMT銆?br />
浠ヤ笅鏄湪鏈嶅姟鍣ㄧ幆澧冧腑鍚堢敤RESOURCE_LOCAL鍨嬬殑JPA 浜嬪厛瑕佸湪瀹瑰櫒涓坊鍔犳暟鎹簮銆?br /> persistence.xml
<? xml version="1.0" encoding="UTF-8" ?>
< persistence xmlns ="http://java.sun.com/xml/ns/persistence" version ="1.0" >
<!-- Tutorial "unit" -->
< persistence-unit name ="Tutorial" transaction-type ="RESOURCE_LOCAL" >
< non-jta-data-source > myNonJtaDataSource</ non-jta-data-source >
< class > org.superbiz.jpa.Account</ class >
</ persistence-unit >
</ persistence >
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceUnit;
public class MyEjbOrServlet
{
@PersistenceUnit(unitName="Tutorial")
private EntityManagerFactory factory;
// Proper exception handling left out for simplicity public void ejbMethodOrServletServiceMethod()
throws Exception {
EntityManager entityManager = factory.createEntityManager();
EntityTransaction entityTransaction = entityManager.getTransaction();
entityTransaction.begin();
Account account = entityManager.find(Account.
class , 12345);
account.setBalance(5000);
entityTransaction.commit();
}
}
浠ヤ笅鏄疛TA鏂瑰紡鐨凧PA錛屽鍣?EJB+JPA+JTA錛屽鍣ㄤ細鍦‥JB鐨勬柟娉曡皟鐢ㄥ墠鎵撳紑涓涓簨鍔★紝鍦ㄦ柟娉曢鍑哄悗錛屾彁浜や簨鍔★紝騫朵笖濡傛灉鏄涓暟鎹簮鐨勶紝鍗蟲湁澶氫釜ENTITYMANAGER鐨?br />鍙互淇濊瘉涓鑷存э紝鍗沖叏灞浜嬪姟銆傜浉褰撲簬涔嬪墠鐨勫厛璋冪敤USERTRANSACTION錛孊EGIN錛孋OMMIT銆?br /> 浜嬪厛瑕佸湪瀹瑰櫒涓坊鍔犳暟鎹簮銆?br /> persistence.xml<? xml version="1.0" encoding="UTF-8" ?> < persistence xmlns ="http://java.sun.com/xml/ns/persistence" version ="1.0" > <!-- Tutorial "unit" --> < persistence-unit name ="Tutorial" transaction-type ="JTA" > < jta-data-source > myJtaDataSource</ jta-data-source > < non-jta-data-source > myNonJtaDataSource</ non-jta-data-source > < class > org.superbiz.jpa.Account</ class > </ persistence-unit > </ persistence >
EJBimport javax.ejb.Stateless;import javax.ejb.TransactionAttribute;import javax.ejb.TransactionAttributeType;import javax.persistence.EntityManager;import javax.persistence.PersistenceContext; @Statelesspublic class MyEjb implements MyEjbInterface { @PersistenceContext(unitName = "Tutorial") private EntityManager entityManager; // Proper exception handling left out for simplicity @TransactionAttribute(TransactionAttributeType.REQUIRED) public void ejbMethod() throws Exception { Account account = entityManager.find(Account.class , 12345); account.setBalance(5000); } }
濡傛灉鏄疛2SE鐜涓嬩嬌鐢↗PA錛屽垯鍙堟槸涓嶄竴鏍風殑銆?br /> persistence.xml<? xml version="1.0" encoding="UTF-8" ?> < persistence xmlns ="http://java.sun.com/xml/ns/persistence" version ="1.0" > < persistence-unit name ="SimplePU" transaction-type ="RESOURCE_LOCAL" > < provider > org.hibernate.ejb.HibernatePersistence</ provider > < class > com.someone.jmail.valueobject.CallActivity</ class > < class > com.someone.jmail.valueobject.Email</ class > < properties > < property name ="hibernate.connection.driver_class" value ="com.mysql.jdbc.Driver" /> < property name ="hibernate.connection.url" value ="jdbc:mysql://localhost:3306/test" /> < property name ="hibernate.connection.username" value ="root" /> < property name ="hibernate.connection.password" value ="12345" /> < property name ="hibernate.dialect" value ="org.hibernate.dialect.MySQL5Dialect" /> < property name ="hibernate.show_sql" value ="false" /> < property name ="hibernate.format_sql" value ="true" /> < property name ="hibernate.use_sql_comments" value ="false" /> < property name ="hibernate.hbm2ddl.auto" value ="none" /> </ properties > </ persistence-unit > </ persistence >
Dao:public class UserDaoImpl implements UserDao { public AccountInfo save(AccountInfo accountInfo) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("SimplePU"); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.persist(accountInfo); em.getTransaction().commit(); emf.close(); return accountInfo; } }
]]> 鍦?Ubuntu 瀹夎 java Jdk http://m.tkk7.com/paulwong/archive/2013/08/10/402655.htmlpaulwong paulwong Sat, 10 Aug 2013 05:33:00 GMT http://m.tkk7.com/paulwong/archive/2013/08/10/402655.html http://m.tkk7.com/paulwong/comments/402655.html http://m.tkk7.com/paulwong/archive/2013/08/10/402655.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/402655.html http://m.tkk7.com/paulwong/services/trackbacks/402655.html
Install-Oracle-Java-7-in-Ubuntu-via-PPA-Repository
瀹夎 java 寰堝鏄?! (鏀彺 Ubuntu 12.04, 11.10, 11.04 and 10.04)
瑾湪鍓嶉牠 :
0. 瀹夎 oracle java jdk (鐩墠鏄?7u5 鐗?
0-1. 鍖呭惈 jdk jre 鍙?鐎忚鍣ㄦ彃浠?(涓嶈兘鍙畨瑁?jre 鎴?鐎忚鍣ㄦ彃浠?
0-2. 鑷嫊 杈ㄨ瓨 64 bits 鎴?32 bits
0-2. 瀹夎寰?鏈冭嚜鍕曞緸 ppa:webupd8team/java 濂椾歡搴?鏇存柊 宸插畨瑁濆浠?
0-3. 浠ュ緦鏈夋柊鐗堟湰 閫欏嬫柟娉?鑷嫊鏈冪洿鎺ュ畨瑁濇柊鐗堟湰(渚嬪濡傛灉鏈?7u6 鐗? 1. 瀹夎鎸囦護
2. 鐪嬬湅鏄惁瀹夎鎴愬姛java -version
鐩墠鏈鏂扮増鏈?br />
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
2-1. 濡傛灉涓婇潰鐨勬寚浠?寰楀埌鐨勭増鏈?涓嶆槸鍓涘墰瀹夎鐨勭増鏈?br />
sudo update-java-alternatives -s java- 7 -oracle
鍐嶈│涓嬈?br />
java -version
3. 縐婚櫎 Oracle Java 7
sudo apt-get remove oracle-java7-installer
]]> ECLIPSE+MAVEN+TOMCAT7 PLUGING+JNDI http://m.tkk7.com/paulwong/archive/2013/07/15/401578.htmlpaulwong paulwong Mon, 15 Jul 2013 05:51:00 GMT http://m.tkk7.com/paulwong/archive/2013/07/15/401578.html http://m.tkk7.com/paulwong/comments/401578.html http://m.tkk7.com/paulwong/archive/2013/07/15/401578.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/401578.html http://m.tkk7.com/paulwong/services/trackbacks/401578.html 闃呰鍏ㄦ枃 ]]> J2EE+ECLIPSE+JETTY PLUGIN+JNDI DATA SOURCE http://m.tkk7.com/paulwong/archive/2013/07/14/401551.htmlpaulwong paulwong Sun, 14 Jul 2013 08:59:00 GMT http://m.tkk7.com/paulwong/archive/2013/07/14/401551.html http://m.tkk7.com/paulwong/comments/401551.html http://m.tkk7.com/paulwong/archive/2013/07/14/401551.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/401551.html http://m.tkk7.com/paulwong/services/trackbacks/401551.html 鍦‥CLIPSE涓紝鍚姩JETTY錛岃兘閮ㄧ講澶氫釜WEB搴旂敤錛屽簲鐢ㄩ棿鑳藉叡浜獼NDI 鐨勬暟鎹簮銆?br /> Jetty/Feature/Jetty Maven Pluginhttp://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin Speed Up J2EE Environment Setup With Jetty Maven Pluginhttp://owenou.com/2011/02/23/speed-up-j2ee-environment-setup-with-jetty-maven-plugin.html ]]>Oracle鏁版嵁搴撳浠戒笌榪樺師鍛戒護[杞琞 http://m.tkk7.com/paulwong/archive/2013/05/12/399172.htmlpaulwong paulwong Sun, 12 May 2013 07:07:00 GMT http://m.tkk7.com/paulwong/archive/2013/05/12/399172.html http://m.tkk7.com/paulwong/comments/399172.html http://m.tkk7.com/paulwong/archive/2013/05/12/399172.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/399172.html http://m.tkk7.com/paulwong/services/trackbacks/399172.html 1 灝嗘暟鎹簱TEST瀹屽叏瀵煎嚭,鐢ㄦ埛鍚峴ystem 瀵嗙爜manager 瀵煎嚭鍒癉:\daochu.dmp涓?br /> exp system/manager@TEST file=d:\daochu.dmp full=y 2 灝嗘暟鎹簱涓璼ystem鐢ㄦ埛涓巗ys鐢ㄦ埛鐨勮〃瀵煎嚭 exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys) 3 灝嗘暟鎹簱涓殑琛╰able1 銆乼able2瀵煎嚭 exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2) 4 灝嗘暟鎹簱涓殑琛╰able1涓殑瀛楁filed1浠?00"鎵撳ご鐨勬暟鎹鍑?br /> exp system/manager@TEST file=d:\daochu.dmp tables=(table1)query=\" where filed1 like '00%'\" 涓婇潰鏄父鐢ㄧ殑瀵煎嚭錛屽浜庡帇緙╂垜涓嶅お鍦ㄦ剰錛岀敤winzip鎶奷mp鏂囦歡鍙互寰堝ソ鐨勫帇緙┿?br /> 涓嶈繃鍦ㄤ笂闈㈠懡浠ゅ悗闈?鍔犱笂 compress=y 灝卞彲浠ヤ簡 鏁版嵁鐨勫鍏?br /> 1 灝咲:\daochu.dmp 涓殑鏁版嵁瀵煎叆 TEST鏁版嵁搴撲腑銆?br /> imp system/manager@TEST file=d:\daochu.dmp 涓婇潰鍙兘鏈夌偣闂錛屽洜涓烘湁鐨勮〃宸茬粡瀛樺湪錛岀劧鍚庡畠?yōu)鎶ラ敊锛屽璇ヨ〃灏变笉杩涜瀵煎叆銆?br /> 鍦ㄥ悗闈㈠姞涓?ignore=y 灝卞彲浠ヤ簡銆?br /> 2 灝哾:\daochu.dmp涓殑琛╰able1 瀵煎叆 imp system/manager@TEST file=d:\daochu.dmp tables=(table1) 鍩烘湰涓婁笂闈㈢殑瀵煎叆瀵煎嚭澶熺敤浜嗐備笉灝戞儏鍐墊垜鏄皢琛ㄥ交搴曞垹闄わ紝鐒跺悗瀵煎叆銆?br /> 娉ㄦ剰錛?br /> 浣犺鏈夎凍澶熺殑鏉冮檺錛屾潈闄愪笉澶熷畠浼氭彁紺轟綘銆?br /> 鏁版嵁搴撴椂鍙互榪炰笂鐨勩傚彲浠ョ敤tnsping TEST 鏉ヨ幏寰楁暟鎹簱TEST鑳藉惁榪炰笂 闄勫綍涓錛?br /> 緇欑敤鎴峰鍔犲鍏ユ暟鎹潈闄愮殑鎿嶄綔 絎竴,鍚姩sql*puls 絎簩錛屼互system/manager鐧婚檰 絎笁錛宑reate user 鐢ㄦ埛鍚?IDENTIFIED BY 瀵嗙爜 錛堝鏋滃凡緇忓垱寤鴻繃鐢ㄦ埛錛岃繖姝ュ彲浠ョ渷鐣ワ級 絎洓錛孏RANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW , DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE, DBA,CONNECT,RESOURCE,CREATE SESSION TO 鐢ㄦ埛鍚嶅瓧 絎簲, 榪愯-cmd-榪涘叆dmp鏂囦歡鎵鍦ㄧ殑鐩綍, imp userid=system/manager full=y file=*.dmp 鎴栬?imp userid=system/manager full=y file=filename.dmp 瀹夎oracle9I Szportdb\szportdb\szportdb 鐢╯ysdba 鐧誨綍寤虹珛鐢ㄦ埛錛歴zportdb 琛ㄧ┖闂村彲浠ヨ嚜宸辮瀹氾紝涔熷彲浠sers 鍊掑叆鏁版嵁搴撱?br /> Imp szportdb/szportdb@szportdb full=y C:\szportdb.dmp ignore= ]]>鍏ㄦ柟浣嶇殑鎶鏈湇鍔″強鐩稿叧鎶鏈В鍐蟲柟妗堬紙綰痡ava瑙e喅鏂規(guī)錛?/title> http://m.tkk7.com/paulwong/archive/2013/05/11/399132.htmlpaulwong paulwong Fri, 10 May 2013 16:17:00 GMT http://m.tkk7.com/paulwong/archive/2013/05/11/399132.html http://m.tkk7.com/paulwong/comments/399132.html http://m.tkk7.com/paulwong/archive/2013/05/11/399132.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/399132.html http://m.tkk7.com/paulwong/services/trackbacks/399132.html http://www.iteye.com/topic/1128561
@import url(http://m.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ]]> 涓涓笉閿欑殑瀛︿範JAVA鏁欑▼ http://m.tkk7.com/paulwong/archive/2013/03/29/397147.htmlpaulwong paulwong Fri, 29 Mar 2013 05:47:00 GMT http://m.tkk7.com/paulwong/archive/2013/03/29/397147.html http://m.tkk7.com/paulwong/comments/397147.html http://m.tkk7.com/paulwong/archive/2013/03/29/397147.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/397147.html http://m.tkk7.com/paulwong/services/trackbacks/397147.html http://tutorials.jenkov.com/java-concurrency/index.html ]]> JeeSite 浼佷笟淇℃伅綆$悊緋葷粺鍩虹妗嗘灦 http://m.tkk7.com/paulwong/archive/2013/03/17/396555.htmlpaulwong paulwong Sun, 17 Mar 2013 04:29:00 GMT http://m.tkk7.com/paulwong/archive/2013/03/17/396555.html http://m.tkk7.com/paulwong/comments/396555.html http://m.tkk7.com/paulwong/archive/2013/03/17/396555.html#Feedback 0 http://m.tkk7.com/paulwong/comments/commentRss/396555.html http://m.tkk7.com/paulwong/services/trackbacks/396555.html 1銆丼ervices鐩稿叧 Core Framework錛歋pring Framework 3.2銆?br />Security Framework錛欰pache Shiro 1.2銆?br /> 2銆乄eb鐩稿叧 MVC Framework錛歋pringMVC 3.2銆?br />Layout Decoration錛歋iteMesh 2.4銆?br />JavaScript Library錛欽Query 1.9銆?br />CSS Framework錛歍witter Bootstrap 2.0.4銆?br />JavaScript/CSS Compressor錛歒UI Compressor 2.4銆?br />Front Validation錛欽Query Validation Plugin 1.11銆?br /> 3銆丏atabase鐩稿叧 ORM Framework錛歋pring-Data-JPA 1.3銆丠ibernate 4.1銆?br />Connection Pool錛欱oneCP 0.7 Bean Validation錛欻ibernate Validation 4.3.0銆?br />Cache錛欵hcache 2.6銆?br /> 4銆乀ools 鐩稿叧 Commons錛欰pache Commons JSON Mapper錛欽ackson 2.1 Bean Mapper錛欴ozer 5.3.2 Full-text search錛欻ibernate Search 4.2錛圓pache Lucene 3.6錛夈両K Analyzer 2012_u6涓枃鍒嗚瘝 Log Manager錛歀og4j 1.2 http://thinkgem.github.com/jeesite/ https://github.com/thinkgem/jeesite ]]>
主站蜘蛛池模板:
国产精品冒白浆免费视频 |
日本免费网址大全在线观看 |
亚洲AⅤ永久无码精品AA |
亚洲精品无码日韩国产不卡av |
青青在线久青草免费观看 |
亚洲国产乱码最新视频 |
国产精品视频永久免费播放 |
亚洲AV综合色区无码二区偷拍 |
久久久久久国产a免费观看黄色大片 |
亚洲另类春色校园小说 |
美女网站免费福利视频 |
亚洲欧美成人av在线观看 |
最近的免费中文字幕视频 |
亚洲爆乳AAA无码专区 |
免费在线精品视频 |
中文字幕免费在线播放 |
亚洲精品国产成人专区 |
国产在线jyzzjyzz免费麻豆 |
avtt天堂网手机版亚洲 |
国产成人免费一区二区三区 |
www免费插插视频 |
亚洲高清国产拍精品26U |
51在线视频免费观看视频 |
456亚洲人成在线播放网站 |
日本一道高清不卡免费 |
日韩大片免费观看视频播放 |
国产精品亚洲一区二区三区在线
|
大地资源中文在线观看免费版 |
亚洲香蕉网久久综合影视 |
三年片在线观看免费观看大全一 |
久久久久亚洲精品天堂 |
最近高清国语中文在线观看免费 |
免费看又黄又爽又猛的视频软件 |
国产A在亚洲线播放 |
欧美a级成人网站免费 |
一级毛片a免费播放王色 |
91亚洲国产成人久久精品 |
亚洲成网777777国产精品 |
一级毛片免费不卡在线 |
精品无码专区亚洲 |
久久精品亚洲综合一品 |