IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.sca.jms.data
Interface JMSDataBinding

All Superinterfaces:
commonj.connector.runtime.DataBinding, java.io.Serializable
All Known Subinterfaces:
JMSObjectBinding
All Known Implementing Classes:
JMSDataBindingImplJava, JMSDataBindingImplXML

public interface JMSDataBinding
extends commonj.connector.runtime.DataBinding

A DataBinding represents the mapping between a native data format and an SDO DataObject, and vice-versa.

This interface is an extension of commonj.connector.runtime.DataBinding, and presents a JMS-specific view which should be implemented for use in JMS Exports and Imports.

It exposes methods which read and write to and from a JMS message, as well as exporting which type of JMS message is supported.

See Also:
DataBinding

Field Summary
static java.lang.String $sccsid
           
static int ANY_MESSAGE
           
static int BASE_MESSAGE
           
static int BYTES_MESSAGE
           
static java.lang.String COPYRIGHT
           
static int MAP_MESSAGE
           
static int OBJECT_MESSAGE
           
static int STREAM_MESSAGE
           
static int TEXT_MESSAGE
           
 
Method Summary
 int getMessageType()
          Return the message type that is supported by this data binding.
 boolean isBusinessException()
          Queries the DataBinding to determine whether the received message contains a fault (carried within a BusinessException).
 void read(javax.jms.Message message)
          Read the contents of the incoming JMS Message into a DataObject.
 void setBusinessException(boolean isBusinessException)
          This method is called by the runtime if the outgoing message contains a BusinessException.
 void write(javax.jms.Message message)
          Write the DataObject into an outgoing JMS Message.
 
Methods inherited from interface commonj.connector.runtime.DataBinding
getDataObject, setDataObject
 

Field Detail

COPYRIGHT

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

$sccsid

static final java.lang.String $sccsid
See Also:
Constant Field Values

ANY_MESSAGE

static final int ANY_MESSAGE
See Also:
Constant Field Values

OBJECT_MESSAGE

static final int OBJECT_MESSAGE
See Also:
Constant Field Values

TEXT_MESSAGE

static final int TEXT_MESSAGE
See Also:
Constant Field Values

BYTES_MESSAGE

static final int BYTES_MESSAGE
See Also:
Constant Field Values

STREAM_MESSAGE

static final int STREAM_MESSAGE
See Also:
Constant Field Values

MAP_MESSAGE

static final int MAP_MESSAGE
See Also:
Constant Field Values

BASE_MESSAGE

static final int BASE_MESSAGE
See Also:
Constant Field Values
Method Detail

getMessageType

int getMessageType()
Return the message type that is supported by this data binding. Message type is one of the following types:

Returns:
Message type, represented by one of the static integer definitions above.

read

void read(javax.jms.Message message)
          throws javax.jms.JMSException
Read the contents of the incoming JMS Message into a DataObject. Called before the getDataObject method is called by the runtime. An implementation of this method will process the payload of the incoming JMS message and will parse the data into the appropriate DataObject, created like this:

BOFactory bof =
(BOFactory)ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOFactory");
sampleBO = bof.create("http://namespace", "BOName");

Parameters:
message - The message whose payload is to be parsed.
Throws:
javax.jms.JMSException - Thrown if an error occurs during reading of the message.

write

void write(javax.jms.Message message)
           throws javax.jms.JMSException
Write the DataObject into an outgoing JMS Message. Called after the setDataObject method is called by the runtime. The supplied message must be of the same type as returned by getMessageType.

This method will be the converse of the read method, and will serialize the contents of the DataObject the the wire format in the JMS message.

Parameters:
message - The message to be populated with the serialized DataObject.
Throws:
javax.jms.JMSException - Thrown if an error occurs during writing of the message.

isBusinessException

boolean isBusinessException()
Queries the DataBinding to determine whether the received message contains a fault (carried within a BusinessException).

Returns:
A boolean value stating whether the message payload is a fault.

setBusinessException

void setBusinessException(boolean isBusinessException)
This method is called by the runtime if the outgoing message contains a BusinessException. An implementation of this method may set some internal state if this information is important to propagate - and in this case, the interanl state will be acted on by the write() method.

Parameters:
isBusinessException - True or false, specified by the caller.

IBM WebSphere Application ServerTM
Release 8