Sun River
          Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
          posts - 78,comments - 0,trackbacks - 0
            A message-driven bean is an enterprise bean that allows J2EE applications to process messages asynchronously. It acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events.
             Message-driven beans currently process only JMS messages, but in the future they may be used to process other kinds of messages.
            The most visible difference between message-driven beans and session and entity beans is that clients do not access message-driven beans through interfaces.

            When a message arrives, the container calls the message-driven bean's onMessage method to process the message. The onMessage method normally casts the message to one of the five JMS message types and handles it in accordance with the application's business logic. The onMessage method may call helper methods, or it may invoke a session or entity bean to process the information in the message or to store it in a database.

            A message may be delivered to a message-driven bean within a transaction context, so that all operations within the onMessage method are part of a single transaction. If message processing is rolled back, the message will be redelivered.
            Session beans and entity beans allow you to send JMS messages and to receive them synchronously, but not asynchronously. To avoid tying up server resources, you may prefer not to use blocking synchronous receives in a server-side component. To receive messages asynchronously, use a message-driven bean.

          posted on 2007-07-09 14:35 Sun River 閱讀(242) 評論(0)  編輯  收藏 所屬分類: Java EE Questions
          主站蜘蛛池模板: 新巴尔虎右旗| 临汾市| 柘城县| 揭阳市| 勐海县| 华坪县| 乐都县| 泰兴市| 灌阳县| 营山县| 岳池县| 齐齐哈尔市| 梧州市| 德惠市| 洛阳市| 内江市| 延安市| 同心县| 广南县| 平昌县| 揭东县| 湖北省| 突泉县| 石屏县| 双牌县| 依安县| 庆阳市| 连云港市| 梁河县| 青岛市| 中江县| 和林格尔县| 甘谷县| 玉环县| 神木县| 大宁县| 安图县| 东乡县| 鹿邑县| 桃源县| 隆安县|