org.jboss.jms.message
Class JBossBytesMessage

java.lang.Object
  extended byorg.jboss.messaging.core.message.RoutableSupport
      extended byorg.jboss.messaging.core.message.MessageSupport
          extended byorg.jboss.jms.message.JBossMessage
              extended byorg.jboss.jms.message.JBossBytesMessage
All Implemented Interfaces:
java.io.Externalizable, Message, Routable, java.io.Serializable

public class JBossBytesMessage
extends JBossMessage
implements java.io.Externalizable

This class implements javax.jms.BytesMessage.

Version:
$Revision: 1019 $ $Id: JBossBytesMessage.java 1019 2006-07-17 17:15:04Z timfox $
Author:
Norbert Lataille (Norbert.Lataille@m4x.org), Adrian Brock, Tim Fox, Ovidiu Feodorov
See Also:
Serialized Form

Field Summary
static byte TYPE
           
 
Fields inherited from class org.jboss.jms.message.JBossMessage
connectionID, correlationID, correlationIDBytes, destination, jmsMessageID, jmsType, properties, replyToDestination
 
Fields inherited from class org.jboss.messaging.core.message.RoutableSupport
BOOLEAN, BYTE, BYTES, deliveryCount, DOUBLE, expiration, FLOAT, headers, INT, LIST, LONG, MAP, messageID, NULL, OBJECT, priority, reliable, SHORT, STRING, timestamp
 
Fields inherited from interface org.jboss.messaging.core.Routable
COLLECTOR_ID, REMOTE_ROUTABLE, REPLICATOR_ID
 
Constructor Summary
JBossBytesMessage()
          Only deserialization should use this constructor directly
JBossBytesMessage(BytesMessage foreign, long id)
           
JBossBytesMessage(JBossBytesMessage other)
          Make a shallow copy of another JBossBytesMessage
JBossBytesMessage(long messageID)
           
JBossBytesMessage(long messageID, boolean reliable, long expiration, long timestamp, byte priority, java.util.Map coreHeaders, byte[] payloadAsByteArray, int persistentChannelCount, java.lang.String jmsType, java.lang.String correlationID, byte[] correlationIDBytes, JBossDestination destination, JBossDestination replyTo, java.util.HashMap jmsProperties)
           
 
Method Summary
 void clearBody()
           
 void copyPayload(java.lang.Object payload)
           
 void doAfterSend()
           
 JBossMessage doShallowCopy()
           
 long getBodyLength()
           
 byte[] getPayloadAsByteArray()
          A JBossBytesMessage avoid double serialization by holding on its original payload, which is a byte[] to start with.
 byte getType()
           
 boolean readBoolean()
           
 byte readByte()
           
 int readBytes(byte[] value)
           
 int readBytes(byte[] value, int length)
           
 char readChar()
           
 double readDouble()
           
 void readExternal(java.io.ObjectInput in)
           
 float readFloat()
           
 int readInt()
           
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 void reset()
           
 void writeBoolean(boolean value)
           
 void writeByte(byte value)
           
 void writeBytes(byte[] value)
           
 void writeBytes(byte[] value, int offset, int length)
           
 void writeChar(char value)
           
 void writeDouble(double value)
           
 void writeFloat(float value)
           
 void writeInt(int value)
           
 void writeLong(long value)
           
 void writeObject(java.lang.Object value)
           
 void writeShort(short value)
           
 void writeUTF(java.lang.String value)
           
 
Methods inherited from class org.jboss.jms.message.JBossMessage
acknowledge, clearProperties, createThinDelegate, dump, getBooleanProperty, getByteProperty, getConnectionID, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSProperties, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isCorrelationIDBytes, isReference, propertyExists, readDestination, setBooleanProperty, setByteProperty, setConnectionID, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSProperties, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setMessageId, setObjectProperty, setShortProperty, setStringProperty, toString, writeDestination, writeExternal
 
Methods inherited from class org.jboss.messaging.core.message.MessageSupport
clearPayloadAsByteArray, copyPayloadAsByteArrayToPayload, decPersistentChannelCount, equals, getHeaders, getMessage, getPayload, getPersistentChannelCount, hashCode, incPersistentChannelCount, readPayloadExternal, setPayload, writePayloadExternal
 
Methods inherited from class org.jboss.messaging.core.message.RoutableSupport
containsHeader, decrementDeliveryCount, getDeliveryCount, getExpiration, getHeader, getHeaderNames, getMessageID, getPriority, getTimestamp, incrementDeliveryCount, internalReadObject, internalWriteObject, isExpired, isReliable, putHeader, readList, readMap, removeHeader, setDeliveryCount, setPriority, setReliable, writeList, writeMap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.io.Externalizable
writeExternal
 
