<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">

Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

oracle.jms
Class AQjmsStreamMessage

java.lang.Object
  |
  +--oracle.jms.AQjmsMessage
        |
        +--oracle.jms.AQjmsStreamMessage
All Implemented Interfaces:
Message, StreamMessage

public class AQjmsStreamMessage
extends AQjmsMessage
implements StreamMessage

Oracle class implementing 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()
          Clear out the message body.
 void clearProperties()
          Clears a message's properties.
protected  void closeContainer()
           
protected  oracle.sql.ORAData getMessageCont()
           
protected  void populateMessageContainer(oracle.jdbc.OracleConnection db_conn, boolean usetemplob)
           
 boolean readBoolean()
          Reads a boolean from the stream message
 byte readByte()
          Reads a signed 8-bit value from the stream message
 int readBytes(byte[] value)
          Read a byte array from the stream message
 char readChar()
          Read a Unicode character value from the stream message
 double readDouble()
          Read a double from the stream message
 float readFloat()
          Read a float from the stream message
 int readInt()
          Read a signed 32 bit integer from the stream message
 long readLong()
          Read a signed 64 bit integer from the stream message
 java.lang.Object readObject()
          Read a Java object from the stream message.
 short readShort()
          Reads a signed 16-bit value from the stream message
 java.lang.String readString()
          Read a string from the stream message
 void reset()
          Put the message in read-only mode, and reposition the stream of bytes to the beginning.
protected  void write_lob(java.sql.Connection db_conn, java.lang.String q_table, byte[] msg_id, boolean gen_pload, boolean is_anydata_dest)
           
 void writeBoolean(boolean value)
          Write a boolean to the stream message as a 1-byte value.
 void writeByte(byte value)
          Write out a byte to the stream message as a 1-byte value.
 void writeBytes(byte[] value)
          Write a byte array to the stream message
 void writeBytes(byte[] value, int offset, int length)
          Write a portion of byte array to the stream message
 void writeChar(char value)
          Write a char to the stream as a 2-byte, high byte first
 void writeDouble(double value)
          Write a double to the stream as a 8-byte, high byte first
 void writeFloat(float value)
          Write a float to the stream as a 4-byte, high byte first
 void writeInt(int value)
          Write a int to the stream as a 4-byte, high byte first
 void writeLong(long value)
          Write a int to the stream as a 4-byte, high byte first
 void writeObject(java.lang.Object value)
          Write a java object to the stream message
 void writeShort(short value)
          Write a short to the stream as a 2-byte, high byte first
 void writeString(java.lang.String value)
          Writes a string to the underlying output stream

 

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 JMS provider fails to clear the message properties due to some internal error.

readBoolean

public boolean readBoolean()
                    throws JMSException
Reads a boolean from the stream message
Specified by:
readBoolean in interface StreamMessage
Returns:
the boolean value read
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readByte

public byte readByte()
              throws JMSException
Reads a signed 8-bit value from the stream message
Specified by:
readByte in interface StreamMessage
Returns:
the next byte from the stream message as a signed 8-bit byte
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readShort

public short readShort()
                throws JMSException
Reads a signed 16-bit value from the stream message
Specified by:
readShort in interface StreamMessage
Returns:
the next two bytes from the stream message, interpreted as a 16-bit number
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readChar

public char readChar()
              throws JMSException
Read a Unicode character value from the stream message
Specified by:
readChar in interface StreamMessage
Returns:
the next two bytes from the stream message as a Unicode character.
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readInt

public int readInt()
            throws JMSException
Read a signed 32 bit integer from the stream message
Specified by:
readInt in interface StreamMessage
Returns:
the next four bytes from the stream message, interpreted as a int.
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readLong

public long readLong()
              throws JMSException
Read a signed 64 bit integer from the stream message
Specified by:
readLong in interface StreamMessage
Returns:
the next eight bytes from the stream message, interpreted as a long.
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readFloat

public float readFloat()
                throws JMSException
Read a float from the stream message
Specified by:
readFloat in interface StreamMessage
Returns:
the next four bytes from the stream message, interpreted as a float.
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readDouble

public double readDouble()
                  throws JMSException
Read a double from the stream message
Specified by:
readDouble in interface StreamMessage
Returns:
the next eight bytes from the stream message, interpreted as a double.
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readString

public java.lang.String readString()
                            throws JMSException
Read a string from the stream message
Specified by:
readString in interface StreamMessage
Returns:
string from the stream message
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream

readBytes

public int readBytes(byte[] value)
              throws JMSException
Read a byte array from the 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 stream has been reached.
Throws:
MessageNotReadableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if end of message stream
See Also:
StreamMessage.readObject()

