|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.codestreet.messageforge.Converter com.codestreet.messageforge.ConverterBeanAndJMS
Converter class for (Java) Beans.
A bean must satisfy the following requirements: it must have a no-arg constructor, all properties that it wishes to be marshalled must have public get/set methods, the get and set methods must follow the design pattern getXXX() or GetXXX()and setXXX() or SetXXX(), and the set methods must take one arg.
Bean properties can primitive types (e.g. int), wrappers of primitive types (e.g. Integer), arrays of primitives (e.g. int[]), arrays of primitive wrappers (e.g. Integer[]), String, Date, BigDecimal,, String[], Date[], BigDecimal[], nested beans and arrays of nested beans.
This implementation assumes that the following JMS extensions are supported by the JMS provider: Nested messages are allowed, arrays of primitive types are allowed, and arrays of wrappers of primitive types are allowed. All these assumptions are valid for TIBCO's E4JMS.
Constructor Summary | |
ConverterBeanAndJMS()
|
Method Summary | |
static javax.jms.MapMessage |
marshal(java.lang.Object bean,
javax.jms.Session session)
Marshal a bean into a JMS message. |
static java.lang.Object |
unmarshal(javax.jms.MapMessage source)
Unmarshal a bean from a JMS message. |
static java.lang.Object |
unmarshal(javax.jms.MapMessage source,
java.lang.String beanName,
java.lang.String fullName)
Unmarshal a bean from a JMS message. |
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 |
Constructor Detail |
public ConverterBeanAndJMS()
Method Detail |
public static javax.jms.MapMessage marshal(java.lang.Object bean, javax.jms.Session session) throws ConverterException
bean
- Bean.session
- JMS session - this is required to create the JMS message.
ConverterException
public static java.lang.Object unmarshal(javax.jms.MapMessage source) throws ConverterException
source
- JMS message.
ConverterException
public static java.lang.Object unmarshal(javax.jms.MapMessage source, java.lang.String beanName, java.lang.String fullName) throws ConverterException
source
- JMS message.beanName
- Short name of bean.fullName
- Full name of bean (includes the package).
ConverterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |