biz.hammurapi.jms.adapter.converters
Class ObjectMessageConverter

java.lang.Object
  extended by biz.hammurapi.jms.adapter.converters.ObjectMessageConverter
All Implemented Interfaces:
Converter

public abstract class ObjectMessageConverter
extends java.lang.Object
implements Converter

Reads and writes objects from/to ObjectMessage.

Author:
Tatyana Konukova

Constructor Summary
ObjectMessageConverter()
           
 
Method Summary
 javax.jms.Message convert(java.lang.Exception ex, javax.jms.Session session, java.util.Map properties, javax.jms.Message request)
          Writes Exception to ObjectMessage.
 java.lang.Object convert(javax.jms.Message message, java.util.Map properties)
          Reads object from ObjectMessage.
 javax.jms.Message convert(java.lang.Object obj, javax.jms.Session session, java.util.Map properties, javax.jms.Message request)
          Writes Object to ObjectMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectMessageConverter

public ObjectMessageConverter()
Method Detail

convert

public java.lang.Object convert(javax.jms.Message message,
                                java.util.Map properties)
                         throws java.lang.Exception
Reads object from ObjectMessage. If is-error boolean property is true then return object gets cast to Exception and thrown.

Specified by:
convert in interface Converter
Parameters:
message - Source message
properties - Configuration properties
Returns:
Object created from message data
Throws:
java.lang.Exception

convert

public javax.jms.Message convert(java.lang.Object obj,
                                 javax.jms.Session session,
                                 java.util.Map properties,
                                 javax.jms.Message request)
                          throws java.lang.Exception
Writes Object to ObjectMessage. Object shall be serializable. Correlates by message ID.

Specified by:
convert in interface Converter
Parameters:
obj - Source object
session - Session to create message
properties - Configuration properties
request - Request message, can be null.
Returns:
Populated and ready to send message
Throws:
java.lang.Exception

convert

public javax.jms.Message convert(java.lang.Exception ex,
                                 javax.jms.Session session,
                                 java.util.Map properties,
                                 javax.jms.Message request)
                          throws java.lang.Exception
Writes Exception to ObjectMessage. Exception shall be serializable. Boolean property is-error is set to true to indicate that payload is exception. Correlates by message ID.

Specified by:
convert in interface Converter
session - Session to create message
properties - Configuration properties
request - Request message, can be null.
Returns:
Populated and ready to send message
Throws:
java.lang.Exception


Copyright © 2006 Hammurapi Group. All Rights Reserved.