com.codestreet.messageforge
Class ConverterJMS

java.lang.Object
  extended bycom.codestreet.messageforge.Converter
      extended bycom.codestreet.messageforge.ConverterJMS

public abstract class ConverterJMS
extends Converter


Field Summary
static java.lang.String MSG_NAME
          Name of String property with the message name.
static java.lang.String XML_FIELD_NAME
          Name of String field with the XML representation of non-JMS supported field types.
 
Constructor Summary
ConverterJMS()
           
 
Method Summary
static void addProperties(javax.jms.Message outMsg, java.util.Map props)
           
static boolean getTibcoJmsMsgExt()
          Get TIBCO message extension flag.
static javax.jms.MapMessage marshal(RMapMessage source, javax.jms.MapMessage target, javax.jms.Session session)
          Create a javax.jms.MapMessage from a RMapMessage.
static javax.jms.MapMessage marshal(RMapMessage source, javax.jms.Session session)
          Create a javax.jms.MapMessage from a RMapMessage.
static void setTibcoJmsMsgExt(boolean ext)
          Set TIBCO message extension flag.
static RMapMessage unmarshal(javax.jms.MapMessage source)
          Create and set a RMsg from a javax.jms.MapMessage.
static void unmarshal(javax.jms.MapMessage source, RMapMessage target)
          Create and set a RMsg from a javax.jms.MapMessage.
 
Methods inherited from class com.codestreet.messageforge.Converter
createMsgObject, createMsgObject, dateToDouble, dateToLong, dateToStr, getBeanValidator, getLenient, getVersion, setBeanValidator, setDateFromDouble, setDateFromLong, setDateFromStr, setDefaultFactory, setMaximumFractionDigits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_NAME

public static final java.lang.String MSG_NAME
Name of String property with the message name.

See Also:
Constant Field Values

XML_FIELD_NAME

public static final java.lang.String XML_FIELD_NAME
Name of String field with the XML representation of non-JMS supported field types.

See Also:
Constant Field Values
Constructor Detail

ConverterJMS

public ConverterJMS()
Method Detail

setTibcoJmsMsgExt

public static void setTibcoJmsMsgExt(boolean ext)
Set TIBCO message extension flag.

Parameters:
ext - TIBCO message extension flag.

getTibcoJmsMsgExt

public static boolean getTibcoJmsMsgExt()
Get TIBCO message extension flag.

Returns:
TIBCO message extension flag.

marshal

public static javax.jms.MapMessage marshal(RMapMessage source,
                                           javax.jms.Session session)
                                    throws ConverterException
Create a javax.jms.MapMessage from a RMapMessage. The marshalling to JMS is done by in three steps: First a String property with the name of the message is set in the javax.jms.MapMessage. Next all fields in the RMapMessage that are supported in JMS are copied to the javax.jms.MapMessage. Finally, all fields in the RMapMessage that are not supported by JMS are converted into XML and add to the javax.jms.MapMessage as a String.

Parameters:
source - Source message.
session - JMS session. This is used to created nested map messages if necessary.
Returns:
javax.jms.MapMessage.
Throws:
ConverterException
See Also:
RMapMessage, RMsg, Session, MapMessage

marshal

public static javax.jms.MapMessage marshal(RMapMessage source,
                                           javax.jms.MapMessage target,
                                           javax.jms.Session session)
                                    throws ConverterException
Create a javax.jms.MapMessage from a RMapMessage. The marshalling to JMS is done by in three steps: First a String property with the name of the message is set in the javax.jms.MapMessage. Next all fields in the RMapMessage that are supported in JMS are copied to the javax.jms.MapMessage. Finally, all fields in the RMapMessage that are not supported by JMS are converted into XML and add to the javax.jms.MapMessage as a String.

Parameters:
source - Source message.
target - Target map message.
session - JMS session. This is used to created nested map messages if necessary.
Returns:
javax.jms.MapMessage.
Throws:
ConverterException
See Also:
RMapMessage, RMsg, Session, MapMessage

unmarshal

public static RMapMessage unmarshal(javax.jms.MapMessage source)
                             throws ConverterException
Create and set a RMsg from a javax.jms.MapMessage.

Parameters:
source - Source message.
Returns:
Unmarshalled message object.
Throws:
ConverterException
See Also:
unmarshal(javax.jms.MapMessage, RMapMessage)

unmarshal

public static void unmarshal(javax.jms.MapMessage source,
                             RMapMessage target)
                      throws ConverterException
Create and set a RMsg from a javax.jms.MapMessage.

Parameters:
source - Source message.
target - Target message object.
Throws:
ConverterException

addProperties

public static void addProperties(javax.jms.Message outMsg,
                                 java.util.Map props)
                          throws javax.jms.JMSException
Throws:
javax.jms.JMSException


Copyright © 2003-2006 CodeStreet. All Rights Reserved.