锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产成人久久三区,亚洲日韩精品无码专区,无码专区一va亚洲v专区在线http://www.tkk7.com/pitey/category/37529.htmlzh-cnWed, 11 Feb 2009 04:05:47 GMTWed, 11 Feb 2009 04:05:47 GMT60杞?Message Driven POJOhttp://www.tkk7.com/pitey/archive/2009/02/11/254198.htmlPiteyPiteyWed, 11 Feb 2009 01:52:00 GMThttp://www.tkk7.com/pitey/archive/2009/02/11/254198.htmlhttp://www.tkk7.com/pitey/comments/254198.htmlhttp://www.tkk7.com/pitey/archive/2009/02/11/254198.html#Feedback0http://www.tkk7.com/pitey/comments/commentRss/254198.htmlhttp://www.tkk7.com/pitey/services/trackbacks/254198.html姹熷崡鐧借。 
  
    涓鐩村笇鏈涢偅浜汮瀛楀ご鐨勫崗璁兘鏈夊嚑涓彁鍓嶅憡鑰佽繕涔$殑錛屽ソ鍑忚交涓涓嬫垜浠殑璐熸媴錛岀壒鍒槸榪橶ebService婊″ぉ椋炵殑鏃朵唬銆備絾浼間箮榪樻湁寰堜箙閮借疆涓嶅埌JMS鐨勬秷澶憋細

    1.鍥犱負
    1.瀹冩槸銆奅ffective Enterprise Java銆嬬殑涓涓疄璺點?#160;
    鍙互鎶婁笉褰卞搷鐢ㄦ埛鎵ц緇撴灉鍙堟瘮杈冭楁椂鐨勪換鍔★紙姣斿鍙戦偖浠墮氱煡綆$悊鍛橈級寮傛鐨勬墧緇橨MS 鏈嶅姟绔幓鍋氾紝鑰屽敖蹇殑鎶婂睆騫曡繑榪樼粰鐢ㄦ埛銆?br />     鑰屼笖鏈嶅姟绔兘澶熷綰跨▼鎺掗槦鍝嶅簲--楂樺茍鍙戠殑璇鋒眰銆?br />
    2. 鍙互鍦↗ava涓栫晫閲岃揪鍒版渶楂樼殑瑙h︺?br />        瀵規(guī)瘮WebService錛孞MS鐨勫鎴風涓庢湇鍔$鏃犻渶鐩磋繛錛岀敋鑷蟲棤闇鐭ユ檽瀵規(guī)柟鏄皝銆佸湪鍝噷銆佹湁澶氬皯浜猴紝鍙瀵規(guī)祦榪囩殑淇℃伅浣滃搷搴斿氨琛屼簡銆傚鐗典竴鍙戝姩鍏ㄨ韓鐨勪紒涓氬簲鐢ㄦ潵璇村緢杞葷渷銆?br />        
     2. 浣嗘槸
     1. Message Bean甯︾潃EJB緋葷殑鑽e厜錛屾楠ゆ瘮杈冪箒鏉傦紝浣犻渶瑕佸疄鐜癕essageDrivenBean銆丮essageListener鎺ュ彛錛岃繕闇瑕佽緗瓻JB鐨勯厤緗俊鎭紝鐒跺悗鏄痙eploy....

     2. Spring 1.x 鎻愪緵鐨凧MS Template綆鍖栦簡JMS Client绔殑緙栫▼錛屼絾騫舵病鏈夋秹鍙婂埌鏈嶅姟绔殑鏀歸犮?br />
     3. 鎵浠ワ紝SpringSide鐨凪essage Driven POJO鏂規(guī)

      Spring JMS Template + ActiveMQ + Jencks

1. 瀹冩槸Lightweight鐨勶紝鍩烘湰涓婂彧鏄櫘閫歅OJO錛屼笉鐢ㄦ悶澶涓滆タ銆?/p>

2. 瀹冩槸Spring Base鐨勶紝鍙互浣跨敤Spring鐨勫悇縐嶇壒鎬уIOC銆丄OP銆?/p>

3. 瀹冩槸Effective鐨勶紝鍩轟簬Jencks鐨凧CA Container瀹炵幇 pool connection錛宑ontrol transactions and manage security銆?/p>

4. 浣嗗畠鏄痺ithdout EJB Container鐨勩?br />
鍏跺疄瀹冭繕涓嶆槸100% POJO錛岄櫎闈炲啀鐢ㄤ笂Lingo錛屼絾鎴戝凡涓嶆兂璧板緱澶繙銆?br />
4.榛勯噾鐗堥厤緗?br />       濡傛灉浣犳兂鎵句竴涓狝ctiveMQ 3.2 Stable鐗?Spring鐨?00%鍙鐨勯厤緗枃浠訛紝浼拌鍙兘鍒?a target="_blank">SpringSide欏圭洰閲岀湅浜嗐傜綉涓婄殑鏂囩珷錛屼笉鏄凡榪囨椂錛屽氨鏄笉鍒囬銆?br />
     鎺ㄨ崘涓嫳涓や喚鏈鎺ヨ繎鐨勬枃妗o細
     鎹風壒鎱堟湅(IDEA涓浗): Spring鍜孧essage Bean鐨勬暣鍚?/a>
    
Spring loaded:  Message-Driven POJOs 

     涓嶈繃瀹冧滑閮芥湁涓猳utdate鐨勫湴鏂?-ActiveMQ3.2寮濮嬩笉鍐嶈嚜甯CA Cotainer浜嗭紝鑰屾槸灝嗗叾涓嶨ernimo 鍚堜綔鑰屾垚浜咼encks錛岄渶鍙﹀瀹夎銆?br />
 5.SpringSide鏃呮父鎸囧崡

      pom.xml閲岀殑JMS閮ㄥ垎 --鎵闇鐨勪緷璧栧寘銆?br />       applicationContext-jms.xml --榛勯噾鐗堥厤緗枃浠躲?br />       activemq.xml  --AcitveMQ Broker閰嶇疆鏂囦歡銆?br />       OrderPlaceMDP.java --Message Driven Pojo銆?br />       JmsTest.java --鍗曞厓嫻嬭瘯鐢ㄤ緥銆?br />       OrderManger.java鐨凬odifyOrder()鍑芥暟 --瀹為檯搴旂敤鐨勫湴鏂廣?#160;

銆POJO澶畝鍗曪紝鍞竴楹葷儲鐨勯厤緗枃浠跺凡娉ㄩ噴錛岃繖閲屼篃灝辨棤璇濅簡銆?/p>

