xmlBlaster 2.2.0 API

org.xmlBlaster.jms
Class XBMessage

java.lang.Object
  extended by org.xmlBlaster.jms.XBMessage
All Implemented Interfaces:
javax.jms.Message
Direct Known Subclasses:
XBBytesMessage, XBMapMessage, XBObjectMessage, XBTextMessage

public class XBMessage
extends java.lang.Object
implements javax.jms.Message

XBMessage. Implementation details about how

Author:
Michele Laghi

Field Summary
protected  boolean acknowledged
           
static int BYTES
           
protected  byte[] content
           
private  java.lang.String correlationID
           
static int DEFAULT_TYPE
           
private  int deliveryMode
           
protected  javax.jms.Destination destination
           
private  long expiration
           
protected  Global global
           
private  java.lang.String jmsType
           
private static java.util.logging.Logger log
           
static int MAP
           
private static java.lang.String ME
           
private  java.lang.String messageID
           
static int OBJECT
           
private  int priority
           
private  boolean propertyReadOnly
           
protected  java.util.Map props
           
protected  boolean readOnly
           
private  boolean redelivered
           
private  javax.jms.Destination replyTo
           
protected  XBSession session
           
static int STREAM
           
static int STREAMING
           
static int TEXT
           
private  long timestamp
           
protected  int type
           
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
XBMessage(XBSession session, byte[] content, int type)
           
 
Method Summary
 void acknowledge()
           
static java.lang.String addToKeyAndCheck(java.lang.String key)
           
protected  void checkPropertiesReadOnly(java.lang.String methodName, java.lang.String key)
          Checks if the properties are readonly.
 void clearBody()
           
 void clearProperties()
           
static ClientProperty get(java.lang.String key, java.util.Map map)
           
 boolean getBooleanProperty(java.lang.String key)
           
 byte getByteProperty(java.lang.String key)
           
 double getDoubleProperty(java.lang.String key)
           
 float getFloatProperty(java.lang.String key)
           
 int getIntProperty(java.lang.String key)
           
 java.lang.String getJMSCorrelationID()
           
 byte[] getJMSCorrelationIDAsBytes()
           
 int getJMSDeliveryMode()
           
 javax.jms.Destination getJMSDestination()
           
 long getJMSExpiration()
           
 java.lang.String getJMSMessageID()
          xmlBlaster specific messageId is our unique timestamp
 int getJMSPriority()
           
 boolean getJMSRedelivered()
           
 javax.jms.Destination getJMSReplyTo()
           
 long getJMSTimestamp()
           
 java.lang.String getJMSType()
           
 long getLongProperty(java.lang.String key)
           
 java.lang.Object getObjectProperty(java.lang.String key)
           
 java.util.Enumeration getPropertyNames()
           
 short getShortProperty(java.lang.String key)
          Can handle String, Byte, and Short properties
 java.lang.String getStringProperty(java.lang.String key)
           
(package private)  boolean isAcknowledged()
           
 boolean propertyExists(java.lang.String key)
           
(package private)  void setAcknowledged(boolean acknowledged)
           
 void setBooleanProperty(java.lang.String key, boolean value)
           
 void setByteProperty(java.lang.String key, byte value)
           
 void setDoubleProperty(java.lang.String key, double value)
           
 void setFloatProperty(java.lang.String key, float value)
           
 void setIntProperty(java.lang.String key, int value)
           
 void setJMSCorrelationID(java.lang.String correlationID)
           
 void setJMSCorrelationIDAsBytes(byte[] correlationId)
           
 void setJMSDeliveryMode(int deliveryMode)
          This method is invoked by the send method
 void setJMSDestination(javax.jms.Destination destination)
          This method is invoked by the send method
 void setJMSExpiration(long lifeTime)
          This method is invoked by the send method
 void setJMSMessageID(java.lang.String messageID)
          This is overwritten when invoking the getter This method is invoked by the send method
 void setJMSPriority(int priority)
          This method is invoked by the send method
 void setJMSRedelivered(boolean redelivered)
          Only useful for interprovider operations, otherwise ignored This method is normally invoked by the provider
 void setJMSReplyTo(javax.jms.Destination sender)
           
 void setJMSTimestamp(long timestamp)
          This method is invoked by the send method
 void setJMSType(java.lang.String jmsType)
           
 void setLongProperty(java.lang.String key, long value)
           
 void setObjectProperty(java.lang.String key, java.lang.Object value)
           
(package private)  void setPropertyReadOnly(boolean propertyReadOnly)
          Used internally
(package private)  void setReadOnly(boolean readOnly)
          Used internally
 void setShortProperty(java.lang.String key, short value)
           
 void setStringProperty(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT

public static final int TEXT
See Also:
Constant Field Values

BYTES

public static final int BYTES
See Also:
Constant Field Values

OBJECT

public static final int OBJECT
See Also:
Constant Field Values

MAP

public static final int MAP
See Also:
Constant Field Values

STREAM

public static final int STREAM
See Also:
Constant Field Values

STREAMING

public static final int STREAMING
See Also:
Constant Field Values

DEFAULT_TYPE

public static final int DEFAULT_TYPE
See Also:
Constant Field Values

log

private static java.util.logging.Logger log

ME

private static final java.lang.String ME
See Also:
Constant Field Values

global

protected Global global

content

protected byte[] content

type

protected int type

acknowledged

protected boolean acknowledged

readOnly

protected boolean readOnly

props

protected java.util.Map props

propertyReadOnly

private boolean propertyReadOnly

session

protected XBSession session

destination

protected javax.jms.Destination destination

redelivered

private boolean redelivered

priority

private int priority

messageID

private java.lang.String messageID

correlationID

private java.lang.String correlationID

deliveryMode

private int deliveryMode

expiration

private long expiration

replyTo

private javax.jms.Destination replyTo

timestamp

private long timestamp

jmsType

private java.lang.String jmsType
Constructor Detail

XBMessage

public XBMessage(XBSession session,
                 byte[] content,
                 int type)
Parameters:
session -
content -
type -
Method Detail

isAcknowledged

boolean isAcknowledged()

setAcknowledged

void setAcknowledged(boolean acknowledged)

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.JMSException

checkPropertiesReadOnly

protected final void checkPropertiesReadOnly(java.lang.String methodName,
                                             java.lang.String key)
                                      throws javax.jms.MessageNotWriteableException
Checks if the properties are readonly. If yes, then an exception is thrown Also checks if the key is null or empty in which case it throws an IllegalArgumentException is thrown

Parameters:
methodName -
key -
Throws:
javax.jms.MessageNotWriteableException

clearBody

public void clearBody()
               throws javax.jms.JMSException
Specified by:
clearBody in interface javax.jms.Message
Throws:
javax.jms.JMSException

clearProperties

public void clearProperties()
                     throws javax.jms.JMSException
Specified by:
clearProperties in interface javax.jms.Message
Throws:
javax.jms.JMSException

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key)
                           throws javax.jms.JMSException
Specified by:
getBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getByteProperty

public byte getByteProperty(java.lang.String key)
                     throws javax.jms.JMSException
Specified by:
getByteProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getDoubleProperty

public double getDoubleProperty(java.lang.String key)
                         throws javax.jms.JMSException
Specified by:
getDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getFloatProperty

public float getFloatProperty(java.lang.String key)
                       throws javax.jms.JMSException
Specified by:
getFloatProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getIntProperty

public int getIntProperty(java.lang.String key)
                   throws javax.jms.JMSException
Specified by:
getIntProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
                                     throws javax.jms.JMSException
Specified by:
getJMSCorrelationID in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
                                  throws javax.jms.JMSException
Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSDeliveryMode

public int getJMSDeliveryMode()
                       throws javax.jms.JMSException
Specified by:
getJMSDeliveryMode in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSDestination

public javax.jms.Destination getJMSDestination()
                                        throws javax.jms.JMSException
Specified by:
getJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSExpiration

public long getJMSExpiration()
                      throws javax.jms.JMSException
Specified by:
getJMSExpiration in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSMessageID

public java.lang.String getJMSMessageID()
                                 throws javax.jms.JMSException
xmlBlaster specific messageId is our unique timestamp

Specified by:
getJMSMessageID in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSPriority

public int getJMSPriority()
                   throws javax.jms.JMSException
Specified by:
getJMSPriority in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSRedelivered

public boolean getJMSRedelivered()
                          throws javax.jms.JMSException
Specified by:
getJMSRedelivered in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
                                    throws javax.jms.JMSException
Specified by:
getJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSTimestamp

public long getJMSTimestamp()
                     throws javax.jms.JMSException
Specified by:
getJMSTimestamp in interface javax.jms.Message
Throws:
javax.jms.JMSException

getJMSType

public java.lang.String getJMSType()
                            throws javax.jms.JMSException
Specified by:
getJMSType in interface javax.jms.Message
Throws:
javax.jms.JMSException

getLongProperty

public long getLongProperty(java.lang.String key)
                     throws javax.jms.JMSException
Specified by:
getLongProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String key)
                                   throws javax.jms.JMSException
Specified by:
getObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws javax.jms.JMSException
Specified by:
getPropertyNames in interface javax.jms.Message
Throws:
javax.jms.JMSException

getShortProperty

public short getShortProperty(java.lang.String key)
                       throws javax.jms.JMSException
Can handle String, Byte, and Short properties

Specified by:
getShortProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

getStringProperty

public java.lang.String getStringProperty(java.lang.String key)
                                   throws javax.jms.JMSException
Specified by:
getStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

propertyExists

public boolean propertyExists(java.lang.String key)
                       throws javax.jms.JMSException
Specified by:
propertyExists in interface javax.jms.Message
Throws:
javax.jms.JMSException

addToKeyAndCheck

public static java.lang.String addToKeyAndCheck(java.lang.String key)

get

public static ClientProperty get(java.lang.String key,
                                 java.util.Map map)

setBooleanProperty

public void setBooleanProperty(java.lang.String key,
                               boolean value)
                        throws javax.jms.JMSException
Specified by:
setBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setByteProperty

public void setByteProperty(java.lang.String key,
                            byte value)
                     throws javax.jms.JMSException
Specified by:
setByteProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setDoubleProperty

public void setDoubleProperty(java.lang.String key,
                              double value)
                       throws javax.jms.JMSException
Specified by:
setDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setFloatProperty

public void setFloatProperty(java.lang.String key,
                             float value)
                      throws javax.jms.JMSException
Specified by:
setFloatProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setIntProperty

public void setIntProperty(java.lang.String key,
                           int value)
                    throws javax.jms.JMSException
Specified by:
setIntProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationID)
                         throws javax.jms.JMSException
Specified by:
setJMSCorrelationID in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] correlationId)
                                throws javax.jms.JMSException
Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
                        throws javax.jms.JMSException
This method is invoked by the send method

Specified by:
setJMSDeliveryMode in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSDestination

public void setJMSDestination(javax.jms.Destination destination)
                       throws javax.jms.JMSException
This method is invoked by the send method

Specified by:
setJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSExpiration

public void setJMSExpiration(long lifeTime)
                      throws javax.jms.JMSException
This method is invoked by the send method

Specified by:
setJMSExpiration in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSMessageID

public void setJMSMessageID(java.lang.String messageID)
                     throws javax.jms.JMSException
This is overwritten when invoking the getter This method is invoked by the send method

Specified by:
setJMSMessageID in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSPriority

public void setJMSPriority(int priority)
                    throws javax.jms.JMSException
This method is invoked by the send method

Specified by:
setJMSPriority in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
                       throws javax.jms.JMSException
Only useful for interprovider operations, otherwise ignored This method is normally invoked by the provider

Specified by:
setJMSRedelivered in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination sender)
                   throws javax.jms.JMSException
Specified by:
setJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSTimestamp

public void setJMSTimestamp(long timestamp)
                     throws javax.jms.JMSException
This method is invoked by the send method

Specified by:
setJMSTimestamp in interface javax.jms.Message
Throws:
javax.jms.JMSException

setJMSType

public void setJMSType(java.lang.String jmsType)
                throws javax.jms.JMSException
Specified by:
setJMSType in interface javax.jms.Message
Throws:
javax.jms.JMSException

setLongProperty

public void setLongProperty(java.lang.String key,
                            long value)
                     throws javax.jms.JMSException
Specified by:
setLongProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setObjectProperty

public void setObjectProperty(java.lang.String key,
                              java.lang.Object value)
                       throws javax.jms.JMSException
Specified by:
setObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setShortProperty

public void setShortProperty(java.lang.String key,
                             short value)
                      throws javax.jms.JMSException
Specified by:
setShortProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setStringProperty

public void setStringProperty(java.lang.String key,
                              java.lang.String value)
                       throws javax.jms.JMSException
Specified by:
setStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException

setPropertyReadOnly

void setPropertyReadOnly(boolean propertyReadOnly)
Used internally

Parameters:
propertyReadOnly -

setReadOnly

void setReadOnly(boolean readOnly)
Used internally

Parameters:
readOnly -

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.