package-summary.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 617 行 · 第 1/2 页

HTML
617
字号
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Exception Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="IllegalStateException.html">IllegalStateException</A></B></TD>
<TD> This exception is thrown when a method is 
     invoked at an illegal or inappropriate time or if the provider is 
     not in an appropriate state for the requested operation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="InvalidClientIDException.html">InvalidClientIDException</A></B></TD>
<TD> This exception must be thrown when a 
     client attempts to set a connection's client ID to a value that 
     is rejected by a provider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="InvalidDestinationException.html">InvalidDestinationException</A></B></TD>
<TD> This exception must be thrown when a 
     destination either is not understood by a provider or is no 
     longer valid.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="InvalidSelectorException.html">InvalidSelectorException</A></B></TD>
<TD> This exception must be thrown when a 
     JMS client attempts to give a provider a message selector with 
     invalid syntax.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="JMSException.html">JMSException</A></B></TD>
<TD>This is the root class of all JMS API exceptions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="JMSSecurityException.html">JMSSecurityException</A></B></TD>
<TD> This exception must be thrown when a provider rejects a user 
     name/password submitted by a client.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessageEOFException.html">MessageEOFException</A></B></TD>
<TD> This exception must be thrown when an unexpected 
     end of stream has been reached when a <CODE>StreamMessage</CODE> or 
     <CODE>BytesMessage</CODE> is being read.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessageFormatException.html">MessageFormatException</A></B></TD>
<TD> This exception must be thrown when a JMS client 
     attempts to use a data type not supported by a message or attempts to 
     read data in a message as the wrong type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessageNotReadableException.html">MessageNotReadableException</A></B></TD>
<TD> This exception must be thrown when a JMS client attempts to read a 
     write-only message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessageNotWriteableException.html">MessageNotWriteableException</A></B></TD>
<TD> This exception must be thrown when a JMS client attempts to write to a 
     read-only message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ResourceAllocationException.html">ResourceAllocationException</A></B></TD>
<TD>This exception is thrown when a provider is unable to allocate the 
    resources required by a method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="TransactionInProgressException.html">TransactionInProgressException</A></B></TD>
<TD> This exception is thrown when an 
     operation is invalid because a transaction is in progress.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="TransactionRolledBackException.html">TransactionRolledBackException</A></B></TD>
<TD> This exception must be thrown when a 
     call to <CODE>Session.commit</CODE> results in a rollback of the current 
     transaction.</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package javax.jms Description
</H2>

<P>
<P>
The Java Message Service (JMS) API provides a common way for Java programs to create, 
send, receive and read an enterprise messaging system's messages.

<H3>JMS Applications</H3>

<P>A JMS application is composed of the following parts:</P>

<UL>
  <LI>JMS Provider - a messaging system that implements the JMS API
      in addition to the other administrative and control functionality required 
      of a full-featured messaging product</LI>
  <LI>JMS Clients - the Java language programs that send and receive 
      messages</LI>
  <LI>Messages - objects that are used to communicate information between the 
      clients of an application</LI>
  <LI>Administered Objects - provider-specific objects that clients look up
      and use to interact portably with a JMS provider</LI>
  <LI>Non-JMS Clients - clients that use a message system's native 
      client API instead of the JMS API. If the application predated the 
      availability of the JMS API, it is likely that it will include both JMS 
      clients and non-JMS clients.</LI>
</UL>

<H3>Administration</H3>

<P>It is expected that JMS providers will differ significantly in their 
underlying messaging technology. It is also expected there will be major 
differences in how a provider's system is installed and administered.</P>

<P>If JMS clients are to be portable, they must be isolated from these 
proprietary aspects of a provider. This is done by defining JMS administered
objects that are created and customized by a provider's administrator and 
later used by clients. The client uses them through JMS interfaces that are 
portable. The administrator creates them using provider-specific facilities.</P>

<P>There are two types of JMS administered objects:</P>

<UL>
  <LI>ConnectionFactory - the object a client uses to create a 
      connection with a provider</LI>
  <LI>Destination - the object a client uses to specify the 
      destination of messages it is sending and the source of messages 
      it receives</LI>
</UL>

<P>Administered objects are placed in a Java Naming and Directory 
Interface<SUP><FONT SIZE="-2">TM</FONT></SUP> (JNDI) namespace by an 
administrator. 
A JMS client typically notes in its documentation the JMS administered objects 
it requires and how the JNDI names of these objects should be provided to it.</P>

<H3>Two Messaging Styles</H3>

<P>A JMS application uses either the point-to-point (PTP) or the 
publish-and-subscribe (Pub/Sub) style of messaging. Nothing prevents these 
styles from being combined in a single application; however, the JMS API 
focuses on applications that use one or the other.</P>

<P>The JMS API defines these two styles because they represent the two 
dominant approaches to messaging currently in use. Since many messaging 
systems only support one of these styles, the JMS API provides a separate 
domain for each and defines compliance for each domain.</P>

<H3>JMS Interfaces</H3>

<P>The JMS API is based on a set of common messaging concepts. Each JMS 
messaging domain - PTP and Pub/Sub - defines a customized set of interfaces 
for these concepts.</P>

<TABLE BORDER CELLPADDING="3" CELLSPACING="0">
<CAPTION>
<B>Relationship of PTP and Pub/Sub interfaces<B>
</CAPTION>
<TR>
<TH ALIGN="LEFT">JMS Parent</TH>
<TH ALIGN="LEFT">PTP Domain</TH>
<TH ALIGN="LEFT">Pub/Sub Domain</TH>
</TR>
<TR>
<TD>ConnectionFactory</TD>
<TD>QueueConnectionFactory</TD>
<TD>TopicConnectionFactory</TD>
</TR>
<TR>
<TD>Connection</TD>
<TD>QueueConnection</TD>
<TD>TopicConnection</TD>
</TR>
<TR>
<TD>Destination</TD>
<TD>Queue</TD>
<TD>Topic</TD>
</TR>
<TR>
<TD>Session</TD>
<TD>QueueSession</TD>
<TD>TopicSession</TD>
</TR>
<TR>
<TD>MessageProducer</TD>
<TD>QueueSender</TD>
<TD>TopicPublisher</TD>
</TR>
<TR>
<TD>MessageConsumer</TD>
<TD>QueueReceiver, QueueBrowser</TD>
<TD>TopicSubscriber</TD>
</TR>
</TABLE>

<P>The following provides a brief definition of these JMS concepts. See the PTP 
and Pub/Sub chapters for more information.</P>

<UL>
  <LI>ConnectionFactory - an administered object used by a client to create a 
      Connection</LI>
  <LI>Connection - an active connection to a JMS provider</LI>
  <LI>Destination - an administered object that encapsulates the identity of a 
      message destination</LI>
  <LI>Session - a single-threaded context for sending and receiving messages</LI>
  <LI>MessageProducer - an object created by a Session that is used for sending 
      messages to a destination</LI>
  <LI>MessageConsumer - an object created by a Session that is used for receiving 
      messages sent to a destination</LI>
</UL>

<P>The term <EM>consume</EM> is used in this document to mean the receipt of a 
message by a JMS client; that is, a JMS provider has received a message and has 
given it to its client. Since the JMS API supports both synchronous and asynchronous 
receipt of messages, the term <EM>consume</EM> is used when there is no need to 
make a distinction between them.</P>

<P>The term <EM>produce</EM> is used as the most general term for sending a 
message. It means giving a message to a JMS provider for delivery to a 
destination.</P>

<H3>Developing a JMS Application</H3>

<P>Broadly speaking, a JMS application is one or more JMS clients that exchange 
messages. The application may also involve non-JMS clients; however, these 
clients use the JMS provider's native API in place of the JMS API.</P>

<P>A JMS application can be architected and deployed as a unit. In many cases, 
JMS clients are added incrementally to an existing application.</P>

<P>The message definitions used by an application may originate with JMS, or they 
may have been defined by the non-JMS part of the application.</P>

<H3>Developing a JMS Client</H3>

<P>A typical JMS client executes the following setup procedure:</P>

<UL>
  <LI>Use JNDI to find a ConnectionFactory object</LI>
  <LI>Use JNDI to find one or more Destination objects</LI>
  <LI>Use the ConnectionFactory to create a JMS Connection with message delivery 
      inhibited</LI>
  <LI>Use the Connection to create one or more JMS Sessions</LI>
  <LI>Use a Session and the Destinations to create the MessageProducers and 
      MessageConsumers needed</LI>
  <LI>Enable the Connection to start delivering messages to 
      MessageConsumers</LI>
</UL>

<P>At this point a client has the basic setup needed to produce and consume 
messages.</P>

<H3>Package Specification</H3>

<BLOCKQUOTE>
  <A HREF="http://java.sun.com/products/jms/docs.html">Java Message Service 
   Specification - Version 1.0.2 </A>
</BLOCKQUOTE>

<H3>Related Documentation</H3>

<BLOCKQUOTE>
  <A HREF="http://java.sun.com/products/jms/tutorial/index.html">Java Message
   Service Tutorial</A>
</BLOCKQUOTE>
<P>
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/ejb/spi/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../javax/mail/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?