writeBoolean

public void writeBoolean(boolean value)
                  throws JMSException
Write a boolean to the stream message as a 1-byte value. The value true is written out as the value (byte)1; the value false is written out as the value (byte)0.
Specified by:
writeBoolean in interface StreamMessage
Parameters:
value - the boolean value to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeByte

public void writeByte(byte value)
               throws JMSException
Write out a byte to the stream message as a 1-byte value.
Specified by:
writeByte in interface StreamMessage
Parameters:
value - the byte value to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeShort

public void writeShort(short value)
                throws JMSException
Write a short to the stream as a 2-byte, high byte first
Specified by:
writeShort in interface StreamMessage
Parameters:
value - the short to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeChar

public void writeChar(char value)
               throws JMSException
Write a char to the stream as a 2-byte, high byte first
Specified by:
writeChar in interface StreamMessage
Parameters:
value - the char to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeInt

public void writeInt(int value)
              throws JMSException
Write a int to the stream as a 4-byte, high byte first
Specified by:
writeInt in interface StreamMessage
Parameters:
value - the int to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeLong

public void writeLong(long value)
               throws JMSException
Write a int to the stream as a 4-byte, high byte first
Specified by:
writeLong in interface StreamMessage
Parameters:
value - the int to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeFloat

public void writeFloat(float value)
                throws JMSException
Write a float to the stream as a 4-byte, high byte first
Specified by:
writeFloat in interface StreamMessage
Parameters:
value - the float to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeDouble

public void writeDouble(double value)
                 throws JMSException
Write a double to the stream as a 8-byte, high byte first
Specified by:
writeDouble in interface StreamMessage
Parameters:
value - The double to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeString

public void writeString(java.lang.String value)
                 throws JMSException
Writes a string to the underlying output stream
Specified by:
writeString in interface StreamMessage
Parameters:
value - The string to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeBytes

public void writeBytes(byte[] value)
                throws JMSException
Write a byte array to the stream message
Specified by:
writeBytes in interface StreamMessage
Parameters:
value - The byte array to be written
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeBytes

public void writeBytes(byte[] value,
                       int offset,
                       int length)
                throws JMSException
Write a portion of byte array to the stream message
Specified by:
writeBytes in interface StreamMessage
Parameters:
value - the byte array to be written
offset - the initial offset within the byte array
length - the number of bytes to use
Throws:
MessageNotWritableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

writeObject

public void writeObject(java.lang.Object value)
                 throws JMSException
Write a java object to the stream message
Specified by:
writeObject in interface StreamMessage
Parameters:
value - the java object to be written.
Throws:
MessageNotWritableException - if message in write-only mode.
MessageFormatException - if object is invalid type
JMSException - if JMS fails to read message due to some internal JMS error.

readObject

public java.lang.Object readObject()
                            throws JMSException
Read a Java object from the stream message.

Note that this method can be used to return in objectified format, an object that had been written to the Stream with the equivalent writeObject method call, or it's equivalent primitive write<type> method.

Specified by:
readObject in interface StreamMessage
Returns:
a Java object from the stream message, in objectified format (ie. if it set as an int, then a Integer is returned).
Throws:
JMSException - if JMS fails to read message due to some internal JMS error.
MessageEOFException - if an end of message stream
MessageNotReadableException - if message in write-only mode.
See Also:
StreamMessage.readBytes(byte[] value)

reset

public void reset()
           throws JMSException
Put the message in read-only mode, and reposition the stream of bytes to the beginning.
Specified by:
reset in interface StreamMessage
Throws:
MessageNotWriteableException - if message in write-only mode.
JMSException - if JMS fails to read message due to some internal JMS error.

clearBody

public void clearBody()
               throws JMSException
Clear 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 JMS fails to due to some internal JMS error.

getMessageCont

protected oracle.sql.ORAData getMessageCont()
Overrides:
getMessageCont in class AQjmsMessage

closeContainer

protected void closeContainer()
Overrides:
closeContainer in class AQjmsMessage

populateMessageContainer

protected void populateMessageContainer(oracle.jdbc.OracleConnection db_conn,
                                        boolean usetemplob)
                                 throws JMSException,
                                        java.sql.SQLException
Overrides:
populateMessageContainer in class AQjmsMessage
JMSException
java.sql.SQLException

write_lob

protected void write_lob(java.sql.Connection db_conn,
                         java.lang.String q_table,
                         byte[] msg_id,
                         boolean gen_pload,
                         boolean is_anydata_dest)
                  throws JMSException
Overrides:
write_lob in class AQjmsMessage
JMSException

Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

Copyright © 2003, Oracle. All Rights Reserved.