Oracle® Streams Advanced Queuing Java API Reference
10g Release 2 (10.2)

B14291-01


oracle.jms
Class AQjmsStreamMessage

java.lang.Object
  extended byoracle.jms.AQjmsMessage
      extended byoracle.jms.AQjmsStreamMessage

All Implemented Interfaces:
Message, StreamMessage

public class AQjmsStreamMessage
extends AQjmsMessage
implements StreamMessage

This is an Oracle class which implements javax.jms.StreamMessage.


Field Summary

Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE

Method Summary
void clearBody()
Clears out the message body.
void clearProperties()
Clears a message's properties.
boolean readBoolean()
Reads the next value from this stream message and returns it as a boolean.
byte readByte()
Reads the next value from this stream message and returns it as a byte.
int readBytes(byte[] value)
Reads a byte array field from this stream message.
char readChar()
Reads the next value from this stream message and returns it as a Unicode character.
double readDouble()
Reads the next value from this stream message and returns it as a double.
float readFloat()
Reads the next value from this stream message and returns it as a float.
int readInt()
Reads the next value from this stream message and returns it as an int.
long readLong()
Reads the next value from this stream message and returns it as a long.
java.lang.Object readObject()
Reads the next value from this stream message and returns it as a Java object.
short readShort()
Reads the next value from this stream message and returns it as a short.
java.lang.String readString()
Reads the next value from this stream message and returns it as a String.
void reset()
Puts the message body into read-only mode, and repositions the stream to the beginning.
void writeBoolean(boolean value)
Writes a boolean value to this stream message.
void writeByte(byte value)
Writes a byte value to this stream message.
void writeBytes(byte[] value)
Writes a byte[] value to this stream message.
void writeBytes(byte[] value, int offset, int length)
Writes a portion of a byte[] to this stream message.
void writeChar(char value)
Writes a char value to this stream message.
void writeDouble(double value)
Writes a double value to this stream message.
void writeFloat(float value)
Writes a float value to this stream message.
void writeInt(int value)
Writes an int value to this stream message.
void writeLong(long value)
Writes a long value to this stream message.
void writeObject(java.lang.Object value)
Writes a Java object to this stream message.
void writeShort(short value)
Writes a short value to this stream message.
void writeString(java.lang.String value)
Writes a String value to this stream message.

Methods inherited from class oracle.jms.AQjmsMessage
acknowledge, getAttempts, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSMessageIDAsBytes, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getSenderID, getShortProperty, getStringProperty, getUserPropertyNames, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setSenderID, setShortProperty, setStringProperty

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface javax.jms.Message
acknowledge, 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

clearProperties

public void clearProperties()
                     throws JMSException
Description copied from interface: Message
Clears a message's properties.

The message's header fields and body are not cleared.

Specified by:
clearProperties in interface Message
Overrides:
clearProperties in class AQjmsMessage
Throws:
JMSException - if the message properties are not cleared due to some error.

readBoolean

public boolean readBoolean()
                    throws JMSException
Reads the next value from this stream message and returns it as a boolean.
Specified by:
readBoolean in interface StreamMessage
Returns:
the value read, converted (if needed) to a boolean
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readByte

public byte readByte()
              throws JMSException
Reads the next value from this stream message and returns it as a byte.
Specified by:
readByte in interface StreamMessage
Returns:
the value read, converted (if needed) to an 8-bit byte
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readShort

public short readShort()
                throws JMSException
Reads the next value from this stream message and returns it as a short.
Specified by:
readShort in interface StreamMessage
Returns:
the value read, converted (if needed) to a 16-bit short
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readChar

public char readChar()
              throws JMSException
Reads the next value from this stream message and returns it as a Unicode character.
Specified by:
readChar in interface StreamMessage
Returns:
the value read, converted (if needed) to a char
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readInt

public int readInt()
            throws JMSException
Reads the next value from this stream message and returns it as an int.
Specified by:
readInt in interface StreamMessage
Returns:
the value read, converted (if needed) to a 32-bit int
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readLong

public long readLong()
              throws JMSException
Reads the next value from this stream message and returns it as a long.
Specified by:
readLong in interface StreamMessage
Returns:
the value read, converted (if needed) to a 64-bit long
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readFloat

public float readFloat()
                throws JMSException
Reads the next value from this stream message and returns it as a float.
Specified by:
readFloat in interface StreamMessage
Returns:
the value read, converted (if needed) to a float
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readDouble

public double readDouble()
                  throws JMSException
Reads the next value from this stream message and returns it as a double.
Specified by:
readDouble in interface StreamMessage
Returns:
the value read, converted (if needed) to a double
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readString

