org.xmlBlaster.jms
Class XBBytesMessage
java.lang.Object
org.xmlBlaster.jms.XBMessage
org.xmlBlaster.jms.XBBytesMessage
- All Implemented Interfaces:
- javax.jms.BytesMessage, javax.jms.Message
- Direct Known Subclasses:
- XBStreamMessage
public class XBBytesMessage
- extends XBMessage
- implements javax.jms.BytesMessage
XBBytesMessage
- Author:
- Michele Laghi
Field Summary |
private java.io.ByteArrayInputStream |
bais
|
private java.io.ByteArrayOutputStream |
baos
|
private java.io.DataInputStream |
dataIs
|
private java.io.DataOutputStream |
dataOs
|
private static java.lang.String |
ME
|
private boolean |
streamEnded
true if the stream has reached its end. |
private boolean |
writeOnly
|
Fields inherited from class org.xmlBlaster.jms.XBMessage |
acknowledged, BYTES, content, DEFAULT_TYPE, destination, global, MAP, OBJECT, props, readOnly, session, STREAM, STREAMING, TEXT, type |
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Methods inherited from class org.xmlBlaster.jms.XBMessage |
acknowledge, addToKeyAndCheck, checkPropertiesReadOnly, clearProperties, get, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isAcknowledged, propertyExists, setAcknowledged, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setPropertyReadOnly, setReadOnly, 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, 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 |
ME
private static final java.lang.String ME
- See Also:
- Constant Field Values
dataIs
private java.io.DataInputStream dataIs
dataOs
private java.io.DataOutputStream dataOs
baos
private java.io.ByteArrayOutputStream baos
bais
private java.io.ByteArrayInputStream bais
writeOnly
private boolean writeOnly
streamEnded
private boolean streamEnded
- true if the stream has reached its end. This is needed to return -1 when readBytes
is invoked on a passed stream.
XBBytesMessage
public XBBytesMessage(XBSession session,
byte[] content)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
XBBytesMessage
XBBytesMessage(XBSession session,
byte[] content,
int type)
throws javax.jms.JMSException
- If the content is empty it will be considered a message for a producer,
i.e. a message to be filled and sent. If the content is not null, then it
is assumed to be a message for a consumer
- Parameters:
global
- key
- content
- qos
-
- Throws:
javax.jms.JMSException
makeWriteable
private void makeWriteable()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getterCheck
private void getterCheck(java.lang.String methodName)
throws javax.jms.MessageNotReadableException
- Throws:
javax.jms.MessageNotReadableException
setterCheck
private void setterCheck(java.lang.String methodName)
throws javax.jms.MessageNotWriteableException
- Throws:
javax.jms.MessageNotWriteableException
getBodyLength
public long getBodyLength()
throws javax.jms.JMSException
- Specified by:
getBodyLength
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
resetDataStream
private final void resetDataStream()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
readBoolean
public boolean readBoolean()
throws javax.jms.JMSException
- Specified by:
readBoolean
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readByte
public byte readByte()
throws javax.jms.JMSException
- Specified by:
readByte
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readUnsignedByte
public int readUnsignedByte()
throws javax.jms.JMSException
- Specified by:
readUnsignedByte
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readShort
public short readShort()
throws javax.jms.JMSException
- Specified by:
readShort
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readUnsignedShort
public int readUnsignedShort()
throws javax.jms.JMSException
- Specified by:
readUnsignedShort
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readChar
public char readChar()
throws javax.jms.JMSException
- Specified by:
readChar
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readInt
public int readInt()
throws javax.jms.JMSException
- Specified by:
readInt
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readLong
public long readLong()
throws javax.jms.JMSException
- Specified by:
readLong
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readFloat
public float readFloat()
throws javax.jms.JMSException
- Specified by:
readFloat
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readDouble
public double readDouble()
throws javax.jms.JMSException
- Specified by:
readDouble
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readUTF
public java.lang.String readUTF()
throws javax.jms.JMSException
- Specified by:
readUTF
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readString
public java.lang.String readString()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
readBytes
public int readBytes(byte[] value)
throws javax.jms.JMSException
- Specified by:
readBytes
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
readObject
public java.lang.Object readObject()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
readBytes
public int readBytes(byte[] value,
int length)
throws javax.jms.JMSException
- Specified by:
readBytes
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeBoolean
public void writeBoolean(boolean value)
throws javax.jms.JMSException
- Specified by:
writeBoolean
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeByte
public void writeByte(byte value)
throws javax.jms.JMSException
- Specified by:
writeByte
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeShort
public void writeShort(short value)
throws javax.jms.JMSException
- Specified by:
writeShort
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeChar
public void writeChar(char value)
throws javax.jms.JMSException
- Specified by:
writeChar
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeInt
public void writeInt(int value)
throws javax.jms.JMSException
- Specified by:
writeInt
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeLong
public void writeLong(long value)
throws javax.jms.JMSException
- Specified by:
writeLong
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeFloat
public void writeFloat(float value)
throws javax.jms.JMSException
- Specified by:
writeFloat
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeDouble
public void writeDouble(double value)
throws javax.jms.JMSException
- Specified by:
writeDouble
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeUTF
public void writeUTF(java.lang.String value)
throws javax.jms.JMSException
- Specified by:
writeUTF
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeString
public void writeString(java.lang.String value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
writeBytes
public void writeBytes(byte[] value)
throws javax.jms.JMSException
- Specified by:
writeBytes
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeBytes
public void writeBytes(byte[] value,
int offset,
int length)
throws javax.jms.JMSException
- Specified by:
writeBytes
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
writeObject
public void writeObject(java.lang.Object value)
throws javax.jms.JMSException
- Specified by:
writeObject
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
reset
public void reset()
throws javax.jms.JMSException
- Specified by:
reset
in interface javax.jms.BytesMessage
- Throws:
javax.jms.JMSException
clearBody
public void clearBody()
throws javax.jms.JMSException
- Specified by:
clearBody
in interface javax.jms.Message
- Overrides:
clearBody
in class XBMessage
- Throws:
javax.jms.JMSException
Copyright © 1999-2014 The xmlBlaster.org contributers.