Pitey 2009-02-11 09:52 鍙戣〃璇勮
]]>
Spring浜嬬墿鎷︽埅鍣ㄥ涔犵瑪璁?/title><link>http://www.tkk7.com/pitey/archive/2009/02/10/254143.html</link><dc:creator>Pitey</dc:creator><author>Pitey</author><pubDate>Tue, 10 Feb 2009 15:07:00 GMT</pubDate><guid>http://www.tkk7.com/pitey/archive/2009/02/10/254143.html</guid><wfw:comment>http://www.tkk7.com/pitey/comments/254143.html</wfw:comment><comments>http://www.tkk7.com/pitey/archive/2009/02/10/254143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/pitey/comments/commentRss/254143.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/pitey/services/trackbacks/254143.html</trackback:ping><description><![CDATA[<p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt">Spring浜嬬墿鎷︽埅鍣紝鎸夌収閫氱煡鏂瑰紡鍒嗕負[鍓嶇疆閫氱煡錛圔efore advice錛?榪斿洖鍚庨氱煡錛圓fter returning advice錛?br /> ,鎶涘嚭鍚庨氱煡錛圓fter throwing advice錛?鍚庨氱煡錛圓fter (finally) advice錛?鐜粫閫氱煡錛圓round Advice錛塢<br /> 閰嶇疆鏂瑰紡鍒咢AspectJ,XML錛岀綉涓婃瘮杈冨鐨勬槸Spring1.1鎴杧ml+@AspectJ鏂瑰紡閰嶇疆錛屼緥瀛愪嬌鐢╔ML鏂瑰紡閰嶇疆</span></span></span></span></p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt">1.瀹氫箟鍒囬潰綾繪帴鍙o紝鍒囬潰綾誨疄鐜拌繖涓帴鍙c傚0鏄庯紙濡傛灉琚唬鐞嗙殑鐩爣瀵硅薄瀹炵幇浜嗚嚦灝戜竴涓帴鍙o紝鍒欎細浣跨敤JDK鍔ㄦ佷唬鐞嗐傛墍鏈夎鐩爣綾誨瀷瀹炵幇鐨勬帴鍙i兘灝嗚浠g悊銆傝嫢璇ョ洰鏍囧璞℃病鏈夊疄鐜頒換浣曟帴鍙o紝鍒欏垱寤轟竴涓狢GLIB浠g悊錛?br /> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_29_94_Open_Image" onclick="this.style.display='none'; Codehighlighter1_29_94_Open_Text.style.display='none'; Codehighlighter1_29_94_Closed_Image.style.display='inline'; Codehighlighter1_29_94_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_29_94_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_29_94_Closed_Text.style.display='none'; Codehighlighter1_29_94_Open_Image.style.display='inline'; Codehighlighter1_29_94_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">interface</span><span style="color: #000000"> ITestAdvice </span><span id="Codehighlighter1_29_94_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_29_94_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doPlay();<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doStop(Object reval);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_136_295_Open_Image" onclick="this.style.display='none'; Codehighlighter1_136_295_Open_Text.style.display='none'; Codehighlighter1_136_295_Closed_Image.style.display='inline'; Codehighlighter1_136_295_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_136_295_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_136_295_Closed_Text.style.display='none'; Codehighlighter1_136_295_Open_Image.style.display='inline'; Codehighlighter1_136_295_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Tv </span><span style="color: #0000ff">implements</span><span style="color: #000000"> ITestAdvice</span><span id="Codehighlighter1_136_295_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_136_295_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_176_230_Open_Image" onclick="this.style.display='none'; Codehighlighter1_176_230_Open_Text.style.display='none'; Codehighlighter1_176_230_Closed_Image.style.display='inline'; Codehighlighter1_176_230_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_176_230_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_176_230_Closed_Text.style.display='none'; Codehighlighter1_176_230_Open_Image.style.display='inline'; Codehighlighter1_176_230_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doStop(Object reval) </span><span id="Codehighlighter1_176_230_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_176_230_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(reval.toString() </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">鍏抽棴鐢?shù)瑙嗘?</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_256_291_Open_Image" onclick="this.style.display='none'; Codehighlighter1_256_291_Open_Text.style.display='none'; Codehighlighter1_256_291_Closed_Image.style.display='inline'; Codehighlighter1_256_291_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_256_291_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_256_291_Closed_Text.style.display='none'; Codehighlighter1_256_291_Open_Image.style.display='inline'; Codehighlighter1_256_291_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> doPlay() </span><span id="Codehighlighter1_256_291_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_256_291_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">鎵撳紑鐢?shù)瑙嗘?</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt"> </span></span></span></span></p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt">2.瀹氫箟鍓嶇疆閫氱煡鎷︽埅澶勭悊綾?/span></span></span></span></p> <p> </p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_37_119_Open_Image" onclick="this.style.display='none'; Codehighlighter1_37_119_Open_Text.style.display='none'; Codehighlighter1_37_119_Closed_Image.style.display='inline'; Codehighlighter1_37_119_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_37_119_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_37_119_Closed_Text.style.display='none'; Codehighlighter1_37_119_Open_Image.style.display='inline'; Codehighlighter1_37_119_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestMethodBeforeAdvice  </span><span id="Codehighlighter1_37_119_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_37_119_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_76_115_Open_Image" onclick="this.style.display='none'; Codehighlighter1_76_115_Open_Text.style.display='none'; Codehighlighter1_76_115_Closed_Image.style.display='inline'; Codehighlighter1_76_115_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_76_115_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_76_115_Closed_Text.style.display='none'; Codehighlighter1_76_115_Open_Image.style.display='inline'; Codehighlighter1_76_115_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> before(JoinPoint jpt) </span><span id="Codehighlighter1_76_115_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_76_115_Open_Text"><span style="color: #000000">{  //鍙傛暟JoinPoint涓洪粯璁ゅ弬鏁?br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">姝e湪鎵撳紑鐢?shù)瑙?.</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> <br /> <span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt">3.瀹氫箟鎷︽埅鍣ㄩ厤緗枃浠?/span></span></span></span></p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.Tv</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">beforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.TestMethodBeforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspectj</span><span style="color: #000000">-</span><span style="color: #000000">autoproxy proxy</span><span style="color: #000000">-</span><span style="color: #000000">target</span><span style="color: #000000">-</span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">true</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 瀹氫箟鍒囧叆鐐?#160;</span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:pointcut id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> expression</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">execution(* com.pitey.demo.*.*(..))</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 瀹氫箟鍒囬潰 </span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspect id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">beforeAdviceAspect</span><span style="color: #000000">"</span><span style="color: #000000"> ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">beforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><!--</span><span style="color: #000000"> 瀹氫箟鍓嶇疆閫氱煡 </span><span style="color: #000000">--></span><span style="color: #000000">   <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><</span><span style="color: #000000">aop:before method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">before</span><span style="color: #000000">"</span><span style="color: #000000"> pointcut</span><span style="color: #000000">-</span><span style="color: #000000">ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodAdvice</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000">    <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"></</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 4.嫻嬭瘯涓涓嬪墠緗氱煡<br /> <span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_39_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_214_Open_Text.style.display='none'; Codehighlighter1_39_214_Closed_Image.style.display='inline'; Codehighlighter1_39_214_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_39_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_39_214_Closed_Text.style.display='none'; Codehighlighter1_39_214_Open_Image.style.display='inline'; Codehighlighter1_39_214_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</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"> main(String[] args) </span><span id="Codehighlighter1_39_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_39_214_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        ApplicationContext context </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">config\\advice.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Tv tv </span><span style="color: #000000">=</span><span style="color: #000000"> (Tv)context.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        tv.doPlay();        <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />緇撴灉:<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            姝e湪鎵撳紑鐢?shù)瑙嗘?img src="http://www.tkk7.com/Images/dot.gif" alt="" />..<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            鎵撳紑鐢?shù)瑙嗘?br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 5.瀹氫箟榪斿洖鍚庨氱煡鎷︽埅澶勭悊綾?/p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_35_200_Open_Image" onclick="this.style.display='none'; Codehighlighter1_35_200_Open_Text.style.display='none'; Codehighlighter1_35_200_Closed_Image.style.display='inline'; Codehighlighter1_35_200_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_35_200_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_35_200_Closed_Text.style.display='none'; Codehighlighter1_35_200_Open_Image.style.display='inline'; Codehighlighter1_35_200_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestAfterReturnAdvice </span><span id="Codehighlighter1_35_200_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_35_200_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_99_196_Open_Image" onclick="this.style.display='none'; Codehighlighter1_99_196_Open_Text.style.display='none'; Codehighlighter1_99_196_Closed_Image.style.display='inline'; Codehighlighter1_99_196_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_99_196_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_99_196_Closed_Text.style.display='none'; Codehighlighter1_99_196_Open_Image.style.display='inline'; Codehighlighter1_99_196_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> afterReturning(Object retVal) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> Throwable </span><span id="Codehighlighter1_99_196_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_99_196_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  String returnVal </span><span style="color: #000000">=</span><span style="color: #000000"> 鐢?shù)瑙嗘満宸簿l忔墦寮</span><span style="color: #000000">!</span><span style="color: #000000">"</span><span style="color: #000000">;</span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">  System.out.println(returnVal);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  retVal</span><span style="color: #000000">=</span><span style="color: #000000"> (Object)returnVal;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 6.瀹氫箟鎷︽埅鍣ㄩ厤緗枃浠?/p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt"> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturnAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.TestAfterReturnAdvice</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 瀹氫箟鍒囬潰 </span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspect id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturnAdviceAspect</span><span style="color: #000000">"</span><span style="color: #000000"> ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturnAdvice</span><span style="color: #000000">"</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><!--</span><span style="color: #000000"> 瀹氫箟鍚庣疆榪斿洖閫氱煡  </span><span style="color: #000000">--></span><span style="color: #000000">   <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />   </span><span style="color: #000000"><</span><span style="color: #000000">aop:after</span><span style="color: #000000">-</span><span style="color: #000000">returning method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">afterReturning</span><span style="color: #000000">"</span><span style="color: #000000"> pointcut</span><span style="color: #000000">-</span><span style="color: #000000">ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> returning</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">retVal</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"> </span><span style="color: #008000">//</span><span style="color: #008000">returing 涓鴻繑鍥炲弬鏁?/span><span style="color: #008000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000"> </span><span style="color: #000000"></</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 7.嫻嬭瘯涓涓嬭繑鍥炲悗閫氱煡<br /> <span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt"><br /> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_39_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_214_Open_Text.style.display='none'; Codehighlighter1_39_214_Closed_Image.style.display='inline'; Codehighlighter1_39_214_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_39_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_39_214_Closed_Text.style.display='none'; Codehighlighter1_39_214_Open_Image.style.display='inline'; Codehighlighter1_39_214_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</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"> main(String[] args) </span><span id="Codehighlighter1_39_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_39_214_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        ApplicationContext context </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">config\\advice.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Tv tv </span><span style="color: #000000">=</span><span style="color: #000000"> (Tv)context.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        tv.doPlay();        <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />緇撴灉:<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            姝e湪鎵撳紑鐢?shù)瑙嗘?img src="http://www.tkk7.com/Images/dot.gif" alt="" />..<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            鎵撳紑鐢?shù)瑙嗘?br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            鐢?shù)瑙嗘満宸簿l忔墦寮</span><span style="color: #000000">!</span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> 8.瀹氫箟鐜粫閫氱煡鎷︽埅澶勭悊綾伙紙鐜粫閫氱煡鍦ㄤ竴涓柟娉曟墽琛屼箣鍓嶅拰涔嬪悗鎵ц銆?瀹冧嬌寰楅氱煡鏈夋満浼氭棦鍦ㄤ竴涓柟娉曟墽琛屼箣鍓嶅張鍦ㄦ墽琛屼箣鍚庤繍琛屻傚茍涓旓紝瀹冨彲浠ュ喅瀹氳繖涓柟娉曞湪浠涔堟椂鍊欐墽琛岋紝濡備綍鎵ц錛岀敋鑷蟲槸鍚︽墽琛屻?鐜粫閫氱煡緇忓父鍦ㄥ湪鏌愮嚎紼嬪畨鍏ㄧ殑鐜涓嬶紝浣犻渶瑕佸湪涓涓柟娉曟墽琛屼箣鍓嶅拰涔嬪悗鍏變韓鏌愮鐘舵佺殑鏃跺欎嬌鐢ㄣ?璇峰敖閲忎嬌鐢ㄦ渶綆鍗曠殑婊¤凍浣犻渶姹傜殑閫氱煡銆傦紙姣斿濡傛灉鍓嶇疆閫氱煡錛坆efore advice錛変篃鍙互閫傜敤鐨勬儏鍐典笅涓嶈浣跨敤鐜粫閫氱煡錛夛級<br /> 閫氱煡鏂規(guī)硶鐨勭涓涓弬鏁扮殑綾誨瀷蹇呴』鏄?<code class="interfacename">ProceedingJoinPoint</code> 綾誨瀷銆傚湪閫氱煡鐨勪富浣撲腑錛岃皟鐢?<code class="interfacename">ProceedingJoinPoint</code>鐨?code class="literal">proceed()</code> 鏂規(guī)硶鏉ユ墽琛岀湡姝g殑鏂規(guī)硶銆?<code class="literal">proceed</code> 鏂規(guī)硶涔熷彲鑳戒細琚皟鐢ㄥ茍涓斾紶鍏ヤ竴涓?<code class="classname">Object[]</code> 瀵硅薄 - 璇ユ暟緇勫皢浣滀負鏂規(guī)硶鎵ц鏃跺欑殑鍙傛暟銆?/p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_33_245_Open_Image" onclick="this.style.display='none'; Codehighlighter1_33_245_Open_Text.style.display='none'; Codehighlighter1_33_245_Closed_Image.style.display='inline'; Codehighlighter1_33_245_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_33_245_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_33_245_Closed_Text.style.display='none'; Codehighlighter1_33_245_Open_Image.style.display='inline'; Codehighlighter1_33_245_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestMethodIntercepor</span><span id="Codehighlighter1_33_245_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_33_245_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> <br /> <img id="Codehighlighter1_112_242_Open_Image" onclick="this.style.display='none'; Codehighlighter1_112_242_Open_Text.style.display='none'; Codehighlighter1_112_242_Closed_Image.style.display='inline'; Codehighlighter1_112_242_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_112_242_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_112_242_Closed_Text.style.display='none'; Codehighlighter1_112_242_Open_Image.style.display='inline'; Codehighlighter1_112_242_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> Object doBasicProfiling(ProceedingJoinPoint  pjp) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> Throwable </span><span id="Codehighlighter1_112_242_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_112_242_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">begining<img src="http://www.tkk7.com/Images/dot.gif" alt="" /><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  Object obj </span><span style="color: #000000">=</span><span style="color: #000000"> pjp.proceed();<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">ending<img src="http://www.tkk7.com/Images/dot.gif" alt="" /><img src="http://www.tkk7.com/Images/dot.gif" alt="" />..</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />  </span><span style="color: #0000ff">return</span><span style="color: #000000"> obj;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" /> }</span></span><span style="color: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> <br /> 9.瀹氫箟鎷︽埅鍣ㄩ厤緗枃浠?/p> <p><span style="font-size: 10pt"><span style="font-family: 瀹嬩綋"><span style="font-size: 12pt"><span style="font-size: 10pt"> </span></span></span></span></p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><</span><span style="color: #000000">bean id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">aroundAdvice</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">com.pitey.demo.TestMethodIntercepor</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><!--</span><span style="color: #000000"> 瀹氫箟鍒囬潰 </span><span style="color: #000000">--></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"><</span><span style="color: #000000">aop:aspect id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">aroundAspect</span><span style="color: #000000">"</span><span style="color: #000000"> ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">aroundAdvice</span><span style="color: #000000">"</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"><</span><span style="color: #000000">aop:around method</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">doBasicProfiling</span><span style="color: #000000">"</span><span style="color: #000000"> pointcut</span><span style="color: #000000">-</span><span style="color: #000000">ref</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">methodBeforeAdvice</span><span style="color: #000000">"</span><span style="color: #000000">/></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #000000"></</span><span style="color: #000000">aop:aspect</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /> </span><span style="color: #000000"></</span><span style="color: #000000">aop:config</span><span style="color: #000000">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p><br /> <br /> 10.嫻嬭瘯涓涓嬬幆緇曢氱煡<br /> </p> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left-color: #cccccc; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee; "><img id="Codehighlighter1_39_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_214_Open_Text.style.display='none'; Codehighlighter1_39_214_Closed_Image.style.display='inline'; Codehighlighter1_39_214_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_39_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_39_214_Closed_Text.style.display='none'; Codehighlighter1_39_214_Open_Image.style.display='inline'; Codehighlighter1_39_214_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</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"> main(String[] args) </span><span id="Codehighlighter1_39_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_39_214_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        ApplicationContext context </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ClassPathXmlApplicationContext(</span><span style="color: #000000">"</span><span style="color: #000000">config\\advice.xml</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Tv tv </span><span style="color: #000000">=</span><span style="color: #000000"> (Tv)context.getBean(</span><span style="color: #000000">"</span><span style="color: #000000">tv</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        tv.doPlay();        <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />緇撴灉:<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            begining<img src="http://www.tkk7.com/Images/dot.gif" alt="" /><img src="http://www.tkk7.com/Images/dot.gif" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            鎵撳紑鐢?shù)瑙嗘?br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />            ending<img src="http://www.tkk7.com/Images/dot.gif" alt="" /><img src="http://www.tkk7.com/Images/dot.gif" alt="" />..<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <img src ="http://www.tkk7.com/pitey/aggbug/254143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/pitey/" target="_blank">Pitey</a> 2009-02-10 23:07 <a href="http://www.tkk7.com/pitey/archive/2009/02/10/254143.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring 鑾峰彇Connectionhttp://www.tkk7.com/pitey/archive/2008/03/05/183932.htmlPiteyPiteyWed, 05 Mar 2008 04:45:00 GMThttp://www.tkk7.com/pitey/archive/2008/03/05/183932.htmlhttp://www.tkk7.com/pitey/comments/183932.htmlhttp://www.tkk7.com/pitey/archive/2008/03/05/183932.html#Feedback0http://www.tkk7.com/pitey/comments/commentRss/183932.htmlhttp://www.tkk7.com/pitey/services/trackbacks/183932.htmlapplicationContext.xml閲岄潰璁劇疆

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="default" autowire="default" dependency-check="default">
        <property name="jndiName">
            <value>JDBC/TEST</value>           
        </property>
