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

  1. public interface JMSDataBinding
  2. 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

Modifier and Type Field and Description
  1. static
  2. java.lang.String
$sccsid
  1. static
  2. int
ANY_MESSAGE
  1. static
  2. int
BASE_MESSAGE
  1. static
  2. int
BYTES_MESSAGE
  1. static
  2. java.lang.String
COPYRIGHT
  1. static
  2. int
MAP_MESSAGE
  1. static
  2. int
OBJECT_MESSAGE
  1. static
  2. int
STREAM_MESSAGE
  1. static
  2. int
TEXT_MESSAGE

Method Summary

Modifier and Type Method and Description
  1. int
getMessageType()
Return the message type that is supported by this data binding.
  1. boolean
isBusinessException()
Queries the DataBinding to determine whether the received message contains a fault (carried within a BusinessException).
  1. void
read(javax.jms.Message message)
Read the contents of the incoming JMS Message into a DataObject.
  1. void
setBusinessException(boolean isBusinessException)
This method is called by the runtime if the outgoing message contains a BusinessException.
  1. 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

  1. static final java.lang.String COPYRIGHT
See Also:

$sccsid

  1. static final java.lang.String $sccsid
See Also:

ANY_MESSAGE

  1. static final int ANY_MESSAGE
See Also:

OBJECT_MESSAGE

  1. static final int OBJECT_MESSAGE
See Also:

TEXT_MESSAGE

  1. static final int TEXT_MESSAGE
See Also:

BYTES_MESSAGE

  1. static final int BYTES_MESSAGE
See Also:

STREAM_MESSAGE

  1. static final int STREAM_MESSAGE
See Also:

MAP_MESSAGE

  1. static final int MAP_MESSAGE
See Also:

BASE_MESSAGE

  1. static final int BASE_MESSAGE
See Also:

Method Detail

getMessageType

  1. int getMessageType()
Return the message type that is supported by this data binding. Message type is one of the following types:
  • ANY_MESSAGE
  • OBJECT_MESSAGE
  • TEXT_MESSAGE
  • BYTES_MESSAGE
  • STREAM_MESSAGE
  • MAP_MESSAGE
  • BASE_MESSAGE
Returns:
Message type, represented by one of the static integer definitions above.

read

  1. void read(javax.jms.Message message)
  2. 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

  1. void write(javax.jms.Message message)
  2. 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

  1. 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

  1. 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.