📄 ch08s03.html
字号:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Overview</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html" title="Chapter 8. JBoss and JMS"><link rel="previous" href="ch08s02.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s02.html" title="Introduction"><link rel="next" href="ch08s07.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s07.html" title="JMS Provider"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch08s02.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s02.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch08s07.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s07.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="jms-overview"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="jms-overview"></a>Overview</h2></div></div><div class="section"><a name="jms-overview-what"></a><div class="titlepage"><div><h3 class="title"><a name="jms-overview-what"></a>What is JMS?</h3></div></div><p>JMS (short for Java Messaging System) is a Message-Oriented Middleware (MOM) API developed by Sun a couple of years ago. The primary reason behind the effort was to create a unified Java API for message-oriented application programming and avoid being forced to use vendor-specific APIs, instead. You program against the API, but at runtime you will need a particular JMS implementation, called a JMS provider, from a vendor. There exist several different JMS providers; the one used in JBoss is called JBossMQ.</p><p>JMS is handy to use when some (or all) of the following requirements are part of a project:</p><div class="itemizedlist"><ul><li><p><a name="d0e3077"></a>Systems decoupling</p></li><li><p><a name="d0e3080"></a>Asynchronous behavior</p></li><li><p><a name="d0e3083"></a>One-to-many, many-to-many or many-to-one semantics</p></li><li><p><a name="d0e3086"></a>Guaranteed delivery</p></li></ul></div></div><div class="section"><a name="jms-overview-j2ee"></a><div class="titlepage"><div><h3 class="title"><a name="jms-overview-j2ee"></a>JMS and J2EE</h3></div></div><p>JMS was developed before Enterprise Java Beans (EJBs) and the Java 2 Enterprise Edition (J2EE) framework were developed. It's therefore no surprise that there is no mention of EJB or J2EE in the JMS specification.</p><p>In the first generations of the EJB and J2EE specifications there was no mention of JMS, either. Up to, and including, EJB version 1.1, JMS was not a required API that a container provider had to make available to the beans. In J2EE 1.2 there was a requirement stating that the JMS interface had to be available, but it was not a requirement to also include a JMS provider; as a result, there was no guarantee that you could really use your JMS code.</p><p>This has changed in EJB 2.0 and J2EE 1.3. A J2EE 1.3-compliant application server has to include a JMS provider. Since J2EE 1.3 also requires EJB 2.0, two additional JMS features have also been added:</p><div class="itemizedlist"><ul><li><p><a name="d0e3100"></a>A new type of bean has been defined. Called a Message Driven Bean (MDB), this type of bean acts as a JMS subscriber, thus introducing asynchronous invocation to EJBs.</p></li><li><p><a name="d0e3103"></a>The treatment of JMS as a resource. For consistency, JMS publishing (sending) from a bean needs to be able to participate in the global transaction environment of the bean. This requires that JMS be considered a container-managed resource, much like a JDBC connection. In this scenario the transaction of a JMS session will be managed by the container and the session will be treated like any other transactional resource accessed from the same method.</p></li></ul></div></div><div class="section"><a name="jms-overview-jboss"></a><div class="titlepage"><div><h3 class="title"><a name="jms-overview-jboss"></a>JMS and JBoss</h3></div></div><p>JBoss has had support for JMS since version 2.0. Support for Message Driven Beans was added in version 2.1 and JMS as a transacted resource has been available since version 2.4.</p><p>The JMS architecture of JBoss includes the following elements:</p><div class="itemizedlist"><ul><li><p><a name="d0e3115"></a>The JMS provider. Called JBossMQ, this is the part of JBoss that implements the JMS 1.0.2 specification, including the optional parts, such as the Application Service Facility (ASF) in Chapter 8. JBossMQ handles everything that has to do with ordinary JMS: creating queues or topics, persistence, performance.</p><p>JBossMQ was created by Norbert Lataille in the spring of 2000. Hiram Chirino sort of took over the responsibility in late 2000 and added (among other things) ASF and XA support. Paul Kendall and David Maplesden have made recent contributions.</p><p>JBossMQ has its own CVS module and its own mailing list, <a href="javascript:if(confirm('http://groups.yahoo.com/group/spyderMQ/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://groups.yahoo.com/group/spyderMQ/'" tppabs="http://groups.yahoo.com/group/spyderMQ/" target="_top">spyderMQ</a>, where the core JBossMQ programmers hang out.</p></li><li><p><a name="d0e3125"></a>Message Driven Beans. They are part of the JBoss core EJB container system and they are fully specification-compliant. Peter Antman initially wrote this, but Hiram Chirino and Jason Dillon (among others) have also made large contributions.</p></li><li><p><a name="d0e3128"></a>A resource adapter. In JBoss 2.4, Peter Antman added a resource adapter for JMS architected as a J2EE Connector. It is meant to be used for all non-asynchronous JMS tasks from within an EJB in JBoss.</p></li></ul></div></div></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch08s02.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s02.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch08s07.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s07.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -