锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品一区在线播放,国产一区二区三区观看,美洲精品一卡2卡三卡4卡四卡http://www.aygfsteel.com/szhswl/category/27848.html瀹嬮拡榪樼殑涓漢絀洪棿zh-cnWed, 05 Dec 2007 18:24:41 GMTWed, 05 Dec 2007 18:24:41 GMT60Spring2.5鐨勭粍浠惰嚜鍔ㄦ悳绱?/title><link>http://www.aygfsteel.com/szhswl/articles/165389.html</link><dc:creator>瀹嬮拡榪?/dc:creator><author>瀹嬮拡榪?/author><pubDate>Wed, 05 Dec 2007 01:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/szhswl/articles/165389.html</guid><wfw:comment>http://www.aygfsteel.com/szhswl/comments/165389.html</wfw:comment><comments>http://www.aygfsteel.com/szhswl/articles/165389.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/szhswl/comments/commentRss/165389.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/szhswl/services/trackbacks/165389.html</trackback:ping><description><![CDATA[<p>濮撳悕錛?钄¤秴 鐢熸棩錛?1976-09-03 鎬葷粨錛?鍏勾澶т紒涓氳蔣浠跺紑鍙戠粡楠岋紙鍏朵腑涓ゅ勾浠昏蔣浠舵灦鏋勫笀錛夛紝綺鵑欽2EE鐩稿叧鎶鏈強鏋舵瀯璁捐錛屾槸SUN鍙奙icrosoft鍩硅涓績鐗歸個楂樼璁插笀 SUN璁よ瘉鐨凧2EE鏋舵瀯甯?SCEA) SUN璁よ瘉鐨勫晢鍔$粍浠跺紑鍙戝憳(SCBCD) IBM璁よ瘉鐨凴UP涓撳 IBM璁よ瘉鐨凮OA&D (UML v2)涓撳 <br /> <br /> <br /> <br /> <br /> 瀵逛簬annotation鐨勬敮鎸佸拰緇勪歡鐨勯厤緗柟寮忔槸鎵╁厖鏄痵pring2.5鐨勪富瑕佹彁鍗囦箣涓銆傚叾涓粍浠跺湪綾昏礬寰勪笅鐨勮嚜鍔ㄦ悳绱㈠姛鑳戒篃鏄竴欏瑰煎緱娉ㄦ剰鐨勬柊澧炵壒鎬с?<br /> 鐜版潵鐪嬩釜紺轟緥錛?<br /> <br /> 鍥捐〃 1 紺轟緥涓秹鍙婄殑綾葷殑鍏崇郴 <br /> Command.java: <br /> package org.ccsoft.commands.imp; <br /> <br /> public interface Command { <br /> public void execute(); <br /> } <br /> <br /> CommandExecuter.java: <br /> package org.ccsoft.commands.imp; <br /> <br /> import org.springframework.beans.factory.annotation.Autowired; <br /> import org.springframework.beans.factory.annotation.Qualifier; <br /> import org.springframework.stereotype.Component; <br /> @Component("commandExecuter") <br /> public class CommandExecuter { <br /> private Command command; <br /> @Autowired <br /> <br /> public void setCommand(/*@Qualifier("helloCommand")*/ Command command) { <br /> this.command = command; <br /> } <br /> public void executeCommand(){ <br /> command.execute(); <br /> } <br /> } <br /> <br /> HelloCommand.java <br /> package org.ccsoft.commands.imp; <br /> <br /> import org.springframework.stereotype.Component; <br /> <br /> <br /> @Component <br /> public class HelloCommand implements Command{ <br /> public void execute() { <br /> System.out.println("Hello World"); <br /> } <br /> } <br /> <br /> 閰嶇疆鏂囦歡錛?<br /> <?xml version="1.0" encoding="UTF-8"?> <br /> <beans xmlns="<a href="http://www.aygfsteel.com/chaocai/archive/2007/12/04/<a%20href=" target="_new" http: www.springframework.org schema beans?>http://www.springframework.org/schema/beans</a>"" target="_new"><a target="_new">http://www.springframework.org/schema/beans</a>"</a> <br /> xmlns:xsi="<a target="_new" href_cetemp='http://www.w3.org/2001/XMLSchema-instance"'>http://www.w3.org/2001/XMLSchema-instance"</a> <br /> xmlns:context="<a href="http://www.aygfsteel.com/chaocai/archive/2007/12/04/<a%20href=" target="_new" http: www.springframework.org schema context?>http://www.springframework.org/schema/context</a>"" target="_new"><a target="_new">http://www.springframework.org/schema/context</a>"</a> <br /> xsi:schemaLocation="<a target="_new">http://www.springframework.org/schema/beans</a> <br /> <a target="_new">http://www.springframework.org/schema/beans</a>/spring-beans-2.5.xsd <br /> <a target="_new">http://www.springframework.org/schema/context</a> <br /> <a target="_new">http://www.springframework.org/schema/context</a>/spring-context-2.5.xsd"> <br /> <br /> <context:component-scan base-package="org.ccsoft"/> <br /> </beans> <br /> <br /> 嫻嬭瘯紼嬪簭濡備笅錛?<br /> package org.ccsoft; <br /> <br /> import org.ccsoft.commands.imp.CommandExecuter; <br /> import org.springframework.context.ApplicationContext; <br /> import org.springframework.context.support.ClassPathXmlApplicationContext; <br /> <br /> import junit.framework.TestCase; <br /> <br /> public class TestCommandExecuter extends TestCase { <br /> public void testExecuteCommand(){ <br /> ApplicationContext ctx=new ClassPathXmlApplicationContext("application.xml"); <br /> CommandExecuter exe=(CommandExecuter) ctx.getBean("commandExecuter"); <br /> exe.executeCommand(); <br /> } <br /> } <br /> 鍙互浠庨厤緗枃浠朵腑鍙戠幇錛岃繖嬈″茍娌℃湁鍍忓父瑙勭殑鏂瑰紡閭f牱錛屽0鏄庢墍浣跨敤鐨刡ean錛屽彧鏄鏄庝簡緇勪歡鎼滅儲鐨勫熀璺緞錛堜究浜庡噺灝戞悳绱㈣寖鍥達級“<context:component-scan base-package="org.ccsoft"/>”銆?<br /> 瑕佺偣錛?<br /> 1 鐢ˊComponent鏉ュ0鏄庢瘡涓粍浠訛紝鑰屼笉鏄氳繃閰嶇疆鏂囦歡涓殑bean鍏冪礌 <br /> 2 鍦ㄩ渶瑕佹敞鍏ュ叾浠栫粍浠剁殑鍦版柟浣跨敤@Autowired錛岄粯璁ゆ儏鍐典笅浼氭寜綾誨瀷榪涜渚濊禆鍏崇郴鐨勬煡鎵懼拰娉ㄥ叆 <br /> 3 鍙互鎸囧畾緇勪歡鐨処d錛岄氳繃@Component鐨勫鹼紝濡傦細@Component("commandExecuter")錛岃繖鏍風被浼間簬<bean id=” commandExecuter”…錛屾敞鎰忓鏋滀笉娉ㄦ槑璇ュ鹼紝spring灝嗕嬌鐢ㄩ粯璁ょ殑鍛藉悕瑙勫垯錛屽嵆綾葷殑鍚嶅瓧浣嗛瀛楁瘝灝忓啓錛屾墍浠ュ湪涓婁緥涓皢@Component("commandExecuter")鏀瑰啓涓篅Component鍚屾牱鏄彲浠ヨ繍琛岀殑銆?<br /> <br /> 浠g爜璇曢獙浜岋細 <br /> 鍦ㄤ笂闈㈠伐紼嬩腑鍔犲叆鏂扮殑Command鎺ュ彛瀹炵幇綾籗orryCommand. <br /> package org.ccsoft.commands.imp; <br /> <br /> import org.springframework.stereotype.Component; <br /> @Component <br /> public class SorryCommand implements Command { <br /> <br /> public void execute() { <br /> // TODO Auto-generated method stub <br /> System.out.println("Sorry"); <br /> } <br /> <br /> } <br /> 鍐嶈繍琛屾祴璇曠▼搴忥紝浼氬彂鐜扮▼搴忔棤娉曡繍琛岋紝鎶涘嚭浠ヤ笅寮傚父org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.ccsoft.commands.imp.Command] is defined: expected single matching bean but found 2: [helloCommand, sorryCommand] <br /> 榪欐槸鍥犱負鏍規嵁綾誨瀷鐨勬柟寮忔悳绱紝鎵懼埌浜嗕袱涓浉絎︾殑渚濊禆綾伙紝榪欐槸鎴戜滑蹇呴』鎸囨槑浣跨敤閭d釜緇勪歡銆?<br /> @Autowired <br /> <br /> public void setCommand(@Qualifier("helloCommand") Command command) { <br /> this.command = command; <br /> } <br /> 瑕佺偣錛?<br /> 4 鍦ㄥ涓悓綾葷粍浠跺瓨鍦ㄤ簬鏌ユ壘璺緞鏃跺繀欏婚氳繃@Qualifier鎸囨槑 <br /> <br /> 涓嶇煡涓轟粈涔堬紝spring鐨勮繖涓鏂扮壒鎬ф昏鎴戣仈鎯寵搗OSGi DS錛屼笉榪囦笌OSGi DS鐩告瘮涓漢璁や負spring鐨処oC榪樻槸鏈変簺涓嶄究鐨勫湴鏂癸紝OSGi DS鐨凷ervice鐨勫紩鐢ㄧ瓥鐣ヤ腑鐨凜ardinality鍙互鎸囧畾緇勪歡鐨勬敞鍏ョ瓥鐣ワ紝鍙互鏀寔灝嗗涓鍚堟潯浠剁殑緇勪歡澶氭娉ㄥ叆錛岃繖涓虹紪鍐欑粍浠跺鍣ㄨ繖鏍風殑搴旂敤鎻愪緵浜嗗緢澶х殑渚垮埄銆?<br /> 濡傦細 <br /> … <br /> private List<Command> commands錛?<br /> … <br /> public void setCommand(Command cmd){ <br /> commands.add(cmd); <br /> } <br /> <br /> …. <br /> <br /> 鏈鍚庯紝榪欓噷鍙槸娑夊強浜唖pring2.5涓浉鍏沖唴瀹逛腑闈炲父灝戠殑涓鐐癸紝濡傛灉澶у鏈夊叴瓚f繁鍏ヤ簡瑙e彲浠ュ弬鑰僺pring reference銆?<br /> 涓漢璁や負鍦ㄥぇ瀹跺厖鍒嗕韓鍙楁柊鐗規у甫鏉ョ殑渚垮埄鐨勫悓鏃朵篃瑕佷富瑕佸埌鏂扮壒鎬ф槸鍚︿細瀵瑰簲鐢ㄧ殑鍙淮鎶ゆу拰閮ㄧ講鏃舵敼鍙樻敞鍏ュ叧緋葷殑鏂逛究鎬у甫鏉ヨ礋闈㈠獎鍝嶃?<br /> <br /> <br /> <br /> 钄¤秴 <br /> JavaEE 鍜ㄨ欏鵑棶 <br /> SCEA <br /> IBM Certified Solution Designer for OOA&D UML2 <br /> <br /> 杞嚜錛?a >http://dev2dev.bea.com.cn/blog/chaocai/200712/spring_osgi_04_719.html</a></p> <img src ="http://www.aygfsteel.com/szhswl/aggbug/165389.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/szhswl/" target="_blank">瀹嬮拡榪?/a> 2007-12-05 09:59 <a href="http://www.aygfsteel.com/szhswl/articles/165389.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">林周县</a>| <a href="http://" target="_blank">牟定县</a>| <a href="http://" target="_blank">扶风县</a>| <a href="http://" target="_blank">五家渠市</a>| <a href="http://" target="_blank">香河县</a>| <a href="http://" target="_blank">阜阳市</a>| <a href="http://" target="_blank">德昌县</a>| <a href="http://" target="_blank">庄河市</a>| <a href="http://" target="_blank">辽阳县</a>| <a href="http://" target="_blank">本溪</a>| <a href="http://" target="_blank">四川省</a>| <a href="http://" target="_blank">金秀</a>| <a href="http://" target="_blank">晴隆县</a>| <a href="http://" target="_blank">周宁县</a>| <a href="http://" target="_blank">木兰县</a>| <a href="http://" target="_blank">庄浪县</a>| <a href="http://" target="_blank">南昌县</a>| <a href="http://" target="_blank">延长县</a>| <a href="http://" target="_blank">清河县</a>| <a href="http://" target="_blank">安远县</a>| <a href="http://" target="_blank">焉耆</a>| <a href="http://" target="_blank">石屏县</a>| <a href="http://" target="_blank">珲春市</a>| <a href="http://" target="_blank">泾阳县</a>| <a href="http://" target="_blank">辽源市</a>| <a href="http://" target="_blank">类乌齐县</a>| <a href="http://" target="_blank">北票市</a>| <a href="http://" target="_blank">浏阳市</a>| <a href="http://" target="_blank">华亭县</a>| <a href="http://" target="_blank">汽车</a>| <a href="http://" target="_blank">左云县</a>| <a href="http://" target="_blank">平武县</a>| <a href="http://" target="_blank">曲靖市</a>| <a href="http://" target="_blank">大渡口区</a>| <a href="http://" target="_blank">麦盖提县</a>| <a href="http://" target="_blank">策勒县</a>| <a href="http://" target="_blank">吉隆县</a>| <a href="http://" target="_blank">海南省</a>| <a href="http://" target="_blank">安溪县</a>| <a href="http://" target="_blank">白城市</a>| <a href="http://" target="_blank">拉萨市</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>