Novell exteNd Messaging Platform 5.2

com.sssw.jms.api
Interface JMQXMLMessage

All Superinterfaces:
Message, TextMessage

public interface JMQXMLMessage
extends TextMessage

A JMQXMLMessage object is used to send a message containing a org.w3c.dom.Document. It inherits from the TextMessage interface and treats the text message body as a document. Although a TextMessage can be used to send XML, this message provides a more convenient way of doing so.

When a consumer receives a JMQXMLMessage, it is in read-only mode. If a consumer attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody is called, the message can now be both read from and written to.

Since:
jBroker MQ 2.0
See Also:
Document, TextMessage, JMQSession

Field Summary
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Method Summary
 Document getDocument()
          Get the document containing this message's data.
 String getText()
          Gets the string containing this message's data.
 void setDocument(Document document)
          Set document as this message's data.
 void setText(String string)
          Sets the string containing this message's data.
 
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
 

Method Detail

setText

public void setText(String string)
             throws JMSException
Sets the string containing this message's data. If a document was previously set as the message's data, it will be replaced with the string.

Specified by:
setText in interface TextMessage
Parameters:
string - the String containing the message's data
Throws:
JMSException - if the JMS provider fails to set the text due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

getText

public String getText()
               throws JMSException
Gets the string containing this message's data. The default value is null. If the message contains a document, a string form of the document will be returned.

Specified by:
getText in interface TextMessage
Returns:
the String containing the message's data.
Throws:
JMSException - if the JMS provider fails to get the text due to some internal error.

getDocument

public Document getDocument()
                     throws JMSException
Get the document containing this message's data. If the message contains a string, the string will be converted into a document. The default value is null.

Returns:
the Document containing the message's data.
Throws:
JMSException - if the JMS provider fails to get the text due to some internal error.

setDocument

public void setDocument(Document document)
                 throws JMSException
Set document as this message's data. If a string was previously set as the message's data, it will be replaced by the document.

Parameters:
document - the Document containing the message's data.
Throws:
JMSException - if the JMS provider fails to set the document due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

Novell exteNd Messaging Platform 5.2

exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2004 Novell, Inc. All Rights Reserved.