messageproducer.html

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

HTML
469
字号
  
 <P>Since message IDs take some effort to create and increase a
 message's size, some JMS providers may be able to optimize message
 overhead if they are given a hint that the message ID is not used by
 an application. By calling the <CODE>setDisableMessageID</CODE>  
 method on this message producer, a JMS client enables this potential 
 optimization for all messages sent by this message producer. If the JMS 
 provider accepts this hint, 
 these messages must have the message ID set to null; if the provider 
 ignores the hint, the message ID must be set to its normal unique value.

 <P>Message IDs are enabled by default.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - indicates if message IDs are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to set message ID to
                         disabled due to some internal error.</DL>
</DD>
</DL>
<HR>

<A NAME="getDisableMessageID()"><!-- --></A><H3>
getDisableMessageID</H3>
<PRE>
public boolean <B>getDisableMessageID</B>()
                            throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Gets an indication of whether message IDs are disabled.<DD><DL>
<DT><B>Returns:</B><DD>an indication of whether message IDs are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to determine if 
                         message IDs are disabled due to some internal 
                         error.</DL>
</DD>
</DL>
<HR>

<A NAME="setDisableMessageTimestamp(boolean)"><!-- --></A><H3>
setDisableMessageTimestamp</H3>
<PRE>
public void <B>setDisableMessageTimestamp</B>(boolean&nbsp;value)
                                throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Sets whether message timestamps are disabled.
  
 <P>Since timestamps take some effort to create and increase a 
 message's size, some JMS providers may be able to optimize message 
 overhead if they are given a hint that the timestamp is not used by an 
 application. By calling the <CODE>setDisableMessageTimestamp</CODE> 
 method on this message producer, a JMS client enables this potential 
 optimization for all messages sent by this message producer.  If the 
 JMS provider accepts this hint, 
 these messages must have the timestamp set to zero; if the provider 
 ignores the hint, the timestamp must be set to its normal value.
  
 <P>Message timestamps are enabled by default.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - indicates if message timestamps are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to set timestamps to
                         disabled due to some internal error.</DL>
</DD>
</DL>
<HR>

<A NAME="getDisableMessageTimestamp()"><!-- --></A><H3>
getDisableMessageTimestamp</H3>
<PRE>
public boolean <B>getDisableMessageTimestamp</B>()
                                   throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Gets an indication of whether message timestamps are disabled.<DD><DL>
<DT><B>Returns:</B><DD>an indication of whether message timestamps are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to determine if 
                         timestamps are disabled due to some internal 
                         error.</DL>
</DD>
</DL>
<HR>

<A NAME="setDeliveryMode(int)"><!-- --></A><H3>
setDeliveryMode</H3>
<PRE>
public void <B>setDeliveryMode</B>(int&nbsp;deliveryMode)
                     throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Sets the producer's default delivery mode.
  
 <P>Delivery mode is set to <CODE>PERSISTENT</CODE> by default.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>deliveryMode</CODE> - the message delivery mode for this message
 producer; legal values are <code>DeliveryMode.NON_PERSISTENT</code>
 and <code>DeliveryMode.PERSISTENT</code><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to set the delivery 
                         mode due to some internal error.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/MessageProducer.html#getDeliveryMode()"><CODE>getDeliveryMode()</CODE></A>, 
<A HREF="../../javax/jms/DeliveryMode.html#NON_PERSISTENT"><CODE>DeliveryMode.NON_PERSISTENT</CODE></A>, 
<A HREF="../../javax/jms/DeliveryMode.html#PERSISTENT"><CODE>DeliveryMode.PERSISTENT</CODE></A>, 
<A HREF="../../javax/jms/Message.html#DEFAULT_DELIVERY_MODE"><CODE>Message.DEFAULT_DELIVERY_MODE</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getDeliveryMode()"><!-- --></A><H3>
getDeliveryMode</H3>
<PRE>
public int <B>getDeliveryMode</B>()
                    throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Gets the producer's default delivery mode.<DD><DL>
<DT><B>Returns:</B><DD>the message delivery mode for this message producer<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to get the delivery 
                         mode due to some internal error.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/MessageProducer.html#setDeliveryMode(int)"><CODE>setDeliveryMode(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setPriority(int)"><!-- --></A><H3>
setPriority</H3>
<PRE>
public void <B>setPriority</B>(int&nbsp;defaultPriority)
                 throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Sets the producer's default priority.
  
 <P>The JMS API defines ten levels of priority value, with 0 as the 
 lowest priority and 9 as the highest. Clients should consider priorities
 0-4 as gradations of normal priority and priorities 5-9 as gradations 
 of expedited priority. Priority is set to 4 by default.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>defaultPriority</CODE> - the message priority for this message producer;
                        must be a value between 0 and 9<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to set the priority
                         due to some internal error.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/MessageProducer.html#getPriority()"><CODE>getPriority()</CODE></A>, 
<A HREF="../../javax/jms/Message.html#DEFAULT_PRIORITY"><CODE>Message.DEFAULT_PRIORITY</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getPriority()"><!-- --></A><H3>
getPriority</H3>
<PRE>
public int <B>getPriority</B>()
                throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Gets the producer's default priority.<DD><DL>
<DT><B>Returns:</B><DD>the message priority for this message producer<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to get the priority
                         due to some internal error.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/MessageProducer.html#setPriority(int)"><CODE>setPriority(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setTimeToLive(long)"><!-- --></A><H3>
setTimeToLive</H3>
<PRE>
public void <B>setTimeToLive</B>(long&nbsp;timeToLive)
                   throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Sets the default length of time in milliseconds from its dispatch time
 that a produced message should be retained by the message system.

 <P>Time to live is set to zero by default.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>timeToLive</CODE> - the message time to live in milliseconds; zero is
 unlimited<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to set the time to 
                         live due to some internal error.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/MessageProducer.html#getTimeToLive()"><CODE>getTimeToLive()</CODE></A>, 
<A HREF="../../javax/jms/Message.html#DEFAULT_TIME_TO_LIVE"><CODE>Message.DEFAULT_TIME_TO_LIVE</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getTimeToLive()"><!-- --></A><H3>
getTimeToLive</H3>
<PRE>
public long <B>getTimeToLive</B>()
                   throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Gets the default length of time in milliseconds from its dispatch time
 that a produced message should be retained by the message system.<DD><DL>
<DT><B>Returns:</B><DD>the message time to live in milliseconds; zero is unlimited<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to get the time to 
                         live due to some internal error.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/MessageProducer.html#setTimeToLive(long)"><CODE>setTimeToLive(long)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()
           throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Closes the message producer.

 <P>Since a provider may allocate some resources on behalf of a
 <CODE>MessageProducer</CODE> outside the Java virtual machine, clients 
 should close them when they
 are not needed. Relying on garbage collection to eventually reclaim
 these resources may not be timely enough.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to close the producer
                         due to some internal error.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<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="#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>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/jms/MessageListener.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../javax/jms/ObjectMessage.html"><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="MessageProducer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

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