public java.lang.String readString()
                            throws JMSException
Reads the next value from this stream message and returns it as a String.
Specified by:
readString in interface StreamMessage
Returns:
the value read, converted (if needed) to a String
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

readBytes

public int readBytes(byte[] value)
              throws JMSException
Reads a byte array field from this stream message.
Specified by:
readBytes in interface StreamMessage
Parameters:
value - the buffer into which the data is read
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the byte field has been reached
Throws:
JMSException - if the byte[] is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the next value in the stream is not a byte[].
MessageNotReadableException - if the message is in write-only mode.
See Also:
StreamMessage.readObject()

writeBoolean

public void writeBoolean(boolean value)
                  throws JMSException
Writes a boolean value to this stream message.
Specified by:
writeBoolean in interface StreamMessage
Parameters:
value - the boolean value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeByte

public void writeByte(byte value)
               throws JMSException
Writes a byte value to this stream message.
Specified by:
writeByte in interface StreamMessage
Parameters:
value - the byte value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeShort

public void writeShort(short value)
                throws JMSException
Writes a short value to this stream message.
Specified by:
writeShort in interface StreamMessage
Parameters:
value - the short value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeChar

public void writeChar(char value)
               throws JMSException
Writes a char value to this stream message.
Specified by:
writeChar in interface StreamMessage
Parameters:
value - the char value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeInt

public void writeInt(int value)
              throws JMSException
Writes an int value to this stream message.
Specified by:
writeInt in interface StreamMessage
Parameters:
value - the int value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeLong

public void writeLong(long value)
               throws JMSException
Writes a long value to this stream message.
Specified by:
writeLong in interface StreamMessage
Parameters:
value - the long value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeFloat

public void writeFloat(float value)
                throws JMSException
Writes a float value to this stream message.
Specified by:
writeFloat in interface StreamMessage
Parameters:
value - the float value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeDouble

public void writeDouble(double value)
                 throws JMSException
Writes a double value to this stream message.
Specified by:
writeDouble in interface StreamMessage
Parameters:
value - the double value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeString

public void writeString(java.lang.String value)
                 throws JMSException
Writes a String value to this stream message.
Specified by:
writeString in interface StreamMessage
Parameters:
value - the String value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeBytes

public void writeBytes(byte[] value)
                throws JMSException
Writes a byte[] value to this stream message.
Specified by:
writeBytes in interface StreamMessage
Parameters:
value - the byte[] value to be written
Throws:
JMSException - if value is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeBytes

public void writeBytes(byte[] value,
                       int offset,
                       int length)
                throws JMSException
Writes a portion of a byte[] to this stream message.
Specified by:
writeBytes in interface StreamMessage
Parameters:
value - the source array
offset - the initial offset within the source array
length - the number of bytes to use from the source array
Throws:
JMSException - if the portion is not written due to some error.
MessageNotWriteableException - if this message is in read-only mode.

writeObject

public void writeObject(java.lang.Object value)
                 throws JMSException
Writes a Java object to this stream message.
Specified by:
writeObject in interface StreamMessage
Parameters:
value - the Java object to be written
Throws:
JMSException - if value is not written due to some error.
MessageFormatException - if the object is invalid.
MessageNotWriteableException - if this message is in read-only mode.

readObject

public java.lang.Object readObject()
                            throws JMSException
Reads the next value from this stream message and returns it as a Java object. Note that this method can be used to return, in objectified format, a value which has been written to the stream with the writeObject method or the format's equivalent primitive writetype method.
Specified by:
readObject in interface StreamMessage
Returns:
the value read, converted (if needed) to objectified format (e.g., int is converted to Integer)
Throws:
JMSException - if the value is not read due to some error.
MessageEOFException - if the end of the message stream has been reached.
MessageFormatException - if the conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.
See Also:
StreamMessage.readBytes(byte[] value)

reset

public void reset()
           throws JMSException
Puts the message body into read-only mode, and repositions the stream to the beginning.
Specified by:
reset in interface StreamMessage
Throws:
JMSException - if the message is not reset due to some error.
MessageFormatException - if the message has an invalid format.

clearBody

public void clearBody()
               throws JMSException
Clears out the message body. All other parts of the message are left untouched.
Specified by:
clearBody in interface Message
Overrides:
clearBody in class AQjmsMessage
Throws:
JMSException - if the message body is not cleared due to some error.

Oracle® Streams Advanced Queuing Java API Reference
10g Release 2 (10.2)

B14291-01


Copyright © 2003, 2005, Oracle. All rights reserved.