com.caucho.jms.message
Class StreamMessageImpl

java.lang.Object
  extended by com.caucho.jms.message.MessageImpl
      extended by com.caucho.jms.message.StreamMessageImpl
All Implemented Interfaces:
java.io.Serializable, Message, StreamMessage

public class StreamMessageImpl
extends MessageImpl
implements StreamMessage

A stream message.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.jms.message.MessageImpl
L, log
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
StreamMessageImpl()
           
 
Method Summary
 java.io.InputStream bodyToInputStream()
          Serialize the body to an input stream.
 void clearBody()
          Clears the message and puts it into write mode.
 MessageImpl copy()
           
protected  void copy(StreamMessageImpl newMsg)
           
 MessageType getType()
          Returns the type enumeration.
 void readBody(java.io.InputStream is)
          Read the body from an input stream.
 boolean readBoolean()
          Read a boolean from the stream.
 byte readByte()
          Read a byte from the stream.
 int readBytes(byte[] value)
          Read a byte array object from the stream.
 char readChar()
          Read a character object from the stream.
 double readDouble()
          Read a double from the stream.
 float readFloat()
          Read a float from the stream.
 int readInt()
          Read an integer from the stream.
 long readLong()
          Read a long from the stream.
 java.lang.Object readObject()
          Reads the next object.
 short readShort()
          Read a short from the stream.
 java.lang.String readString()
          Read a string from the stream.
 void reset()
          Set the stream for reading.
 void setReceive()
          Sets the body for reading.
 java.lang.String toString()
           
 void writeBoolean(boolean b)
          Writes a boolean to the stream.
 void writeByte(byte b)
          Writes a byte to the stream.
 void writeBytes(byte[] buf)
          Writes a byte array to the stream.
 void writeBytes(byte[] buf, int offset, int length)
          Writes a byte array to the stream.
 void writeChar(char ch)
          Writes a character to the stream.
 void writeDouble(double d)
          Writes a double to the stream.
 void writeFloat(float f)
          Writes a float to the stream.
 void writeInt(int i)
          Writes an integer to the stream.
 void writeLong(long l)
          Writes a long to the stream.
 void writeObject(java.lang.Object obj)
          Writes the next object.
 void writeShort(short s)
          Writes a short to the stream.
 void writeString(java.lang.String s)
          Writes a string to the stream.
 
Methods inherited from class com.caucho.jms.message.MessageImpl
acknowledge, checkBodyReadable, checkBodyWriteable, checkHeaderWriteable, checkPropertyWriteable, clearProperties, copy, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getProperties, getPropertyNames, getSequence, getShortProperty, getStringProperty, isReserved, propertiesToInputStream, propertyExists, readProperties, setBodyReadOnly, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setSequence, setSession, setShortProperty, setStringProperty, writeBody, writeProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.Message
acknowledge, 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
 

Constructor Detail

StreamMessageImpl

public StreamMessageImpl()
Method Detail

getType

public MessageType getType()
Returns the type enumeration.

Overrides:
getType in class MessageImpl

setReceive

public void setReceive()
                throws JMSException
Sets the body for reading.

Overrides:
setReceive in class MessageImpl
Throws:
JMSException

reset

public void reset()
           throws JMSException
Set the stream for reading.

Specified by:
reset in interface StreamMessage
Throws:
JMSException

readBoolean

public boolean readBoolean()
                    throws JMSException
Read a boolean from the stream.

Specified by:
readBoolean in interface StreamMessage
Throws:
JMSException

readByte

public byte readByte()
              throws JMSException
Read a byte from the stream.

Specified by:
readByte in interface StreamMessage
Throws:
JMSException

readShort

public short readShort()
                throws JMSException
Read a short from the stream.

Specified by:
readShort in interface StreamMessage
Throws:
JMSException

readInt

public int readInt()
            throws JMSException
Read an integer from the stream.

Specified by:
readInt in interface StreamMessage
Throws:
JMSException

readLong

public long readLong()
              throws JMSException
Read a long from the stream.

