??xml version="1.0" encoding="utf-8" standalone="yes"?>久久国产精品电影,亚洲欧洲美洲在线综合,午夜成人免费视频http://www.aygfsteel.com/ejinmy/category/9390.htmljava (Java EE)&Linuxzh-cnTue, 27 Feb 2007 15:33:09 GMTTue, 27 Feb 2007 15:33:09 GMT60q期的思?/title><link>http://www.aygfsteel.com/ejinmy/archive/2006/08/01/61245.html</link><dc:creator>jinmy liao</dc:creator><author>jinmy liao</author><pubDate>Tue, 01 Aug 2006 12:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/ejinmy/archive/2006/08/01/61245.html</guid><wfw:comment>http://www.aygfsteel.com/ejinmy/comments/61245.html</wfw:comment><comments>http://www.aygfsteel.com/ejinmy/archive/2006/08/01/61245.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ejinmy/comments/commentRss/61245.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ejinmy/services/trackbacks/61245.html</trackback:ping><description><![CDATA[ <p>  好久都沒有來這裡看一下了,由於這兩個月要忙一個流E,公司在英國開一個銷售公司,要准備程序他們用Q本來現在的程運作基本上可以,但是珑֜的程序能拿到英國?<br />  由於是一個銷售的公司Q有了銷售、采賹{倉n差不多了。這些E序我們都有,但是Z那邊的程序、流E能順暢的運行,d還有好多Q到8?5dp完成Q也差不多了Q呵Q看了下珑֜的情況,還基本上可以Q不過還有程序沒有組合v來?br />  從這兩個月的Q務中Q我感覺到程序的開發要做到重用、擴展,並不是很Ҏ的事?br />首先從數據層來說Q不同的地方有可能用不同的數據表,在java中開發到是比較容易處理,但是如果是用C/S的delphi開發的大部分都是直接使用sql的,很難實現這一?br />也許你會說,Zg使用同一個數據表?情況很多Q我們公司是這樣的,賣了一套ERPQ不完整版本Q?自己開發了其余部分,這兩個程?br />要同時運行,只有我們新開發的程序要使用不同表的情況。同樣我們的合作公司Q有可能有他自己的系i,如果能做C依賴於基?br />更Ҏ重用Q數據共?<br />接下來就?業務功能的重?<br />像倉n的進貨、出貨,可用於PO,SO,生產{,都是一樣的意義。為了能使不同地方的業務功能能重用,我們用SOA的思想<br />利用WebServices、ESB的技術來實現Q業務的服務?<br />再就?擴展<br />不同的地Ҏ可能需求有不同Q這是很合乎情理的Q如珑֜英國要看到我們貨物在途量Q本來倉n沒有這個功能的.<br />我想要做到軟件的可維譗可重用不是單的知道用語aQ這個直接輿個h的習慣有很大的關?br />其他開發軟gQ就是開gh員處理這個,{於生活的中的煮飯一樣,有的人很輕松完成,有的人就弄的一團糟<br />多鍛煉積累經驗也是重要,最後提醒自己,做Q何事情都不能馬虎Q要仔細考慮。同時希?.15能完成Q?/p> <p> </p> <img src ="http://www.aygfsteel.com/ejinmy/aggbug/61245.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ejinmy/" target="_blank">jinmy liao</a> 2006-08-01 20:11 <a href="http://www.aygfsteel.com/ejinmy/archive/2006/08/01/61245.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JMS入門http://www.aygfsteel.com/ejinmy/archive/2006/04/20/42124.htmljinmy liaojinmy liaoThu, 20 Apr 2006 03:15:00 GMThttp://www.aygfsteel.com/ejinmy/archive/2006/04/20/42124.htmlhttp://www.aygfsteel.com/ejinmy/comments/42124.htmlhttp://www.aygfsteel.com/ejinmy/archive/2006/04/20/42124.html#Feedback0http://www.aygfsteel.com/ejinmy/comments/commentRss/42124.htmlhttp://www.aygfsteel.com/ejinmy/services/trackbacks/42124.html
消息傳遞pȝ通常被成為MOM(Message Oriented MiddleWare),作為消息服務器,MOM需要客戶端用箔一的標准訪問服務器QJMS標准是?br />最廣泛的消息接口標?
JMS消息分點點、基g的消息兩種
點對點方?是兩個客戶端建立消息隊列Q消息發送?sender)把消?Message)i消息服務器中的一個隊?Queue),消息接受?receiver)從服務器中這個隊列中
獲取消息.
主題消息:消息發送者響向消息服務器中的一個主發送消?Message),這個消息有a閱的接受者都會接受到這個消?
JMS中的主要名詞:
1)目的?Desination)
 是發送者和接受者的一個共同的地點Q發送者把消息發送到這裡Q接受者從這裡獲取消息,是我們在服務器中創徏的一個隊列,服務器會這個地方的所有消息維譗?br />2)會話
 消息發送者和接受Q都要通過JNDI獲取消息服務器的上下文,session是這樣的一個上下文象Q它可以創徏消息生產者、消費者,可以創徏點對點消息、主消?br />所有的消息操作都圍J這個會話展?

消息i構的介?br />用過web services(SOAP)應該知道消息包括信封、消息頭、主體、附?同樣JMS消息i構也是差不多包括消息頭、消息屬性、消息體.
以JMS、SOAP為基C可以實N向消息模?MOM Message Oriented Model)?br />JMS消息樣式:
SpyTextMessage {
     Header {
        jmsDestination  : QUEUE.mytestjms
        jmsDeliveryMode : 2
        jmsExpiration   : 0
        jmsPriority     : 4
        jmsMessageID    : ID:6-11454947326091
        jmsTimeStamp    : 1145494732609
        jmsCorrelationID: null
        jmsReplyTo      : null
        jmsType         : null
        jmsRedelivered  : false
        jmsProperties   : {}
        jmsPropReadWrite: false
        msgReadOnly     : true
        producerClientId: ID:6
     }
     Body {
        text            :sender message from liao test
     }
JMS單R程實現點對點的消息 服務器用jboss-4.0.3SP1
1)首先在JBOSS中部屬一個點點的消息隊?br />配置文g攑֜JBOSS_Home\server\default\deploy\jms
配置文g的內容為:
<?xml version="1.0" encoding="UTF-8"?>

<server>
 <!--是一個點點的用org.jboss.mq.server.jmx.Queue(Topic),desination的名Eqmytestjms 
  更多的配|說明可以看原來jboss自帶的Jms配置文gQ文件名要用*-service.xml
 -->
  <mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=mytestjms">
    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  </mbean>

</server>
2)實現消息發送?br />import java.util.Hashtable;
import javax.jms.*;
import javax.naming.*;
public class JMSSender {
    QueueSession session;
    QueueConnection conn;
    QueueSender sender;
    QueueReceiver receiver;
    public void clientconnect()throws Exception
    {
                env.put(Context.PROVIDER_URL,"localhost");
        Context iniCtx = new InitialContext(env)  ;
        
創徏JMS連接的工廠類
        Object tmp = iniCtx.lookup("ConnectionFactory");
        QueueConnectionFactory qcf = (QueueConnectionFactory)tmp;
        
                //?/a>建JMS會話
         session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
        
            clientconnect();
            TextMessage textmsg = this.session.createTextMessage();
            textmsg.setText("sender message from liao test");
           
        }catch(Exception e)
        {
            e.printStackTrace();
        }

    }
    /**
     * 停止和關閉JMS連接
     * @throws JMSException
     */
    public void disConnect() throws JMSException
    {
        conn.stop();
        session.close();
        conn.close();
    }
    public Message receiver() throws JMSException
    {
        return receiver.receive(1000);
    }
    public static void main(String[] args)throws Exception
    {
         new JMSSender();
    }
}
3)實現消息接受?br />import java.util.Hashtable;
import javax.jms.*;
import javax.naming.*;
public class JMSReceiver {
    QueueSession session;
    QueueConnection conn;
    QueueReceiver receiver;
   
    public void clientconnect()throws Exception
    {
        Hashtable env =  new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
        env.put(Context.PROVIDER_URL,"localhost");

        Context iniCtx = new InitialContext(env)  ;
        Object tmp = iniCtx.lookup("ConnectionFactory");
        QueueConnectionFactory qcf = (QueueConnectionFactory)tmp;
        Queue queue = (Queue)iniCtx.lookup("queue/mytestjms");
        conn = qcf.createQueueConnection();
         session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
        conn.start();
        receiver = session.createReceiver(queue);
    }
    public void disConnect() throws JMSException
   {
       conn.stop();
       session.close();
       conn.close();
   }
   public Message receiver() throws JMSException
   {
       return receiver.receive(1000);
   }
   public JMSReceiver()throws Exception
   {
        clientconnect();
         Message msg = receiver();
         System.out.println(msg);
         if (msg instanceof TextMessage)
         {
             TextMessage tmsg = (TextMessage)msg;
            
         disConnect();
 
   }

 

    public static void main(String[] args)throws Exception
    {
        new JMSReceiver();
    }
}

主題消息用到Topic,思\基本相同Q接受必需先訂閱消息主,當有發送者把消息發這個主的時?br />先前a閱的接受就會收到這個消息?br />SOA中JMS也是一個熱門Q客戶端通常用JMS發送消息再ESB中調用具體的服務?/p>

jinmy liao 2006-04-20 11:15 发表评论
]]>
消息傳遞服務?/title><link>http://www.aygfsteel.com/ejinmy/archive/2006/04/18/41733.html</link><dc:creator>jinmy liao</dc:creator><author>jinmy liao</author><pubDate>Tue, 18 Apr 2006 12:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/ejinmy/archive/2006/04/18/41733.html</guid><wfw:comment>http://www.aygfsteel.com/ejinmy/comments/41733.html</wfw:comment><comments>http://www.aygfsteel.com/ejinmy/archive/2006/04/18/41733.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ejinmy/comments/commentRss/41733.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ejinmy/services/trackbacks/41733.html</trackback:ping><description><![CDATA[ <p>消息在同一個系i׃或者在不同的系i都可以要交互,因為工作都是要交的Q就拿企業的定單修改Z子,當一個定單要修改Q得通知不同的管理h員,當然還要更可靠的消息(Email),在OApȝ中,E常要監測消息,看是否有程d到達該用Ӟ有則提示消息?br />下面是我做的一個小的服務器處理消息Q功能如?</p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"> <span style="mso-list: Ignore">1)<span style="FONT: 7pt 'Times New Roman'">       </span></span> </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供客戶端調用的接口(web services)</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"> <span style="mso-list: Ignore">2)<span style="FONT: 7pt 'Times New Roman'">       </span></span> </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">R寫處理處理消息的類Q消息現在包?/span> <span lang="EN-US" style="FONT-SIZE: 10pt">,</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">登陸消息、登出消息、消息發?消息狀態的修改</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">登陸消息包括</span> <span lang="EN-US" style="FONT-SIZE: 10pt">:</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">客戶端的用戶名?/span> <span lang="EN-US" style="FONT-SIZE: 10pt">ip</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、端?/span> <span lang="EN-US" style="FONT-SIZE: 10pt">;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">d消息包括</span> <span lang="EN-US" style="FONT-SIZE: 10pt">:</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">客戶端的用戶名,服務器將注銷客戶端登陸時發過來的消息</span> <span lang="EN-US" style="FONT-SIZE: 10pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">發送的消息包括</span> <span lang="EN-US" style="FONT-SIZE: 10pt">:</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">發送hQ接受hQ發送事Ӟ發送的內容</span> <span lang="EN-US" style="FONT-SIZE: 10pt">.<br />修改狀?包括消息的關鍵字ID<br /></span> <span lang="EN-US" style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"> <span style="mso-list: Ignore">3)<span style="FONT: 7pt 'Times New Roman'">       </span></span> </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在客戶端登陸的時候監測是否是否有新消息,有則發送客戶?br /></span> <span lang="EN-US" style="FONT-SIZE: 10pt"> <o:p> </o:p> </span> </p> <p> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 新細明體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-TW; mso-bidi-language: AR-SA"> <br />4)發送的消息如果接受用戶不在R,則保存該消息Q等接受者登陸的時候再發送接受者?br /><br />消息有一個狀態N表示新的消息QO表示已經的消?<br />消息傳用戶Q用戶確認在回寫消息狀?br />客戶端調用的接口可以是JMS,Http由於珑֜只有delphi客戶端,珑֜提供web servicesa問<br />程?<img height="836" alt="flow.bmp" src="http://www.aygfsteel.com/images/blogjava_net/ejinmy/flow.bmp" width="489" border="0" /></span> </p> <img src ="http://www.aygfsteel.com/ejinmy/aggbug/41733.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ejinmy/" target="_blank">jinmy liao</a> 2006-04-18 20:22 <a href="http://www.aygfsteel.com/ejinmy/archive/2006/04/18/41733.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>