Methods inherited from interface org.jboss.messaging.core.Routable
containsHeader, decrementDeliveryCount, getDeliveryCount, getExpiration, getHeader, getHeaderNames, getMessageID, getPriority, getTimestamp, incrementDeliveryCount, isExpired, isReliable, putHeader, removeHeader, setDeliveryCount, setPriority, setReliable
 

Field Detail

TYPE

public static final byte TYPE
See Also:
Constant Field Values
Constructor Detail

JBossBytesMessage

public JBossBytesMessage()
Only deserialization should use this constructor directly


JBossBytesMessage

public JBossBytesMessage(long messageID)

JBossBytesMessage

public JBossBytesMessage(long messageID,
                         boolean reliable,
                         long expiration,
                         long timestamp,
                         byte priority,
                         java.util.Map coreHeaders,
                         byte[] payloadAsByteArray,
                         int persistentChannelCount,
                         java.lang.String jmsType,
                         java.lang.String correlationID,
                         byte[] correlationIDBytes,
                         JBossDestination destination,
                         JBossDestination replyTo,
                         java.util.HashMap jmsProperties)

JBossBytesMessage

public JBossBytesMessage(JBossBytesMessage other)
Make a shallow copy of another JBossBytesMessage

Parameters:
other -

JBossBytesMessage

public JBossBytesMessage(BytesMessage foreign,
                         long id)
                  throws JMSException
Method Detail

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class JBossMessage
Throws:
java.io.IOException
java.lang.ClassNotFoundException

readBoolean

public boolean readBoolean()
                    throws JMSException
Throws:
JMSException

readByte

public byte readByte()
              throws JMSException
Throws:
JMSException

readUnsignedByte

public int readUnsignedByte()
                     throws JMSException
Throws:
JMSException

readShort

public short readShort()
                throws JMSException
Throws:
JMSException

readUnsignedShort

public int readUnsignedShort()
                      throws JMSException
Throws:
JMSException

readChar

public char readChar()
              throws JMSException
Throws:
JMSException

readInt

public int readInt()
            throws JMSException
Throws:
JMSException

readLong

public long readLong()
              throws JMSException
Throws:
JMSException

readFloat

public float readFloat()
                throws JMSException
Throws:
JMSException

readDouble

public double readDouble()
                  throws JMSException
Throws:
JMSException

readUTF

public java.lang.String readUTF()
                         throws JMSException
Throws:
JMSException

readBytes

public int readBytes(byte[] value)
              throws JMSException
Throws:
JMSException

readBytes

public int readBytes(byte[] value,
                     int length)
              throws JMSException
Throws:
JMSException

writeBoolean

public void writeBoolean(boolean value)
                  throws JMSException
Throws:
JMSException

writeByte

public void writeByte(byte value)
               throws JMSException
Throws:
JMSException

writeShort

public void writeShort(short value)
                throws JMSException
Throws:
JMSException

writeChar

public void writeChar(char value)
               throws JMSException
Throws:
JMSException

writeInt

public void writeInt(int value)
              throws JMSException
Throws:
JMSException

writeLong

public void writeLong(long value)
               throws JMSException
Throws:
JMSException

writeFloat

public void writeFloat(float value)
                throws JMSException
Throws:
JMSException

writeDouble

public void writeDouble(double value)
                 throws JMSException
Throws:
JMSException

writeUTF

public void writeUTF(java.lang.String value)
              throws JMSException
Throws:
JMSException

writeBytes

public void writeBytes(byte[] value)
                throws JMSException
Throws:
JMSException

writeBytes

public void writeBytes(byte[] value,
                       int offset,
                       int length)
                throws JMSException
Throws:
JMSException

writeObject

public void writeObject(java.lang.Object value)
                 throws JMSException
Throws:
JMSException

reset

public void reset()
           throws JMSException
Throws:
JMSException

getPayloadAsByteArray

public byte[] getPayloadAsByteArray()
A JBossBytesMessage avoid double serialization by holding on its original payload, which is a byte[] to start with.

Specified by:
getPayloadAsByteArray in interface Message
Overrides:
getPayloadAsByteArray in class MessageSupport

doAfterSend

public void doAfterSend()
                 throws JMSException
Overrides:
doAfterSend in class JBossMessage
Throws:
JMSException

clearBody

public void clearBody()
               throws JMSException
Overrides:
clearBody in class JBossMessage
Throws:
JMSException

getBodyLength

public long getBodyLength()
                   throws JMSException
Throws:
JMSException

getType

public byte getType()
Overrides:
getType in class JBossMessage

doShallowCopy

public JBossMessage doShallowCopy()
                           throws JMSException
Overrides:
doShallowCopy in class JBossMessage
Throws:
JMSException

copyPayload

public void copyPayload(java.lang.Object payload)
                 throws JMSException
Overrides:
copyPayload in class JBossMessage
Throws:
JMSException


Copyright © 2006 JBoss Inc. All Rights Reserved.