com.softwareag.entirex.jms
Interface JMSFormatter

All Known Implementing Classes:
TextFormatter, TextFormatterReplyQueue

public interface JMSFormatter

Interface to allow customer specific formatting of the JMS messages to connect to non-JMS clients. This interface has two methods. One converts byte arrays into JMS messages and the other converts JMS messages into byte arrays. The JMS messages are used by the JMS application and the byte arrays are send to or received from the EntireX Broker. Applications using the Broker ACI with units of work can send and receive these messages.
The methods have to obey the encoding of the byte array. Use the default encoding in conjunction with translation and conversion of the EntireX Broker. The byte array may contain binary parts.

Since:
7.1.1.54

Method Summary
 byte[] fromJMSMessage(javax.jms.Session session, javax.jms.Message message)
          Format a JMS message to send to a non-JMS application.
 javax.jms.Message toJMSMessage(javax.jms.Session session, byte[] buffer)
          Create a Message from the bytes received from the Broker.
 

Method Detail

fromJMSMessage

byte[] fromJMSMessage(javax.jms.Session session,
                      javax.jms.Message message)
                      throws javax.jms.JMSException
Format a JMS message to send to a non-JMS application. Use the methods of Message and its subclasses to access the content of the message.

Parameters:
session - the session used to send the message.
message - the Message to send to a non-JMS client.
Returns:
the message as a byte array in a customer specific format. It is not allowed to return null or an empty byte array.
Throws:
javax.jms.JMSException - if the message is not created properly. Wrap all Throwable objects into JMSExceptions and re-throw them.

toJMSMessage

javax.jms.Message toJMSMessage(javax.jms.Session session,
                               byte[] buffer)
                               throws javax.jms.JMSException
Create a Message from the bytes received from the Broker. Use the createMessageXxx methods of the session and the methods of Message and its subclasses to create the message.

Parameters:
session - the session which received the byte array.
buffer - the bytes received from the broker.
Returns:
a Message, created in the session.
Throws:
javax.jms.JMSException - if the message is not created properly. Wrap all Throwable objects into JMSExceptions and re-throw them.