Specified by:
readLong in interface StreamMessage
Throws:
JMSException

readFloat

public float readFloat()
                throws JMSException
Read a float from the stream.

Specified by:
readFloat in interface StreamMessage
Throws:
JMSException

readDouble

public double readDouble()
                  throws JMSException
Read a double from the stream.

Specified by:
readDouble in interface StreamMessage
Throws:
JMSException

readChar

public char readChar()
              throws JMSException
Read a character object from the stream.

Specified by:
readChar in interface StreamMessage
Throws:
JMSException

readString

public java.lang.String readString()
                            throws JMSException
Read a string from the stream.

Specified by:
readString in interface StreamMessage
Throws:
JMSException

readBytes

public int readBytes(byte[] value)
              throws JMSException
Read a byte array object from the stream.

Specified by:
readBytes in interface StreamMessage
Throws:
JMSException

readObject

public java.lang.Object readObject()
                            throws JMSException
Reads the next object.

Specified by:
readObject in interface StreamMessage
Throws:
JMSException

clearBody

public void clearBody()
               throws JMSException
Clears the message and puts it into write mode.

Specified by:
clearBody in interface Message
Overrides:
clearBody in class MessageImpl
Throws:
JMSException

writeBoolean

public void writeBoolean(boolean b)
                  throws JMSException
Writes a boolean to the stream.

Specified by:
writeBoolean in interface StreamMessage
Throws:
JMSException

writeByte

public void writeByte(byte b)
               throws JMSException
Writes a byte to the stream.

Specified by:
writeByte in interface StreamMessage
Throws:
JMSException

writeShort

public void writeShort(short s)
                throws JMSException
Writes a short to the stream.

Specified by:
writeShort in interface StreamMessage
Throws:
JMSException

writeInt

public void writeInt(int i)
              throws JMSException
Writes an integer to the stream.

Specified by:
writeInt in interface StreamMessage
Throws:
JMSException

writeLong

public void writeLong(long l)
               throws JMSException
Writes a long to the stream.

Specified by:
writeLong in interface StreamMessage
Throws:
JMSException

writeFloat

public void writeFloat(float f)
                throws JMSException
Writes a float to the stream.

Specified by:
writeFloat in interface StreamMessage
Throws:
JMSException

writeDouble

public void writeDouble(double d)
                 throws JMSException
Writes a double to the stream.

Specified by:
writeDouble in interface StreamMessage
Throws:
JMSException

writeString

public void writeString(java.lang.String s)
                 throws JMSException
Writes a string to the stream.

Specified by:
writeString in interface StreamMessage
Throws:
JMSException

writeChar

public void writeChar(char ch)
               throws JMSException
Writes a character to the stream.

Specified by:
writeChar in interface StreamMessage
Throws:
JMSException

writeBytes

public void writeBytes(byte[] buf)
                throws JMSException
Writes a byte array to the stream.

Specified by:
writeBytes in interface StreamMessage
Throws:
JMSException

writeBytes

public void writeBytes(byte[] buf,
                       int offset,
                       int length)
                throws JMSException
Writes a byte array to the stream.

Specified by:
writeBytes in interface StreamMessage
Throws:
JMSException

writeObject

public void writeObject(java.lang.Object obj)
                 throws JMSException
Writes the next object.

Specified by:
writeObject in interface StreamMessage
Throws:
JMSException

copy

public MessageImpl copy()
Overrides:
copy in class MessageImpl

copy

protected void copy(StreamMessageImpl newMsg)

bodyToInputStream

public java.io.InputStream bodyToInputStream()
                                      throws java.io.IOException
Serialize the body to an input stream.

Overrides:
bodyToInputStream in class MessageImpl
Throws:
java.io.IOException

readBody

public void readBody(java.io.InputStream is)
              throws java.io.IOException,
                     JMSException
Read the body from an input stream.

Overrides:
readBody in class MessageImpl
Throws:
java.io.IOException
JMSException

toString

public java.lang.String toString()
Overrides:
toString in class MessageImpl