message.html

来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 1,305 行 · 第 1/5 页

HTML
1,305
字号
<TD><CODE><B><A HREF="../../javax/jms/Message.html#setStringProperty(java.lang.String, java.lang.String)">setStringProperty</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name,                  <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a <CODE>String</CODE> property value with the specified name into  the message.</TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="DEFAULT_DELIVERY_MODE"><!-- --></A><H3>DEFAULT_DELIVERY_MODE</H3><PRE>static final int <B>DEFAULT_DELIVERY_MODE</B></PRE><DL><DD>The message producer's default delivery mode is <CODE>PERSISTENT</CODE>.<P><DL><DT><B>See Also:</B><DD><A HREF="../../javax/jms/DeliveryMode.html#PERSISTENT"><CODE>DeliveryMode.PERSISTENT</CODE></A>, <A HREF="../../constant-values.html#javax.jms.Message.DEFAULT_DELIVERY_MODE">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_PRIORITY"><!-- --></A><H3>DEFAULT_PRIORITY</H3><PRE>static final int <B>DEFAULT_PRIORITY</B></PRE><DL><DD>The message producer's default priority is 4.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javax.jms.Message.DEFAULT_PRIORITY">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_TIME_TO_LIVE"><!-- --></A><H3>DEFAULT_TIME_TO_LIVE</H3><PRE>static final long <B>DEFAULT_TIME_TO_LIVE</B></PRE><DL><DD>The message producer's default time to live is unlimited; the message   never expires.<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#javax.jms.Message.DEFAULT_TIME_TO_LIVE">Constant Field Values</A></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getJMSMessageID()"><!-- --></A><H3>getJMSMessageID</H3><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getJMSMessageID</B>()                       throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets the message ID. <P>The <CODE>JMSMessageID</CODE> header field contains a value that  uniquely identifies each message sent by a provider.   <P>When a message is sent, <CODE>JMSMessageID</CODE> can be ignored.  When the <CODE>send</CODE> or <CODE>publish</CODE> method returns, it  contains a provider-assigned value. <P>A <CODE>JMSMessageID</CODE> is a <CODE>String</CODE> value that  should function as a  unique key for identifying messages in a historical repository.  The exact scope of uniqueness is provider-defined. It should at  least cover all messages for a specific installation of a  provider, where an installation is some connected set of message  routers. <P>All <CODE>JMSMessageID</CODE> values must start with the prefix  <CODE>'ID:'</CODE>.  Uniqueness of message ID values across different providers is  not required. <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>MessageProducer.setDisableMessageID</CODE> method, a JMS client  enables this potential optimization for all messages sent by that  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><DD><DL><DT><B>Returns:</B><DD>the message ID<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to get the message ID                          due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/Message.html#setJMSMessageID(java.lang.String)"><CODE>setJMSMessageID(String)</CODE></A>, <A HREF="../../javax/jms/MessageProducer.html#setDisableMessageID(boolean)"><CODE>MessageProducer.setDisableMessageID(boolean)</CODE></A></DL></DD></DL><HR><A NAME="setJMSMessageID(java.lang.String)"><!-- --></A><H3>setJMSMessageID</H3><PRE>void <B>setJMSMessageID</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;id)                     throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets the message ID.   <P>JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - the ID of the message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set the message ID                          due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/Message.html#getJMSMessageID()"><CODE>getJMSMessageID()</CODE></A></DL></DD></DL><HR><A NAME="getJMSTimestamp()"><!-- --></A><H3>getJMSTimestamp</H3><PRE>long <B>getJMSTimestamp</B>()                     throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets the message timestamp.   <P>The <CODE>JMSTimestamp</CODE> header field contains the time a  message was  handed off to a provider to be sent. It is not the time the  message was actually transmitted, because the actual send may occur  later due to transactions or other client-side queueing of messages. <P>When a message is sent, <CODE>JMSTimestamp</CODE> is ignored. When  the <CODE>send</CODE> or <CODE>publish</CODE> method returns, it contains a time value somewhere in the interval  between the call and the return. The value is in the format of a normal  millis time value in the Java programming language. <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>MessageProducer.setDisableMessageTimestamp</CODE> method, a JMS  client enables this potential optimization for all messages sent by  that 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><DD><DL><DT><B>Returns:</B><DD>the message timestamp<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to get the timestamp                         due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/Message.html#setJMSTimestamp(long)"><CODE>setJMSTimestamp(long)</CODE></A>, <A HREF="../../javax/jms/MessageProducer.html#setDisableMessageTimestamp(boolean)"><CODE>MessageProducer.setDisableMessageTimestamp(boolean)</CODE></A></DL></DD></DL><HR><A NAME="setJMSTimestamp(long)"><!-- --></A><H3>setJMSTimestamp</H3><PRE>void <B>setJMSTimestamp</B>(long&nbsp;timestamp)                     throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets the message timestamp.   <P>JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>timestamp</CODE> - the timestamp for this message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set the timestamp                         due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/Message.html#getJMSTimestamp()"><CODE>getJMSTimestamp()</CODE></A></DL></DD></DL><HR><A NAME="getJMSCorrelationIDAsBytes()"><!-- --></A><H3>getJMSCorrelationIDAsBytes</H3><PRE>byte[] <B>getJMSCorrelationIDAsBytes</B>()                                  throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets the correlation ID as an array of bytes for the message.   <P>The use of a <CODE>byte[]</CODE> value for  <CODE>JMSCorrelationID</CODE> is non-portable.<P><DD><DL><DT><B>Returns:</B><DD>the correlation ID of a message as an array of bytes<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to get the correlation                         ID due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/Message.html#setJMSCorrelationID(java.lang.String)"><CODE>setJMSCorrelationID(String)</CODE></A>, <A HREF="../../javax/jms/Message.html#getJMSCorrelationID()"><CODE>getJMSCorrelationID()</CODE></A>, <A HREF="../../javax/jms/Message.html#setJMSCorrelationIDAsBytes(byte[])"><CODE>setJMSCorrelationIDAsBytes(byte[])</CODE></A></DL></DD></DL><HR><A NAME="setJMSCorrelationIDAsBytes(byte[])"><!-- --></A><H3>setJMSCorrelationIDAsBytes</H3><PRE>void <B>setJMSCorrelationIDAsBytes</B>(byte[]&nbsp;correlationID)                                throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets the correlation ID as an array of bytes for the message.  <P>The array is copied before the method returns, so future modifications to the array will not alter this message header.   <P>If a provider supports the native concept of correlation ID, a  JMS client may need to assign specific <CODE>JMSCorrelationID</CODE>  values to match those expected by native messaging clients.  JMS providers without native correlation ID values are not required to  support this method and its corresponding get method; their  implementation may throw a <CODE>java.lang.UnsupportedOperationException</CODE>.  <P>The use of a <CODE>byte[]</CODE> value for  <CODE>JMSCorrelationID</CODE> is non-portable.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>correlationID</CODE> - the correlation ID value as an array of bytes<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set the correlation                         ID due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/Message.html#setJMSCorrelationID(java.lang.String)"><CODE>setJMSCorrelationID(String)</CODE></A>, <A HREF="../../javax/jms/Message.html#getJMSCorrelationID()"><CODE>getJMSCorrelationID()</CODE></A>, <A HREF="../../javax/jms/Message.html#getJMSCorrelationIDAsBytes()"><CODE>getJMSCorrelationIDAsBytes()</CODE></A></DL></DD></DL><HR><A NAME="setJMSCorrelationID(java.lang.String)"><!-- --></A><H3>setJMSCorrelationID</H3><PRE>void <B>setJMSCorrelationID</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;correlationID)                         throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSExcepti

⌨️ 快捷键说明

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