Commit c2316645 authored by afreyssin's avatar afreyssin

Moves code handling correlationIDAsBytes in shared message.

parent ff19f44a
......@@ -532,15 +532,10 @@ public class Message implements javax.jms.Message {
*
* @return the correlation ID for the message as an array of bytes.
*
* @exception MessageFormatException In case of a problem while retrieving
* the field.
* @exception JMSException Actually never thrown.
*/
public final byte[] getJMSCorrelationIDAsBytes() throws JMSException {
try {
return ConversionHelper.toBytes(momMsg.correlationId);
} catch (MessageValueException mE) {
throw new MessageFormatException(mE.getMessage());
}
return momMsg.getJMSCorrelationIDAsBytes();
}
/**
......@@ -553,8 +548,8 @@ public class Message implements javax.jms.Message {
*
* @exception JMSException Actually never thrown.
*/
public final void setJMSCorrelationIDAsBytes(byte[] correlationID) {
momMsg.correlationId = ConversionHelper.toString(correlationID);
public final void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException {
momMsg.setJMSCorrelationIDAsBytes(correlationID);
}
/**
......
......@@ -264,6 +264,29 @@ public final class Message implements Cloneable, Serializable, Streamable, Encod
/** The correlation identifier field. */
public transient String correlationId = null;
/**
* Gets the correlation ID as an array of bytes for the message.
*
* @return the correlation ID for the message as an array of bytes.
*/
public final byte[] getJMSCorrelationIDAsBytes() {
if (correlationId != null)
return correlationId.getBytes();
return null;
}
/**
* Sets the correlation ID as an array of bytes for the message.
*
* @param correlationID the message ID value as an array of bytes.
*/
public final void setJMSCorrelationIDAsBytes(byte[] correlationID) {
if (correlationID != null)
this.correlationId = new String(correlationID);
else
this.correlationId = null;
}
/** The number of delivery attempts for this message. */
public transient int deliveryCount = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment