锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品亚洲福利,亚洲精品国产免费,亚洲一区二区三区偷拍女厕http://www.tkk7.com/lingy/category/40074.htmlzh-cnFri, 05 Jun 2009 12:00:57 GMTFri, 05 Jun 2009 12:00:57 GMT60Lingo, 璁揓MS渚嗗仛RPC http://www.tkk7.com/lingy/archive/2009/06/05/280257.html鏋楀厜鐐?/dc:creator>鏋楀厜鐐?/author>Fri, 05 Jun 2009 11:08:00 GMThttp://www.tkk7.com/lingy/archive/2009/06/05/280257.htmlJava programmer瓔涘埌RPC(Romote Procedure Call), 澶氬崐鏈冩兂鍒?RMI,
鐢≧MI, 鍙互璁撴垜鍊戝緢瀹規槗鐨勫懠鍙仩绔殑 mothod.

浣嗘槸, RMI 鏈変竴浜涚己榛? 鍏朵腑姣忎竴鍊媘ethod閮借 throw RemoteException, 涓嶉亷鏈榪戞垜閮界敤Spring framework, 浠栧凡綞撹畵鎴戝戣檿鐞嗘帀浜嗛欏嬮夯鐓?..

鍙﹀涓鍊婻MI鐨勭己榛? 涔熷氨甯傛湰綃囨枃绔犵殑閲嶉粸, 灝辨槸method鐨勫懠鍙呰垏琚懠鍙呯殑闂滀總澶穵瀵嗕簡,
涔熷氨鏄, client蹇呴爤鎸囧畾鎴戞墍瑕佸懠鍙殑server鏄湪綞茶礬鐨勫摢涓鍊嬩綅鍧...

JMS,鍓囨彁渚涗簡涓鍊嬫柟寮?璁揷lient (producer)閫佸嚭message, 浣嗕笉鎸囧畾瑾頒締鏀墮欎竴鍊媘essage,
閫欑ó loosely coupling 鐨勬柟寮? 璁撴垜鍊戠殑紼嬪紡鏇存湁褰堟? 浣嗘槸鐢↗MS渚嗗仛RPC閭勬槸鏈変竴浜涢夯鐓╃殑鍦版柟

* procedure閫佸嚭鐨勬槸message鑰屼笉鏄?鍛煎彨method
* 鍩烘湰涓?JMS鏄?asynchronous, 涔熷氨鏄 proceudre閫佸嚭message寰? message閭勬矑琚檿鐞? procedure灝辯辜綰屽煼琛屼笅鍘?閫欒垏鎴戝戜竴鑸琑MI 鐨勭敤娉曚笉涓妯?


鐒惰孡ingo 騫垜鍊戣В姹轟簡閫欏叐鍊嬪晱欏? 閫忛亷Lingo, 鎴戝戝彲浠ヨ畵client鐩存帴鍛煎彨server鐨刴ethod (鑰屼笉鏄櫦閫乵essage, 鍦╯erver閫欑 涔熶笉鐢ㄥ幓鎺ュ彈message), 浣嗘槸涓︿笉鎸囧畾鏄摢涓鍊媠erver騫垜鍊戣檿鐞嗛欎竴鍊媘ethod call. 閫欏皪multiple server鍜宭oad-balance寰堟湁騫姪.

Lingo鐨勭瘎渚? 鍙互鐪嬩笅闈㈤欏嬬恫鍧, 鐩哥暥綈″柈鏄庣灜

http://lingo.codehaus.org/Example

闄勫付涓鎻愮殑鏄? lingo涓嶄絾鍙互鐢?synchronous鍛煎彨method, 鍙﹀涔熷彲浠ョ敤synchronous鍛煎彨method.

濂界敤鍚?....

