⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 session.html

📁 j2ee api,很好的api。我这现在有
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2_02) on Thu Nov 13 17:20:39 PST 2003 --><TITLE>Session (Java 2 Platform Ent. Ed. v1.4)</TITLE><META NAME="keywords" CONTENT="javax.jms.Session interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Session (Java 2 Platform Ent. Ed. v1.4)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <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="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></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><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../javax/jms/ServerSessionPool.html" title="interface in javax.jms"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javax/jms/StreamMessage.html" title="interface in javax.jms"><B>NEXT CLASS</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="Session.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.jms</FONT><BR>Interface Session</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Runnable.html" title="class or interface in java.lang">Runnable</A></DD></DL><DL><DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../javax/jms/QueueSession.html" title="interface in javax.jms">QueueSession</A>, <A HREF="../../javax/jms/TopicSession.html" title="interface in javax.jms">TopicSession</A>, <A HREF="../../javax/jms/XAQueueSession.html" title="interface in javax.jms">XAQueueSession</A>, <A HREF="../../javax/jms/XASession.html" title="interface in javax.jms">XASession</A>, <A HREF="../../javax/jms/XATopicSession.html" title="interface in javax.jms">XATopicSession</A></DD></DL><HR><DL><DT>public interface <B>Session</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Runnable.html" title="class or interface in java.lang">Runnable</A></DL><P><P>A <CODE>Session</CODE> object is a single-threaded context for producing and consuming  messages. Although it may allocate provider resources outside the Java  virtual machine (JVM), it is considered a lightweight JMS object. <P>A session serves several purposes: <UL>   <LI>It is a factory for its message producers and consumers.   <LI>It supplies provider-optimized message factories.   <LI>It is a factory for <CODE>TemporaryTopics</CODE> and         <CODE>TemporaryQueues</CODE>.    <LI> It provides a way to create <CODE>Queue</CODE> or <CODE>Topic</CODE>      objects for those clients that need to dynamically manipulate       provider-specific destination names.   <LI>It supports a single series of transactions that combine work        spanning its producers and consumers into atomic units.   <LI>It defines a serial order for the messages it consumes and        the messages it produces.   <LI>It retains messages it consumes until they have been        acknowledged.   <LI>It serializes execution of message listeners registered with        its message consumers.   <LI> It is a factory for <CODE>QueueBrowsers</CODE>. </UL> <P>A session can create and service multiple message producers and  consumers. <P>One typical use is to have a thread block on a synchronous  <CODE>MessageConsumer</CODE> until a message arrives. The thread may then use one or more of the <CODE>Session</CODE>'s <CODE>MessageProducer</CODE>s. <P>If a client desires to have one thread produce messages while others  consume them, the client should use a separate session for its producing  thread. <P>Once a connection has been started, any session with one or more  registered message listeners is dedicated to the thread of control that  delivers messages to it. It is erroneous for client code to use this session or any of its constituent objects from another thread of control. The only exception to this rule is the use of the session or connection  <CODE>close</CODE> method. <P>It should be easy for most clients to partition their work naturally into sessions. This model allows clients to start simply and incrementally add message processing complexity as their need for concurrency grows. <P>The <CODE>close</CODE> method is the only session method that can be  called while some other session method is being executed in another thread. <P>A session may be specified as transacted. Each transacted  session supports a single series of transactions. Each transaction groups  a set of message sends and a set of message receives into an atomic unit  of work. In effect, transactions organize a session's input message  stream and output message stream into series of atomic units. When a  transaction commits, its atomic unit of input is acknowledged and its  associated atomic unit of output is sent. If a transaction rollback is  done, the transaction's sent messages are destroyed and the session's input  is automatically recovered. <P>The content of a transaction's input and output units is simply those  messages that have been produced and consumed within the session's current  transaction. <P>A transaction is completed using either its session's <CODE>commit</CODE> method or its session's <CODE>rollback</CODE> method. The completion of a session's current transaction automatically begins the next. The result is that a transacted session always has a current transaction within which its  work is done.   <P>The Java Transaction Service (JTS) or some other transaction monitor may  be used to combine a session's transaction with transactions on other  resources (databases, other JMS sessions, etc.). Since Java distributed  transactions are controlled via the Java Transaction API (JTA), use of the  session's <CODE>commit</CODE> and <CODE>rollback</CODE> methods in  this context is prohibited. <P>The JMS API does not require support for JTA; however, it does define  how a provider supplies this support. <P>Although it is also possible for a JMS client to handle distributed  transactions directly, it is unlikely that many JMS clients will do this. Support for JTA in the JMS API is targeted at systems vendors who will be  integrating the JMS API into their application server products.<P><P><DL><DT><B>Version:</B></DT>  <DD>1.1 February 2, 2002</DD><DT><B>Author:</B></DT>  <DD>Mark Hapner, Rich Burridge, Kate Stout</DD><DT><B>See Also:</B><DD><A HREF="../../javax/jms/QueueSession.html" title="interface in javax.jms"><CODE>QueueSession</CODE></A>, <A HREF="../../javax/jms/TopicSession.html" title="interface in javax.jms"><CODE>TopicSession</CODE></A>, <A HREF="../../javax/jms/XASession.html" title="interface in javax.jms"><CODE>XASession</CODE></A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/Session.html#AUTO_ACKNOWLEDGE">AUTO_ACKNOWLEDGE</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully  returned from a call to <CODE>receive</CODE> or when the message  listener the session has called to process the message successfully  returns.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/Session.html#CLIENT_ACKNOWLEDGE">CLIENT_ACKNOWLEDGE</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With this acknowledgment mode, the client acknowledges a consumed  message by calling the message's <CODE>acknowledge</CODE> method.  </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/Session.html#DUPS_OK_ACKNOWLEDGE">DUPS_OK_ACKNOWLEDGE</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This acknowledgment mode instructs the session to lazily acknowledge  the delivery of messages. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/Session.html#SESSION_TRANSACTED">SESSION_TRANSACTED</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This value is returned from the method  <CODE>getAcknowledgeMode</CODE> if the session is transacted. </TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/Session.html#close()">close</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes the session. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/Session.html#commit()">commit</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Commits all messages done in this transaction and releases any locks

⌨️ 快捷键说明

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