</bean> 鎴栬?br />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
        <property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:ora"></property>
        <property name="username" value="test"></property>
        <property name="password" value="123456"></property>
    </bean>


閫氳繃
DataSourceUtils.getConnection(DataSource錛?灝辮兘鑾峰彇鍒拌緗殑DataSource 鐒跺悗鑾峰緱connection

public static Connection getConnection()
            
throws SQLException
    {        
        
return DataSourceUtils.getConnection((DataSource)ServiceLocator.getBean("dataSource"));
}



Pitey 2008-03-05 12:45 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 国产精品亚洲色婷婷99久久精品| 亚洲国产精品一区第二页| 美女视频黄的全免费视频网站| 99在线视频免费观看| 一级毛片a免费播放王色| 农村寡妇一级毛片免费看视频| 亚洲暴爽av人人爽日日碰| 亚洲欧美国产国产一区二区三区 | 4399影视免费观看高清直播| 亚欧免费无码aⅴ在线观看| 久久精品国产大片免费观看| 久久久精品午夜免费不卡| 野花香高清视频在线观看免费 | 亚洲熟妇无码一区二区三区导航| 精品亚洲AV无码一区二区| 亚洲国产精品一区二区三区在线观看 | 国产精品入口麻豆免费观看| 麻豆视频免费观看| 免费国产成人高清在线观看网站| 男人的好看免费观看在线视频| 久久久www成人免费毛片| 天天摸夜夜摸成人免费视频| 成人免费视频国产| 亚洲精品老司机在线观看| 亚洲精品无码永久中文字幕| 亚洲成在人天堂在线| 亚洲精品美女在线观看| 456亚洲人成在线播放网站| 久久无码av亚洲精品色午夜| 一级特级aaaa毛片免费观看| 免费观看在线禁片| 一二三四在线观看免费高清中文在线观看 | 999久久久免费精品播放| 成人免费午夜无码视频| 国产成人免费全部网站| 亚洲一区视频在线播放| 亚洲成a人片77777老司机| 亚洲伊人久久精品| 自拍偷自拍亚洲精品播放| 99久久国产精品免费一区二区| 免费观看无遮挡www的小视频|