鍙冭冭硣鏂?: http://lingo.codehaus.org/Home


]]>
鍙嶇紪璇慾ad鐨勫懡浠や嬌鐢?/title><link>http://www.tkk7.com/lingy/archive/2009/06/05/280180.html</link><dc:creator>鏋楀厜鐐?/dc:creator><author>鏋楀厜鐐?/author><pubDate>Fri, 05 Jun 2009 03:49:00 GMT</pubDate><guid>http://www.tkk7.com/lingy/archive/2009/06/05/280180.html</guid><description><![CDATA[<p>棣栧厛,鐪嬩竴涓媕ad鐨勫府鍔╂彁紺?/p> <p>-a - 鐢↗VM瀛楄妭鏍煎紡鏉ユ敞瑙h緭鍑?<br /> -af - 鍚?-a,浣嗘槸娉ㄨВ鐨勬椂鍊欑敤鍏ㄥ悕縐?<br /> -clear - 娓呴櫎鎵鏈夌殑鍓嶇紑 <br /> -b - 杈撳嚭澶氫簬鐨勬嫭鍙?(e.g., if(a) { b(); }, default: no) <br /> -d <dir> - 鎸囧畾杈撳嚭鏂囦歡鐨勬枃浠剁洰褰?<br /> -dead -璇曞浘鍙嶇紪璇戜唬鐮佺殑dead 閮ㄥ垎(default: no) <br /> -disass - 涓嶇敤鐢ㄥ瓧鑺傜爜鐨勬柟寮忓弽緙栬瘧 (no JAVA source generated) <br /> -f - 杈撳嚭鏁翠釜鐨勫悕瀛?鏃犺鏄被榪樻槸鏂規硶 <br /> -ff -杈撳嚭綾葷殑鎴愬憳鍦ㄦ柟娉曚箣鍓?(default: after methods) <br /> -i - 杈撳嚭鎵鏈夌殑鍙橀噺鐨勭己鐪佺殑鏈鍒濆?<br /> -l<num> - 灝唖trings鍒嗗壊鎴愭寚瀹氭暟鐩殑鍧楃殑瀛楃 (default: no) <br /> -lnc - 灝嗚緭鍑烘枃浠剁敤琛屽彿鏉ユ敞瑙?(default: no) <br /> -nl - 鍒嗗壊strings鐢ㄦ柊琛屽瓧絎?newline character (default: no) <br /> -nodos -涓嶈鍘繪鏌lass鏂囦歡鏄惁浠os鏂瑰紡鍐?(CR before NL, default: check) <br /> -nocast - 涓嶈鐢熸垚杈呭姪鏂囦歡 <br /> -nocode -涓嶈鐢熸垚鏂規硶鐨勬簮浠g爜 <br /> -noconv - 涓嶈杞崲java鐨勫畾涔夌 (default: do) <br /> -noctor - 涓嶅厑璁哥┖鐨勬瀯閫犲櫒瀛樺湪 <br /> -noinner -鍏蟲帀瀵瑰唴閮ㄧ被鐨勬敮鎸?(default: turn on) <br /> -nolvt - 蹇界暐灞閮ㄥ彉閲忕殑琛ㄤ俊鎭?<br /> -nonlb - 涓嶈杈撳嚭涓涓柊琛屽湪鎵撳紑涓涓嫭鍙蜂箣鍓?(default: do) <br /> -o - 鏃犻渶紜鐩存帴瑕嗙洊杈撳嚭 (default: no) <br /> -p - 鍙戦佸弽緙栬瘧浠g爜鍒版爣鍑嗚緭鍑?STDOUT (e.g., for piping) </p> <p>鍏舵.甯哥敤鍛戒護</p> <p>jad -o -r -sjava -dsrc test.class</p> <p>tree鐩綍涓嬬殑鎵鏈?.class鏂囦歡<br />     jad -o -r -sjava -dsrc tree/**/*.class</p> <p>    unix鍙互琛ㄧず涓猴細jad -o -r -sjava -dsrc 'tree/**/*.class'</p> <p>鎸囧畾杈撳嚭鏂囦歡鐨勫悕瀛楃殑璇濓紝鐢ㄤ互涓嬬殑杞Щ鍛戒護</p> <p>jad -p example1.class > myexm1.java</p> <p><br /> 鏂囩珷鍑哄錛欴IY閮ㄨ惤(http://www.diybl.com/course/3_program/java/javajs/20090305/158191.html)</p> <img src ="http://www.tkk7.com/lingy/aggbug/280180.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lingy/" target="_blank">鏋楀厜鐐?/a> 2009-06-05 11:49 <a href="http://www.tkk7.com/lingy/archive/2009/06/05/280180.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring涓嶢ctiveMQ(JMS)鐨勬暣鍚堣鏄?/title><link>http://www.tkk7.com/lingy/archive/2009/06/04/280065.html</link><dc:creator>鏋楀厜鐐?/dc:creator><author>鏋楀厜鐐?/author><pubDate>Thu, 04 Jun 2009 12:13:00 GMT</pubDate><guid>http://www.tkk7.com/lingy/archive/2009/06/04/280065.html</guid><description><![CDATA[ActiveMQ鏄畬鍏ㄦ敮鎸丣MS1.1鍜孞2EE 1.4瑙勮寖鐨?JMS Provider瀹炵幇,涔熸槸Apache Geronimo榛樿鐨凧MS provider銆? <p>銆銆ActiveMQ鐨勭綉绔欙細<a target="_blank">http://www.activemq.org</a></p> <p>銆銆浣跨敤ActiveMQ鍚庯紝鍙互鍦ㄦ櫘閫歐eb鏈嶅姟鍣ㄤ嬌鐢↗MS鍔熻兘錛屼笉渚濊禆浜庣壒瀹氱殑搴旂敤鏈嶅姟鍣ㄣ?/p> <ol> <h2>1. ActiveMQ 4.1-incubator-SNAPSHOT 涓嶴pring 2.0 闆嗘垚</h2> <p>ActiveMQ4.1 鍝嶅簲Spring 2.0鍙峰彫錛屾敮鎸佷簡寮曞叆XML Schema namespace鐨勭畝鍗曢厤緗娉曪紝綆鍖栦簡閰嶇疆鐨勮鍙ャ?/p> <h2>1.1 寮曞叆ActiveMQ鐨刋SD</h2> <p>鍦ˋpplicationContext.xml(Spring鐨勯厤緗枃浠?涓紩鍏ctiveMQ鐨刋ML Scheam 閰嶇疆鏂囦歡),濡備笅:<br /> (璇存槑:鐢變簬ActiveMQ鐨勯偅涓猉SD鏈夐儴鍒嗛敊璇?鍥犳浣跨敤鐨勬槸鑷淇敼榪囩殑XSD,瑙?#8221;閰嶇疆ClassPath涓殑scheam”灝忚妭)</p> <pre><textarea style="width: 502px; height: 183px" class="Xml" rows="1" cols="60" name="code"><beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.org/config/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://activemq.org/config/1.0 http://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd"> </beans> </textarea></pre> <h2>1.2 閰嶇疆ClassPath涓殑schema</h2> <p>鍦–lassPath 涓嬮潰寤虹珛META-INF\spring.schemas 鍐呭濡備笅</p> <pre><textarea style="width: 502px; height: 116px" class="Xml" rows="1" cols="60" name="code">http\://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd=/activemq-core-4.1-incubator-SNAPSHOT.xsd 榪欎釜spring.schemas鏄痵pring鑷畾涔塻cheam鐨勯厤緗枃浠? 璇鋒敞鎰?http:\://"閮ㄥ垎鍐欐硶 </textarea></pre> <h2>1.3 閰嶇疆ActiveMQ embedded ActiveMQ Broker</h2> <pre><textarea style="width: 502px; height: 148px" class="Xml" rows="1" cols="60" name="code"><!-- lets create an embedded ActiveMQ Broker --> <amq :broker useJmx="false" persistent="false"></amq> <amq :transportConnectors> <amq :transportConnector uri="tcp://localhost:0"/> </amq> </textarea></pre> <p>褰搒pring鍒濆鍖栨椂鍊?ActiveMQ embedded Broker 灝變細鍚姩浜?/p> <h2>1.4 閰嶇疆BookStore MDP</h2> <p>閰嶇疆ConnectionFactory,鐢變簬鏄痚mbedded 鎵浠RL涓?vm://localhost</p> <pre><textarea style="width: 502px; height: 124px" class="Xml" rows="1" cols="60" name="code"><!-- ActiveMQ connectionFactory to use --> <amq :connectionFactory id="jmsConnectionFactory" brokerURL="vm://localhost"/> </textarea></pre> <p>閰嶇疆Queue鍚嶅瓧</p> <pre><textarea style="width: 502px; height: 103px" class="Xml" rows="1" cols="60" name="code"><!-- ActiveMQ destinations to use --> <amq :queue name="destination" physicalName="org.apache.activemq.spring.Test.spring.embedded"/> </textarea></pre> <p>閰嶇疆JmsTemplate</p> <pre><textarea style="width: 502px; height: 163px" class="Xml" rows="1" cols="60" name="code"><!-- Spring JmsTemplate config --> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory"> <!-- lets wrap in a pool to avoid creating a connection per send --> <bean class="org.springframework.jms.connection.SingleConnectionFactory"> <property name="targetConnectionFactory"> <ref local="jmsConnectionFactory"/> </property> </bean> </property> <!-- custom MessageConverter define --> <property name="messageConverter" ref="orderMessageConverter"/> </bean> </textarea></pre> <p>閰嶇疆MDP POJO</p> <pre><textarea style="width: 502px; height: 127px" class="Xml" rows="1" cols="60" name="code"><!-- a sample POJO which uses a Spring JmsTemplate --> <bean id="orderMessageProducer" class="org.springside.bookstore.components.activemq.OrderMessageProducer"> <property name="template"> <ref bean="jmsTemplate"/> </property> <property name="destination"> <ref bean="destination"/> </property> </bean> <!-- this is the Message Driven POJO (MDP) --> <!-- define MessageListenerAdapter --> <bean id="messageListener" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"> <constructor -arg> <bean class="org.springside.bookstore.components.activemq.OrderMessageConsumer"> <property name="mailService" ref="mailService"></property> </bean> </constructor> <!-- mey be other method --> <property name="defaultListenerMethod" value="sendEmail"/> <!-- custom MessageConverter define --> <property name="messageConverter" ref="orderMessageConverter"/> </bean> <!-- and this is the attendant message listener container --> <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="jmsConnectionFactory"/> <property name="destination" ref="destination"/> <property name="messageListener" ref="messageListener"/> </bean> </textarea></pre> <h2>琛ュ厖璇存槑</h2> <li>閲囩敤浜嗚嚜瀹氫箟鐨凪essageConverter,Producer鑳藉鐩存帴鍙戦丳OJO銆? <li>浣跨敤浜哠pring鐨凞efaultMessageListenerContainer,MessageListenerAdapter, Consumer銆涓嶇敤瀹炵幇MessageListener 鎺ュ彛銆?/li> </ol> <img src ="http://www.tkk7.com/lingy/aggbug/280065.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lingy/" target="_blank">鏋楀厜鐐?/a> 2009-06-04 20:13 <a href="http://www.tkk7.com/lingy/archive/2009/06/04/280065.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Activemq鍜孡ingo瀹炵幇JMS鍜屽紓姝ヨ皟鐢?/title><link>http://www.tkk7.com/lingy/archive/2009/06/04/280064.html</link><dc:creator>鏋楀厜鐐?/dc:creator><author>鏋楀厜鐐?/author><pubDate>Thu, 04 Jun 2009 12:11:00 GMT</pubDate><guid>http://www.tkk7.com/lingy/archive/2009/06/04/280064.html</guid><description><![CDATA[jms鏄ぇ瀹跺湪欏圭洰涓粡甯哥敤鍒扮殑鎶鏈紝鑰宎ctivemq鍙堟槸寮婧愮殑jms浜у搧涓瘮杈冧紭縐鐨勩傚湪搴旂敤JMS澶勭悊鐩稿叧涓氬姟鏃訛紝澶у閮芥槸鏋勯犳秷鎭紝鐒跺悗鍙戦佸埌闃熷垪錛屾渶鍚庣敤message鐩戝惉鍣ㄧ洃鍚埌娑堟伅錛屽娑堟伅榪涜鍒嗘瀽澶勭悊銆傚湪榪欎釜榪囩▼涓紝鏈変袱姝ユ槸姣旇緝楹葷儲鍜岄噸澶嶇殑錛岄偅灝辨槸鏋勯犳秷鎭拰鎷嗚В娑堟伅銆傚茍涓旇繖鏍蜂笌闈㈠悜瀵硅薄鐨勬濇兂寰堟槸榪濊儗銆傚鏋滆繖鏍峰仛鏄劇劧鏄潰鍚戞秷鎭暟鎹殑錛岃屼笉鏄潰鍚戝璞$殑銆傚熀浜庝互涓婂師鍥狅紝鎴戝悜澶у浠嬬粛涓涓垜鍦ㄩ」鐩腑緇忚繃瀹炶返鐨勫紑婧愭鏋訛細lingo.<br /> 銆銆lingo鍦↗MS涓搗鐨勪富瑕佷綔鐢ㄥ氨鏄娑堟伅鐨勫皝瑁咃紝瀹冭浣犲彲浠ヤ笉蹇呭叧蹇冩秷鎭殑鏋勯犲拰鎷嗚В錛岃屽彧闇鍏沖績浣犳湰韜殑涓氬姟閫昏緫銆傛垜灝嗕婦涓涓緥瀛愶紝鍒嗗埆鐢╝ctivemq鐩存帴瀹炵幇鍜岀敤lingo瀹炵幇銆傚湪榪欎釜渚嬪瓙涓垜鐢ㄥ埌浜唖pring framework.<br /> 銆銆=================================Hello.java===========================<br /> 銆銆import java.io.Serializable;<br /> 銆銆/**Hello.java鐢ㄦ潵浼犻扟AVA瀵硅薄<br /> 銆銆* Author: cjp<br /> 銆銆* Date: 2005-11-8<br /> 銆銆* Time: 22:24:02<br /> 銆銆*/<br /> 銆銆public class Hello implements Serializable {<br /> 銆銆private String id;<br /> 銆銆private Hello hello;<br /> 銆銆private PointList pointList;<br /> 銆銆public String getId() {<br /> 銆銆return id;<br /> 銆銆}<br /> 銆銆public void setId(String id) {<br /> 銆銆this.id = id;<br /> 銆銆}<br /> 銆銆public Hello getHello() {<br /> 銆銆return hello;<br /> 銆銆}<br /> 銆銆public void setHello(Hello hello) {<br /> 銆銆this.hello = hello;<br /> 銆銆}<br /> 銆銆}<br /> 銆銆=========================SpringTest .java========================<br /> 銆銆import org.springframework.jms.core.JmsTemplate;<br /> 銆銆import org.springframework.jms.core.MessageCreator;<br /> 銆銆import org.springframework.test.AbstractDependencyInjectionSpringContextTests;<br /> 銆銆import javax.jms.*;<br /> 銆銆/**<br /> 銆銆*鍙戦丣MS娑堟伅<br /> 銆銆*/<br /> 銆銆public class SpringTest extends AbstractDependencyInjectionSpringContextTests<br /> 銆銆{<br /> 銆銆protected String[] getConfigLocations()<br /> 銆銆{<br /> 銆銆return new String[]{"file:D:\\wosame\\test\\com\\wosame\\room\\jms\\jms.xml"};<br /> 銆銆}<br /> 銆銆public void testSendMessage() throws Exception<br /> 銆銆{<br /> 銆銆JmsTemplate jmsTemplate = (JmsTemplate) applicationContext.getBean("jmsTemplate");<br /> 銆銆jmsTemplate.send(new MessageCreator()<br /> 銆銆{<br /> 銆銆public Message createMessage(Session session) throws JMSException<br /> 銆銆{<br /> 銆銆ObjectMessage message=session.createObjectMessage();<br /> 銆銆Hello hello=new Hello();<br /> 銆銆hello.setId("test");<br /> 銆銆message.setObject(hello);<br /> 銆銆return message;<br /> 銆銆}<br /> 銆銆});<br /> 銆銆}<br /> 銆銆}<br /> 銆銆================================HelloMDP .java==================================<br /> 銆銆/**<br /> 銆銆澶勭悊JMS娑堟伅<br /> 銆銆*/<br /> 銆銆import org.apache.commons.logging.Log;<br /> 銆銆import org.apache.commons.logging.LogFactory;<br /> 銆銆import javax.jms.*;<br /> 銆銆public class HelloMDP implements MessageListener<br /> 銆銆{<br /> 銆銆protected Log log = LogFactory.getLog(HelloMDP.class);<br /> 銆銆public void onMessage(Message message)<br /> 銆銆{<br /> 銆銆try<br /> 銆銆{<br /> 銆銆ObjectMessage objMessage = (ObjectMessage) message;<br /> 銆銆Hello hello= (Hello) objMessage.getObject();<br /> 銆銆System.out.println("hello.getId() = " + hello.getId());<br /> 銆銆} catch (JMSException e)<br /> 銆銆{<br /> 銆銆log.error("Parse failed", e);<br /> 銆銆}<br /> 銆銆}<br /> 銆銆}<br /> 銆銆================================jms.xml==================================<br /> 銆銆<?xml version="1.0" encoding="UTF-8"?<br /> 銆銆<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"<br /> 銆銆"http://www.springframework.org/dtd/spring-beans.dtd"<br /> 銆銆<beans<br /> 銆銆<!--宓屽叆寮忕殑JMS榪炴帴錛屼篃灝辨槸璺熼殢JVM涓璧峰惎鍔?鍙互鍙傜湅activemq鐨勬枃妗?-<br /> 銆銆<bean id="connectionFactory" class="org.activemq.ActiveMQConnectionFactory" <property name="brokerURL" value="vm://localhost"/<br /> 銆銆<property name="useEmbeddedBroker" value="true"/<br /> 銆銆</bean<br /> 銆銆<!--娑堟伅鐩戝惉鍣紝涔熷氨鏄秷鎭殑鍏蜂綋鐨勫鐞嗗櫒--<br /> 銆銆<bean id="HelloMDP" class="HelloMDP"/<br /> 銆銆<!--jms鐩戝惉闇瑕丣TA瀹瑰櫒鐨勬敮鎸?-<br /> 銆銆<bean id="activeMQContainer" class="org.activemq.jca.JCAContainer"<br /> 銆銆<property name="workManager"<br /> 銆銆<bean id="workManager" class="org.activemq.work.SpringWorkManager"/<br /> 銆銆</property<br /> 銆銆<property name="resourceAdapter"<br /> 銆銆<bean id="activeMQResourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter"<br /> 銆銆<property name="serverUrl" value="vm://localhost"/<br /> 銆銆</bean<br /> 銆銆</property<br /> 銆銆</bean<br /> 銆銆<!--娑堟伅鐨勬秷璐硅咃紝涔熷氨鏄皢鐩戝惉鍣ㄤ笌鍏蜂綋鐨勯槦鍒楀叧鑱?-<br /> 銆銆<bean id="HelloQueueConsumer" factory-method="addConnector" factory-bean="activeMQContainer"<br /> 銆銆<property name="activationSpec"<br /> 銆銆<bean class="org.activemq.ra.ActiveMQActivationSpec"<br /> 銆銆<property name="destination" value="Hello.Queue"/<br /> 銆銆<property name="destinationType" value="javax.jms.Queue"/<br /> 銆銆</bean<br /> 銆銆</property<br /> 銆銆<property name="ref" value="HelloMDP"/<br /> 銆銆</bean<br /> 銆銆<!--spring鐨凧MS template,鐢ㄦ潵鍙戦丣MS娑堟伅鍒版寚瀹氱殑闃熷垪--<br /> 銆銆<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"<br /> 銆銆<property name="defaultDestinationName" value="Hello.Queue"/<br /> 銆銆<property name="connectionFactory" ref="connectionFactory"/<br /> 銆銆</bean<br /> 銆銆</beans <p> </p> <p style="margin: 0px"> <div style="display: none" id="ubbcontent">銆銆jms鏄ぇ瀹跺湪欏圭洰涓粡甯哥敤鍒扮殑鎶鏈紝鑰宎ctivemq鍙堟槸寮婧愮殑jms浜у搧涓瘮杈冧紭縐鐨勩傚湪搴旂敤JMS澶勭悊鐩稿叧涓氬姟鏃訛紝澶у閮芥槸鏋勯犳秷鎭紝鐒跺悗鍙戦佸埌闃熷垪錛屾渶鍚庣敤message鐩戝惉鍣ㄧ洃鍚埌娑堟伅錛屽娑堟伅榪涜鍒嗘瀽澶勭悊銆傚湪榪欎釜榪囩▼涓紝鏈変袱姝ユ槸姣旇緝楹葷儲鍜岄噸澶嶇殑錛岄偅灝辨槸鏋勯犳秷鎭拰鎷嗚В娑堟伅銆傚茍涓旇繖鏍蜂笌闈㈠悜瀵硅薄鐨勬濇兂寰堟槸榪濊儗銆傚鏋滆繖鏍峰仛鏄劇劧鏄潰鍚戞秷鎭暟鎹殑錛岃屼笉鏄潰鍚戝璞$殑銆傚熀浜庝互涓婂師鍥狅紝鎴戝悜澶у浠嬬粛涓涓垜鍦ㄩ」鐩腑緇忚繃瀹炶返鐨勫紑婧愭鏋訛細lingo. 銆銆lingo鍦↗MS涓搗鐨勪富瑕佷綔鐢ㄥ氨鏄娑堟伅鐨勫皝瑁咃紝瀹冭浣犲彲浠ヤ笉蹇呭叧蹇冩秷鎭殑鏋勯犲拰鎷嗚В錛岃屽彧闇鍏沖績浣犳湰韜殑涓氬姟閫昏緫銆傛垜灝嗕婦涓涓緥瀛愶紝鍒嗗埆鐢╝ctivemq鐩存帴瀹炵幇鍜岀敤lingo瀹炵幇銆傚湪榪欎釜渚嬪瓙涓垜鐢ㄥ埌浜唖pring framework. 銆銆=================================Hello.java=========================== 銆銆import java.io.Serializable; 銆銆/**Hello.java鐢ㄦ潵浼犻扟AVA瀵硅薄銆銆* Author: cjp 銆銆* Date: 2005-11-8 銆銆* Time: 22:24:02 銆銆*/ 銆銆public class Hello implements Serializable { 銆銆private String id; 銆銆private Hello hello; 銆銆private PointList pointList; 銆銆public String getId() { 銆銆return id; 銆銆} 銆銆public void setId(String id) { 銆銆this.id = id; 銆銆} 銆銆public Hello getHello() { 銆銆return hello; 銆銆} 銆銆public void setHello(Hello hello) { 銆銆this.hello = hello; 銆銆} 銆銆} 銆銆=========================SpringTest .java======================== 銆銆import org.springframework.jms.core.JmsTemplate; 銆銆import org.springframework.jms.core.MessageCreator; 銆銆import org.springframework.test.AbstractDependencyInjectionSpringContextTests; 銆銆import javax.jms.*; 銆銆/** 銆銆*鍙戦丣MS娑堟伅銆銆*/ 銆銆public class SpringTest extends AbstractDependencyInjectionSpringContextTests 銆銆{ 銆銆protected String[] getConfigLocations() 銆銆{ 銆銆return new String[]{"file:D:\\wosame\\test\\com\\wosame\\room\\jms\\jms.xml"}; 銆銆} 銆銆public void testSendMessage() throws Exception 銆銆{ 銆銆JmsTemplate jmsTemplate = (JmsTemplate) applicationContext.getBean("jmsTemplate"); 銆銆jmsTemplate.send(new MessageCreator() 銆銆{ 銆銆public Message createMessage(Session session) throws JMSException 銆銆{ 銆銆ObjectMessage message=session.createObjectMessage(); 銆銆Hello hello=new Hello(); 銆銆hello.setId("test"); 銆銆message.setObject(hello); 銆銆return message; 銆銆} 銆銆}); 銆銆} 銆銆} 銆銆================================HelloMDP .java================================== 銆銆/** 銆銆澶勭悊JMS娑堟伅銆銆*/ 銆銆import org.apache.commons.logging.Log; 銆銆import org.apache.commons.logging.LogFactory; 銆銆import javax.jms.*; 銆銆public class HelloMDP implements MessageListener 銆銆{ 銆銆protected Log log = LogFactory.getLog(HelloMDP.class); 銆銆public void onMessage(Message message) 銆銆{ 銆銆try 銆銆{ 銆銆ObjectMessage objMessage = (ObjectMessage) message; 銆銆Hello hello= (Hello) objMessage.getObject(); 銆銆System.out.println("hello.getId() = " + hello.getId()); 銆銆} catch (JMSException e) 銆銆{ 銆銆log.error("Parse failed", e); 銆銆} 銆銆} 銆銆} 銆銆================================jms.xml================================== 銆銆<?xml version="1.0" encoding="UTF-8"? 銆銆<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" 銆銆"http://www.springframework.org/dtd/spring-beans.dtd" 銆銆<beans 銆銆<!--宓屽叆寮忕殑JMS榪炴帴錛屼篃灝辨槸璺熼殢JVM涓璧峰惎鍔?鍙互鍙傜湅activemq鐨勬枃妗?- 銆銆<bean id="connectionFactory" class="org.activemq.ActiveMQConnectionFactory" <property name="brokerURL" value="vm://localhost"/ 銆銆<property name="useEmbeddedBroker" value="true"/ 銆銆</bean 銆銆<!--娑堟伅鐩戝惉鍣紝涔熷氨鏄秷鎭殑鍏蜂綋鐨勫鐞嗗櫒-- 銆銆<bean id="HelloMDP" class="HelloMDP"/ 銆銆<!--jms鐩戝惉闇瑕丣TA瀹瑰櫒鐨勬敮鎸?- 銆銆<bean id="activeMQContainer" class="org.activemq.jca.JCAContainer" 銆銆<property name="workManager" 銆銆<bean id="workManager" class="org.activemq.work.SpringWorkManager"/ 銆銆</property 銆銆<property name="resourceAdapter" 銆銆<bean id="activeMQResourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter" 銆銆<property name="serverUrl" value="vm://localhost"/ 銆銆</bean 銆銆</property 銆銆</bean 銆銆<!--娑堟伅鐨勬秷璐硅咃紝涔熷氨鏄皢鐩戝惉鍣ㄤ笌鍏蜂綋鐨勯槦鍒楀叧鑱?- 銆銆<bean id="HelloQueueConsumer" factory-method="addConnector" factory-bean="activeMQContainer" 銆銆<property name="activationSpec" 銆銆<bean class="org.activemq.ra.ActiveMQActivationSpec" 銆銆<property name="destination" value="Hello.Queue"/ 銆銆<property name="destinationType" value="javax.jms.Queue"/ 銆銆</bean 銆銆</property 銆銆<property name="ref" value="HelloMDP"/ 銆銆</bean 銆銆<!--spring鐨凧MS template,鐢ㄦ潵鍙戦丣MS娑堟伅鍒版寚瀹氱殑闃熷垪-- 銆銆<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" 銆銆<property name="defaultDestinationName" value="Hello.Queue"/ 銆銆<property name="connectionFactory" ref="connectionFactory"/ 銆銆</bean 銆銆</beans</div> <p> </p> <script>document.getElementById("ubbcontent").style.display="none";</script> <div style="clear: both"> </div> <img src ="http://www.tkk7.com/lingy/aggbug/280064.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lingy/" target="_blank">鏋楀厜鐐?/a> 2009-06-04 20:11 <a href="http://www.tkk7.com/lingy/archive/2009/06/04/280064.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://wdjiuye.com" target="_blank">日本不卡在线观看免费v</a>| <a href="http://786087.com" target="_blank">亚洲成AV人片在线播放无码</a>| <a href="http://513net.com" target="_blank">中文字幕亚洲综合精品一区</a>| <a href="http://xinyuanmy.com" target="_blank">成人片黄网站色大片免费观看cn</a>| <a href="http://fanhaogo.com" target="_blank">免费人成网站7777视频</a>| <a href="http://sczssc.com" target="_blank">亚洲影院在线观看</a>| <a href="http://hnmxld.com" target="_blank">999久久久免费精品播放</a>| <a href="http://zzjiji.com" target="_blank">亚洲综合一区二区国产精品</a>| <a href="http://chaikexin.com" target="_blank">久久国产精品免费视频</a>| <a href="http://jaubus.com" target="_blank">伊人久久综在合线亚洲2019</a>| <a href="http://97aimeili.com" target="_blank">69视频在线观看高清免费</a>| <a href="http://hbqueena.com" target="_blank">亚洲精品欧洲精品</a>| <a href="http://myzhoubian.com" target="_blank">国产精品无码免费专区午夜</a>| <a href="http://fenglufzjx.com" target="_blank">av在线亚洲欧洲日产一区二区</a>| <a href="http://boyipark.com" target="_blank">久青草国产免费观看</a>| <a href="http://96j6.com" target="_blank">成人影片麻豆国产影片免费观看</a>| <a href="http://8aa3.com" target="_blank">亚洲精品成人网站在线观看</a>| <a href="http://mabaolu.com" target="_blank">亚洲AV色无码乱码在线观看</a>| <a href="http://fsweicheng.com" target="_blank">国产免费黄色大片</a>| <a href="http://240842.com" target="_blank">久久久久国色AV免费观看</a>| <a href="http://yisaoma.com" target="_blank">国产在线观看www鲁啊鲁免费</a>| <a href="http://zhongxueping888.com" target="_blank">亚洲日本在线免费观看</a>| <a href="http://dqzlxgg.com" target="_blank">国产精品免费大片</a>| <a href="http://ranjihua.com" target="_blank">亚洲免费电影网站</a>| <a href="http://715686.com" target="_blank">国产成人aaa在线视频免费观看 </a>| <a href="http://woaianli.com" target="_blank">亚洲国产精品无码久久久久久曰</a>| <a href="http://ahtxjk.com" target="_blank">免费看一级高潮毛片</a>| <a href="http://scjcled.com" target="_blank">久久99国产亚洲高清观看首页 </a>| <a href="http://cao8080.com" target="_blank">亚洲乱亚洲乱妇24p</a>| <a href="http://wwwee2.com" target="_blank">亚洲国产高清精品线久久</a>| <a href="http://zibochanglong.com" target="_blank">国产在线精品一区免费香蕉</a>| <a href="http://jufandev.com" target="_blank">五月天网站亚洲小说</a>| <a href="http://hkcdk.com" target="_blank">国产免费阿v精品视频网址</a>| <a href="http://qmoread.com" target="_blank">亚洲一级片内射网站在线观看</a>| <a href="http://142121.com" target="_blank">a毛片久久免费观看</a>| <a href="http://kt4444.com" target="_blank">亚洲国产综合在线</a>| <a href="http://bisi666.com" target="_blank">亚洲第一福利网站在线观看</a>| <a href="http://meinvtaotu.com" target="_blank">日本亚洲欧洲免费天堂午夜看片女人员</a>| <a href="http://moushengguigz.com" target="_blank">亚洲福利一区二区</a>| <a href="http://jastrelax.com" target="_blank">免费午夜爽爽爽WWW视频十八禁 </a>| <a href="http://www8x5188x.com" target="_blank">2021国产精品成人免费视频</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>